First, build a Web project, tune the Tomcat container, and then import the JDBC Jar package
Partitioning the architecture to fix:
Two. The entity layer, the DAO layer, and the implementation layer are like OOP, where layers interact with layers, specifically the business Logic layer (servlet)
Build a Newservlet class and then inherit HttpServlet thereby inheriting its doget (), DoPost () method in Doget
Call Dopost (request, response);
Dopost the generic collection into the request scope and forwards it.
Enter index.jsp to get the title position for the page display:
<%List<NewsEntity> list= (list<newsentity>) request.getattribute ("List"); for (newsentity item:list) { %><li><a href= ' newspages/news_read.jsp ' > <%=item.getnewstitle ()%> </a><span> < %=item.getnewscreatedate ()%> </span></li><%}%>
Tip: Finally, change the path on the Web. Xml page.
Press release System (first page)