CMS Content Management System development-Java Web development and publishing instance (1) __java

Source: Internet
Author: User
Tags java web tomcat server apache tomcat

Day Fourth: About CMS Content management System-java Web development and publishing examples (1)

article content:

1 , about C/S Structure and b/S Brief Introduction to the structure

2 , about Tomcat and Web the directory structure of the application

3 , in My Eclipse 2015CI operation and Publishing on Web the introduction

1, b/s structure and C/s structure:

c/S structure: Client server, LAN (school room), Android program. "Disadvantage: Change the code, all users have to update." 】

b/S structure : The browser does not install, the user does not install, does not affect the user. Use only one program on the maintenance server.

good prospects, the trend is B/s

In the B/s structure, the browser-side and server-side adopt the request/Response mode and interact with each other. (The moment of request and response needs to connect to the server, the link is broken, do not have to connect) requires the user to initiate the request.

Use URLs to implement page access (URL, Uniform Resource Locator)

Composition

1. Agreement

2, host IP address (sometimes including port number)

3, the address of the project resources, such as directories and folders.

http://ocalhost8080/news/index.html

Protocol host Address Project resource address

2, Tomcat and Web application directory structure

directory structure for Tomcat server: (Lightweight server)

/bin: Startup shutdown script files are in this directory

/CONF: Store A variety of configuration files, the most important of which is server.xml

/lib: Jar files accessible to all Web applications

/work:tomcat put the JSP-generated servlet in this directory

/webapps: When publishing a Web application, by default, a good Web program is published to this directory.

directory structure for Web applications:

/:web the root directory where all files in the directory are accessible to the client. including JSP, HTML and other access resources

/web-inf: Storing various resources the directory and its subdirectories are not accessible to clients

/web-inf/classes: Store all class files after the WEB project has been compiled (.java->.class->)

/web-inf/lib: Put jar file (third party package)

3. Introduction to operating and publishing the Web on my Eclipse 2015 CI

Start the new Web project after you have installed my Eclipse 2015 CI (that is, the Java Enterprise version, EE).


A new project page needs special attention:

After you enter the project name, do not finish directly. Select Next, and the next page shows the file's compiled file path. Continue next, create the Web.xml page must be checked.


When you are done, you can see the structure of the project, Webroot is the root of the Web site:

Index.jsp inside HTML <body> The default display text is: This is the My JSP page.

There are no more explanations for the code here, so this page is now published to Tomcat. Publish project files to the server: Click on the Manage deployments in the menu bar (different machine locations will be different, usually next to Tomcat) select the files to publish in the appropriate Tomcat server

First select Add, then find the item to publish, OK.


Then find servers at the bottom of the page. Right-click the boot Tomcat in servers (Tomcat is turned on when the status is turned off, if it has been opened before and is now modified, reboot)


After you start Tomcat, locate the file you want to publish, and right-click the selected file to open in your Web browser.

The effect after opening is shown in figure:


When the publication is complete, there are published files in the WebApps file in the Tomcat installation file.

Note: If you do not install Apache Tomcat separately, you can also run successfully, and the file opens Me_tcat7 file in work under the. Work in the. metadata file under MyEclipse 2015 CI workspaces. Until you see two files: Index_jsp.class and Index_jsp.java files. These two files are index.jsp compiled intermediate files.



A simple Web page that contains only textual information is published successfully.




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.