JSP dynamic page

Source: Internet
Author: User
Tags naming convention

1. What is a Dynamic Web page?

Dynamic Web pages are programs or Web pages that run on the server side, and they return different pages with different customers and at different times.

Note: inserting flash in a static web page, although Flash is moving, does not mean that the page is a Dynamic Web page. Refer to the features of dynamic Web pages.

2, the characteristics of dynamic Web pages?

(1), interactivity: That is, the Web page will be based on user requirements and choices and dynamic change and response. Web sites that use Dynamic Web technologies can interact with users.

(2), Automatic Update: No manual operation, it will automatically generate new pages, can save effort.

(3), randomness: that is, when different times, different people visit the same URL will produce different page effects.

3. Why do I need dynamic Web pages?

Static Web pages do not really interact with users. Static Web page content is fixed, when you modify the elements of the page, you need to re-upload the page to the server to overwrite the original page. Not conducive to maintenance work. Dynamic Web pages can compensate for these shortcomings.

3, what is b/s technology (structure, mode), what is C/s technology (structure, mode)?

b/S (browser/server, browser/server). In this structure, the program is completely placed on the server, and through the application server to communicate with the database server, the client computer does not need to install the client software, the system interface is displayed through the browser.

c/S (client/server, client/server). Divided into the client and server two tiers, the application software installed on the client side, through the network and the database server side to communicate with each other.

4, b/s structure and C/s structure compared to the advantages and disadvantages.

(1), maintenance and upgrade method is simple. Each client of the C/s structure must have the software installed and configured. In the B/s structure, the business logic of the software is fully implemented on the server side, all the client is just the browser, do not need to do any maintenance, software upgrade, only need to upgrade the server software to the latest version can be, customers in the client re-login system is the latest version.

(2), the user access to a larger scope. c/S is built on the basis of the local area network, b/S is based on the Internet.

b/S interface is not C/s interface friendly, b/s interface is not rich.

5, why need to learn B/s technology.

When we deploy the application system, B/s can effectively reduce our daily routine maintenance, but also allow a wider range of users to access the system.

6, develop JSP dynamic website.

(1), create a Web project. (with MyEclipse tool).

FILE->NEW->PROJECT->MYECLIPSE->J2EE Projects->web Project

Note: When creating a project, be aware of the name of the ProjectName (project name) and Conttext root (access path name) URL, and if the two are different, the URL is filled in with the access path name. The default is the same, which is the same as the one that was filled in during the visit.

(2), design the directory structure of the Web project.

SRC directory: Used to store Java source files.

Webroot Directory: The top-level directory of the Web app, also known as the document root directory. It consists of the following parts:

Meta-inf Directory: System automatically generated, storage System description information.

Static files: Include all HTML pages, CSS files, image files, and so on. Generally categorized by function in folder form.

JSP files: The use of JSP can easily generate dynamic content in the page, so that the Web application can output colorful dynamic pages.

Web-inf directory: exists under the document root directory, cannot be referenced, cannot be published externally. This directory includes the Lib and Web. XML sections.

Lib directory: includes. jar or. zip file (database driver, etc.).

The initialization configuration file for the Web App.

(3), write the code for the Web project.

Select Webroot Document root right->new->html (advanced Templates), write code

(4), deploy the Web project. (The application server used is Tomcat).

To deploy: Right-click on the project file->myeclipse Add and Remove project deployments.....-> Select the item you want to deploy, clicking the Add button-Select server for Tomcat 5- > Click the Finish button and click the OK button.

(5), run the Web project. Launch tomcat and enter URL access in the browser.

Click the Run icon, and select the Tomcat 5->start command.

Some information about the console output explains:

Info: Starting Coyote http/1.1 on http-8080

Tip The Tomcat service was started on port 8080.

Info: Server Startup in 3703 MS

Tip After 3703 milliseconds Tomcat has started, different project start times will take different time.

7. What is a URL

The URL is the abbreviation for Uniform Resource location, translated as "Uniform Resource Locator." A URL is a naming convention that uniquely identifies a specific computer, directory, or file location on the Internet.

The format of the URL consists of the following three parts.

The first part: agreement.

The second part: Host IP address (sometimes including port number).

The third part: the specific address of the host resource, such as directory and file name.

The first part and the second part are separated by "://", and the second and third parts are separated by "/" symbols. Among them, the first part and the second part are indispensable, and the third part can be omitted sometimes.

Http:localhost:8080/xinxin/index.html

Host IP address is: localhost, port number: 8080, page specific location:: xinxin/index.html

Xinxin is the externally released virtual context path that corresponds to the actual document root directory (WebRoot) of the Web application.

8, the development of Web projects often make mistakes

Symptom: The Web page cannot be displayed.

Cause: The Tomcat service was not started or the Tomcat service was not started in the expected port.

Symptom: 404 error.

Cause: 1, the Tomcat service was started, but the Web app was not deployed.

2. Or the Tomcat service has been launched, and a web app has been deployed. URL input error To see if the first two parts of the URL are entered correctly. (http://localhost:8080), and then see if the context path is correct (right-click the project Àpropertiesàmyeclipseàwebàweb context-root).

3. Or the Tomcat service has been launched, and a web app has been deployed. The URL also looks correct. Check the location of the files you want to access, check whether the files are stored in the Meta-inf or Web-inf folder, the contents of the two folders can not be published externally, cannot be referenced (not directly through the address, can only be accessed within the program). Place the file you want to access under the document root directory.

9. The steps to develop a JSP dynamic website are as follows:

Create a Web project.

Design the directory structure of the Web project.

Write the code for the Web project.

Deploy the Web project.

Run the Web project.

JSP dynamic page

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.