1. There are 4 kinds of common object-oriented design patterns:
Factory mode, singleton mode, facade mode, and MVC architecture pattern.
After Sun introduced JSP technology, it also recommended two kinds of Web application development mode, one is
Design page, head, navigation bar, foot, all the pages are basically consistent, do not repeat the design on each page, and the use of the general part of the stored as one of the JSP page, using the page only need to refer to the pattern
There are 2
There is a demand, need to use a random point in the DIV distribution, conveniently wrote a, and finally found that the demand has changed, useless to.
mice px;height:px;position:absolute;border:1px solid #c9d5ed; "
>
form page in JSP
/delectservlet" Method=post> number username password name &L t;/th> mailbox sex birthday Hobby
Salary other role ${person.id} ${person.username} ${person.passwd} ${person.realname} ${person
Problem:In the Struts2 failed, not only turn the past also reported 404 errors. I do not know if it is not supported in STRUTS2 or requires additional configuration.
Reason:Because Struts2 uses a filter to handle requests, the default is to
JSP summary of issues in which pages cannot be refreshed or prevented from refreshing
If you want the form to refresh when you select, delete, modify, and so on, you need to add: window.returnvalue=0.
such as leadership/leader_ctl.jsp
First write the filter code in the SRC directory
Package filter;
Import javax.servlet.*;Import javax.servlet.http.*;Import java.io.*;
public class Myfilter implements Filter {Private Filterconfig FC;
public void Init (Filterconfig FC) throws
Application Scopes
Application The Javax.servlet.ServletContext object represents the container that executes the JSP
Page Scopes
Config This Javax.servlet.ServletConfig object represents the JSP configuration option. As with the servlet,
/**
* Write the following Sessioncounter.java
* and compiled to Sessiioncounter.class
* Then put it on the classpath of your website
* Sessioncount (build this directory yourself) below
*/
Package sessioncount;Import javax.servlet.*;Import
1. Actioncontext
In STRUTS2 development, in addition to automatically setting request parameters to action fields, we often need to get some information directly from the action (request) or session (sessions), or even directly to Javaservlet HTTP
The compilation environment is eclipse.
First in the JSP page, make the following settings:
This allows you to obtain the directory of your project, if your project name is TestStruts2, then the BasePath value is:
Changed part of the code, the implementation of a sudden encounter the title exception, baffled, obviously did not move JSP and servlet, how suddenly reported this error ...
There is no solution on the Internet, and there is no relevant information.
In X:\Program files\myeclipse 6.0\myeclipse\eclipse\plugins\com.genuitec.eclipse.wizards_6.0.1.zmyeclipse601200710 \templates\jsp directory to find JSP.VTL, duplicate a copy, renamed to JSP2.VTL, and then change the contents of the inside to their
Method One
Submit to this page "dividepage.jsp"
Paging display School Number Name Gender Age Birthplace Faculty Change Delete
/**
The main purpose of the following database connection is to find the total number of records
This article describes the filter to set the problem of character encoding, by writing a servlet and configuration web.xml to achieveThis eliminates the need for the code of Pride characters in each JSP page, and the value needs to be encoded in the
Dtree tree-shaped structure, very convenient, very suitable.
Download Dtree.zip Package Please go to the address below to download
http://jinchun1223.javaeye.com/admin/blogs/421817
String path = Request.getcontextpath ();String basepath =
This section focuses on using SPRINGMVC for controller to view, involving code that contains JSP views,
Unlike the largest configuration point in the previous chapter:
The controller @ResponseBody that no view points to is critical code that
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.