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
1. advantages of using the window. print () method: support for multiple browsers disadvantages: cancel printing, hide unnecessary printing information, and then display it in a complicated way. You can print the current page
2. Use third-party
1. Use javascriptCopy codeThe Code is as follows:Or:Copy codeThe Code is as follows:
2. Use HttpSession to clear the session and exit the current logon.Copy codeThe Code is as follows: exit Main Code of logout. jsp:Copy codeThe Code is as follows:
Method 1:Run the openTheIndexPage () method after the page is fully loaded as follows:Copy codeThe Code is as follows: Telecommunications Data Collection System Method 2: It can be the following, but the effect is not as good as method 1.Copy
It took two days to figure out the preview function.The task requirements are as follows: 1: The jsp page contains an image (pic_1)2: Click the image to bring up a page similar to the resource manager.3: select an image and preview it at pic_1.I
CheckboxInterceptor: the interceptor is at the position of defaultStack 11th. Check that the interceptor name is used to process the checkbox. To understand the role of this interceptor, you must know that when a form contains a checkbox, assume
ParametersInterceptor the interceptor is at the position of defaultStack 15th. Here we skip an interceptor. First we will talk about ParametersInterceptor, and then we will talk about the third Interceptor. Because the blocker inherits from
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. Download NetBean6.1
NetBean6.1 includes the Web servers Tomcat6.0.16 and GlassFish V2. Therefore, after NetBean is installed, these two servers are automatically installed.
2. View Tomcat attributes
In NetBean IDE, open
1. File-> New...-> Web-> double-click the Standard Servlet icon to start the wizard for creating a Standard Servlet.
Specify the Servlet class name as Excel File Servlet, set the package name as bookstore. servlet, and press Next to Next.
2.
A major difference between Servlet and JSP is that Servlet can enable the Servlet to automatically start the Servlet when the web Container starts through the configuration of the Web. xml file. You can use this feature of Servlet to load unchanged
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 =
Garbled characters occur when jst is imported to html in jsp. The cause is org. apache. taglibs. standard. tag. common. core. ImportSupport.
If the charEncoding value of is null, charEncoding is the default value, that is, the
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
Out-of-class questions-JSP FAQsMethod 1 encoding Garbled text: 1 encoding for string Transcoding
New String (student. getName (). getBytes (iso8859_1), UTF-8)
Disadvantage: you must know the encoding format of the source data. (The request is
Use MIDlet to activate Servlet. You can activate Servlet like activating a CGI in MIDlet. This section describes two examples:
In the first example, use the GET operation to activate the Servlet and display the result.The second example is 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service