Website Development Record (c)

 

thought:

1, all displaying the page .jsp files, jsp page display and is only responsible for data submission, does not deal with logic section, jsp page-one correspondence with the servlet, servlet will get session request, if not to create a new, written in the session lastURL name attribute is the current servlet, jsp pages lastURL reads the session, if it is empty or not equal to the current corresponding to jsp servlet name, then jump to the corresponding servlet.

2, has acquired all servlet session request, and create a new session in the absence of circumstances. It will own servlet name into the session lastURL field.

In LoginServlet, the field will be written account in the session.

Servlet in the background, the field will determine account to determine whether registration and login user.

3, in view of the routing problem jump, defined base tag attributes in all jsp page for the website root directory.

<%
pageContext.setAttribute("basePath", request.getScheme()+"://"+request.getServerName()+":"+
request.getServerPort()+request.getContextPath()+"/");
%>
<base href="${basePath}">

 

Home

Home index.jsp is scheduled entry of all site pages, which is broadly divided into four modules.

A module

Including login LoginServlet, registered RegisterServlet and jump to their own management module AdminServlet.

 Reading account field of the session, if not empty, AdminServlet inlet is displayed; otherwise, the login inlet

Module II

Including the blog module BlogServlet, file module FileServlet, video module VideoServlet, music module MusicServlet and site notice and contact module WebsiteServlet.

Another little feature module drop-down list to include some small module entry, to be determined.

Module III

The latest five blog, each of which gives the title, creation time, and the first 80 words classified information. BlogShowServlet can be reached by topic.

Module IV

Classification statistics, the number of each category is given blog, you can reach the classification of blog module LoginServlet inquiry by category tags link.

Module V

Search box, or you can be fuzzy query Precise query to blog

Guess you like

Origin www.cnblogs.com/blunFan/p/11654390.html