First, create entity beans (entities)
Second, create a database connection
Third, the establishment of the DAO service layer (generally written as an interface, and then directly in the service layer to implement its method)
Iv. Writing Service Tiers
V. Writing a servlet
(Understanding of a few simple methods in the servlet layer)
1.request.setattribute (Name,value) is used to store the values obtained from the database in the invocation service in the request scope
2.req.getrequestdispatcher ("list.jsp"). Forward (REQ,RESP) means that the value is passed to the JSP page, and the forward method can only get internal resources. We should clarify the difference between him and Sendredirect ().
Vi. Configure the service to be written in the Web. xml file
1. The configuration is simplified as follows
<servlet>
<servlet-name></servlet-name>
<servlet-class></servlet-class>
</servlet>
<servlrt-mapping>
<servlet-name></servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>
Vii. Writing JSP pages
I am also a novice this is I write code is the side of the summary of writing, there are many do not understand, ask the big God message, thank you.
This article from the "12212886" blog, reproduced please contact the author!
Novice must master the basic SERVLET,JSP,JDBC development general process