JSP Learning Notes

Source: Internet
Author: User
Tags execution variable tomcat
js| Note one, installation j2sdk1.4.2
The installation is still very simple, even if you just go down on the next one OK. At least windows is like this.
Then it's set J2SDK.
There are three parameters that need to be set. Java_home,path and Classpath. are set in the system environment variable.
Press WINDOWS key + PAUSE to bring up the system Features window, select Advanced-〉 environment variable-〉 system variable, and then "new".
Java_home = C:\j2sdk1.4.2_04
PATH =%java_home%\bin
Classpath=c:\j2sdk1.4.2_04\lib\tools.jar; C:\j2sdk1.4.2_04\lib\dt.jar;

Second, install Tomcat 5.0
Oh, but also a meal next can be done, but it is best to change the installation path. Make a simple point, don't what space ah, point number ah what symbols have, and a long string, too tired, on the Tomcat50 is very good. Let's see what you can do with your own plate. Port defaults to 8080.

So it should be OK. Anyway, my tomcat is okay, and everything else is a lot.

Third, the JSP at the time of execution only the first execution is compiled, then use the compiler generated servlet class file, when the JSP file changes, Tomcat will find, and then compile the file again. But sometimes after you change the JSP file, for some reason, Tomcat does not automatically update, but it always uses the servlet class that was generated before the unchanged JSP file.
The solution is to manually delete the servlet's source files and class files for Tomcat to recompile.
The generated servlet source files and class files are placed by Tomcat in a special directory: the Tomcat installation directory \work\catalina.

Four, similar to ASP, JSP is also used <% and%> as a mark of the program section. This allows the JSP to be divided into two parts, some of which are outside the <%%>, Tomcat (or possibly other JSP Container) is not processed, the other part is within <%%> and must be handled by Tomcat. and pay special attention to the problem that the case must be consistent.

With <%%> as a marker, this poses another problem. A replacement is required where the output <% and%> are needed, or Tomcat will report an error to the program.
The symbols that need to be replaced are:
Single quotes ' Change to \ '
Double quotes "change to \" or "
Slash \ Change to \
Start label <% Change to <%
End tag%> to%\> or%>



Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.