Java Web Learning

Source: Internet
Author: User

Always want to be determined to learn the Java Web, but always interrupted, although I am the direction of iOS, but I think the background is very important, after all, mobile is actually more to show the background pull to the information, so mobile can not always be subject to the background, you crossing think?

These two days mainly looked down on the servlet's things, first put down the notes. Then about the ssh thing, configuration of things, feel the path cumbersome, look at a day did not see what east, to make a form submission is always a problem, mainly the request resource path is always wrong, there is a little ambiguity about its mechanism. First of all, the two look at the servlet things summed up it.

1. tomcat File structure:

A, the bin directory is a tomcat command.

B. The Conf directory has a configuration file for the server.

C, log directory is the logging information.

D. temp directory exists in the JVM for temporary files.

E, the WebApps directory holds Web application projects.
F, work directory exists temporary text for Web project
Thing

2, the request of JSP nature is to go to the project request JSP resources, the server translates the request to the corresponding Java file processing, generate HTML text response to the browser. The Java servlet file is compiled into a class file that is placed in the Web-inf directory in the project and represents the servlet specific to this project. If you want the servlet to be available to all Web service catalogs, the bytecode file that created the servlet needs to be stored in the classes directory of the Tomcat installation directory, for example, the directory of the machine used in this book:

D:tomcat\jakarta-tomcat-4.0\classes

If you want a servlet to be available only for a directory of a project, you need to store the servlet bytecode file in the webapps/project/web
-inf/classes.

3. visit the JSP page to access the servlet through forms and hyperlinks

When accessing resources through hyperlinks, the resources under the Classes folder in the Web-inf file under the project name are saved as access.
Server is in this directory to find the browser access to the resource directory, the folder is stored under the compiled class file

4, HttpServlet In addition to the INIT, service, destroy methods, the class has two very important methods: Doget

And DoPost, which are used to process customer requests and respond.

5. servlet thread-Safe threadlocal mode

Java Web Learning

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.