Manually developing dynamic Resources
1 The difference between static and dynamic resources
Static resources: When a user accesses this resource multiple times, the source code of the resource never changes the resource.
Dynamic resource: When a user accesses this resource multiple times, the source code of the resource may send a change.
Development technology of dynamic resources
Servlet: The Java language to write dynamic resource development techniques.
Servlet Features:
1) Common Java class, inherit HttpServlet class, overwrite Doget method
2) The Servlet class can only be handed to the TOMCAT server!!!! (developers can't run themselves!!!) )
The servlet manually writes the steps:
1) Write a servlet program that inherits HttpServlet
2) Locate the class bytecode of the HelloServlet classes and copy them to the Web-inf/classes directory in a Tomcat Web application.
3) Configure the servlet in the Web. xml file under the current application.
4) Start the Tomcat server, run access
Visit Servlet:http://localhost:8080/myweb/hello
Tool development Dynamic Resources
1) Create Web project (Javaweb project)
2) Create a static resource file under Webroot,
3) Create a dynamic resource file under SRC
3.1 New---servlet (servlet code generator)
3.2 Write Pacakge, class name, modify mapping URL
4) Associating a Tomcat server
4.1 window-> Preferences-> myecplise-Servers Tomcat 6.x (note Be sure to enable)
5) Deploy the Web project app. (Copy web App to Tomcat's WebApps directory)
6) Start the Tomcat server
7) Accessing the servlet Http://localhost:8081/day08_web/hello
Static Resources and dynamic resources