In jsp learning, variables on the other jsp page are often called on one jsp page. The following is a summary of the learning over the past few days.
There are multiple methods to call variables between jsp pages:
1. Get parameters through the
Copy codeThe Code is as follows:// Filter classPublic class EcondingFilter implements Filter {Private String charset = null;Private ServletContext context = null;Private String path = "";/*** Store data in a local file before destruction*/Public
In the past few days, we have encountered a problem in the design of JSP message boards. First read one:
This is a picture taken randomly on a news page. If there are too many messages, the entire page would have to be long and long, which directly
There are several methods for jsp to obtain the session value from the action:
For example, there is a session ("sessionid", "sessionValue") in my action ")
1. Obtain it using the struts Tag:
Ii. session is also one of the built-in objects and
Like starting struts2, it also has an entry, that is, the doFilter method of org. apache. struts2.dispatcher. ng. filter. StrutsPrepareAndExecuteFilter.
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws
1 because struct2 functions such as file upload and data verification are all set by the system's defaultThe interceptor in defalutStack is implemented, so we define that the interceptor must reference the default defalutStackIn this way, other
Today, the error "failed to create the java virtual machine" was reported when zend for eclipse 10.5 was opened. gg immediately found that the PermSize and MaxPermSize configuration problems were solved.
When zend for eclipse 10.5 is enabled, an
FileUploadInterceptor: the interceptor is at the 10th position of defaultStack. You can see its name as it is used to process file uploads. For file uploads, you should know: struts2 uses the commons-fileupload component to process file uploads.
ActionMappingParametersInteceptor the ActionMappingParametersInteceptor interceptor is in the defaultStack 14th position. The interceptor inherits from ParametersInterceptor and is also used to set parameters to ValueStack, except that the
Summary: The Interceptor is a very important component of struts2 and an extremely subtle part of struts2. Many functions of struts2 are implemented through these interceptors, such as exception handling, file Upload request parameter assignment,
Some tables that display information are used in the project. The table header is not fixed and the table content is retrieved from the background instantly. Considering the reusability, I wrote a table template using jsp, you can obtain the List
1. External Style
When a style needs to be applied to many pages, the external style sheet is ideal. When using an external style sheet, you can change the appearance of the entire site by changing a file. Use the label to link to the style sheet
Learn With your mind
Struts tag definition taglib
Set the Development Mode devmode in Struts. xml
Set the default encoding in Struts. xml
The Struts. xml file contains other modules.
Mark error in
In the past, I only knew that spring has an IOC mechanism. Recently, I checked the source code of struts2 and found that struts2 also provided this mechanism. So I wrote an example to test it. I didn't expect it to be a good one. This example is
Use jsp to achieve the most basic page flip:
Search
"); Out. println (" Total number of records: "+ intRowCount +""+""); Int PgFirst = (intPage-1) * 20 + 1; // The first entry of the number of pages to be displayed List articleList =
We know that the double type will involve precision loss during processing, for example, double d = 100*1.005; the result of result d is 100.49999999999999. How can this problem be solved by DecimalFormat, it is used to round the double type as
The StrutsConversionErrorInterceptor interceptor is at the position of defastack stack 16th and is used to handle type conversion errors. The interceptor inherits from ConversionErrorInterceptor and most of its functional logic is in
In the past, the web Development page layer was basically used. Recently, the webpage Layer Technology of the company's java project was velocity. I heard that jsp is going to be eliminated, and I do not know whether it is true or false, but I still
To implement JSONP cross-origin access, you must first understand what is cross-origin? What is the relationship between JSONP and JSON? 1. What is cross-origin? Cross-Domain simply means that the program under one domain name interacts with the
Today, we will select radio by default based on the parameter. After finding the data in js for a long time on the Internet and then calling it after loading the page, the result will not work for more than one hour-The js function is not called.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service