(1) Add:
Httpsession session = request. getsession (true );
Session. setmaxinactiveinterval (900 );The unit of the parameter 900 is seconds. That is, the session will expire after 15 minutes of no activity.Note that the time set for this session
Relearn JSP-set the catalina_home environment variable
1. catalina_home is the alias of the tomcat installation path to facilitate the use of Tomcat
2. Computer> Properties> environment variables: Create an environment variable. The variable name
Differences between two JSP page Jump Methods
Method 1:Responst. sendredirect ("testjsp ");The first method is to jump to the test. jsp page. Parameters in the session range can be passed, but the request parameters cannot be
On the homepage of J2EE development, choose index.htm or index. jsp.
During J2EE development, the home page can usually be index.htm, index.html, index. jsp, default.htm, default.html, and default. jsp. Do you know which one to use?
In the past,
The self-assembly method is roughly as follows: divide the content of the entire page into different view components. The responsibility of displaying the page itself is to include these view components, and construct the complete HTML response in
I went to the interview the day before yesterday and met a technical interviewer. I asked a lot of questions and did not answer them. Instead, I did not understand them well enough and did not summarize them. The most typical is the hierarchy of
Maybe many people like me have found ckfinder and kcfinder, but suddenly they don't support Java, and then they are very lost ~~
I tried tomcat to run php to run ckfinder, But I found many errors such as directory permissions.
Finally, because I
If the address is http: // localhost: 8080/deviantart/test/myjsp. jsp
Request. getcontextpath ()/deviantartObtain the container context path, which is generally the relative path of the website (project name ). If it is the root directory, the
Configure data sources
Design and modify the context. XML and Web. xml files for the Web application configuration data source. Add the element defining the data source to the context. xml file and the element to the Web. xml file. The
JAVA:
httpservletrequest request = servletactioncontext. getrequest ();
String remoteip = (string) request. getremotehost ();
If the client uses a proxy, the method for obtaining the real IP address is:
after proxy, the server
According to the general development mode, web applications can be divided into three layers: web layer, business layer, and data access layer. That is to say, the MVC (model, view, control) mode.
In this mode, JSP is only responsible for
Flex is embedded in JSP in the form of jstl. The first sentence in the JSP file is
Below is the running
Source code test. jspThe input and output characters in JSP are encoded. I use tomcat5.5, which may vary with other servers!
String data =
Finally, I finished writing the servlet. In fact, I figured out the servlet. Then I thought it was very easy to look at the JSP. Later I wrote it quickly, and the notes were seriously lagging behind the reading progress.
Never forget that JSP
By the way to help the master to promote the original http://www.java1234.com/a/yuanchuang/ video tutorial, although not professional training structure, but fortunately explain delicate, easy to understand!
I have always thought that JSP & servlet
Input indicates an input object in the form, which is divided into text input boxes, password input boxes, single choice/check boxes, and submit/Reset buttons according to the type.
1, type = textThe input type is text, which is the most common
1.ServletWhat is?
Java provides a complete set of client/server solutions. In this solution, the program can be automatically downloaded to the client and executed. This is the applet. But it is only half of the problem. The other half of the
Overview of JSP built-in objects
(1) Request object of the HttpServletRequest classRole: indicates the request object. It is mainly used to receive data transmitted from the client to the server over HTTP.(2) Respone object of the
I. File Upload
Uploading files is a frequently used function in Web development. For example, uploading photos in the B/S-based personnel information management system and uploading images in the news publishing system ..... To implement the file
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