Dynamic Web page development jsp, dynamic web page jsp
1. What are the advantages of dynamic web pages?
① Interactivity: The webpage dynamically changes and displays content based on user requirements and choices.
③ Automatic update: The page content is automatically generated without changing the Page code.
④ Randomness: when different users access a website at different times, different page effects may occur.
1 2. How does one access the database using JDBC? 2 Resolution: 3 // 01. define the driver String 4 Private final static String driver = "com. microsoft. sqlserver. jdbc. SQLServerDriver "; 5 // 02. define the connection String 6 private final static String url = "jdbc: sqlserver: // 192.168.8.50: 1433; DatabaseName = Myschool"; 7 // 03. username 8 private final static String username = "sa"; 9 // 04. password 10 private final static String pwd = ""; 11 // 05. create Connection 12 Connection con = DriverManager. getConnection (url, user, pas Sword); 13 // 05. execute the operation 14 PreparedStatement st = null; 15 String SQL = "insert into grade (gradename) values (?) "; 16 try {17 st = con. prepareStatement (SQL); 18} catch (SQLException e) {19 e. printStackTrace (); 20} 21 22 try {23 st. setString (1, gradename); 24} catch (SQLException e1) {25 // TODO Auto-generated catch block26 e1.printStackTrace (); 27} 28
1 3. How to introduce CSS and JS files to webpages? 2. Use the link label as follows: 3. Use the script label in <link href = "css/myCart.css" type = "text/css" rel = "stylesheet"/> 4, introduce js as follows 5 <script src = "js/jQuery1.11.1.js" type = "text/javascript"> </script>
4. What is a dynamic webpage?
Dynamic Web pages are interactive web pages that run on servers and are designed in programming languages,
They will return different webpage content based on certain conditions. Websites that allow users to interact with the server
5. program architecture (B/S and C/S architecture)
B/S: a program that can be executed only through a browser
Advantage: it is convenient to upgrade the program. Once the function of the program needs to be changed, you only need to update the server-side program.
The client program, that is, the browser, does not need to perform any additional operations.
C/S: a program that can be accessed without a browser
Advantage: 01. Good interaction: users can better use shortcut keys.
02. Better hardware control.
6. TomCat directory structure (important)
Conf: various configuration information in web applications,
★: Server. xml: configure the port and host
★: Tomcat-users: the user monitors whether the tomcat server is started. the user name and password used to manage all web applications are displayed on the page.
★: Web. xml: records the start page information.