Dynamic web technology --JSP

Dynamic web technology

How to run tomcat 1 Development Tools

  1 deploy, run

  A click deployments

 

  B will move the project workspace server

 

 

  2 direct method of operation

A selected item directly run

 

B Select the server you want to run

 

 

2 myeclipse how to compile the project

 

 

How to remove 3 tomcat project complete

A find the item you want to delete in the webapps tomcat, delete the

 

 

B find the corresponding name in the project work / Catalina / localhost, delete

 

 

C delete the corresponding item in the service of myeclipse

 

 

4 JSP page description

JSP is usually composed of three parts, java html JSTL composition

 

5 web.xml Description

Configure the default home page welcome-file-list tag in web.xml

 

 

6 path name on the project visit

Access path name is not the name of the project, but the configuration of the root name of the web

 

 

7 JSP implementation process

 

 

  Java: .java file compiled to generate .class, and then to the jvm interpreter to run (compile and run).

  JSP: .jsp become translated .java files, compiled .java files generated .class, and then to the jvm interpreter to run (translate, compile and run).

8 jsp page composition

 

 

JSP + is mainly composed by the HTML tag portion java portion composed +

Instruction: language used to declare JSP, coding format, etc., may also be used to introduce packets

 

Expression: to output information page

<% =% Output variable>

Small script: write java script to the page

<% Java code%>

Note: The service end of the visible, invisible to the client browser

<% - the content of the comment -%>

Disclaimer: write a method to jsp page

<%! Declare a method%>

 

9 common server problems

1 server does not start properly or has been closed

 

 

2404 problem: access path error or not this page

 

 

 

 

 

 

 

10 JSP built-in objects

REQUEST request, the server requests the client browser and passed to the server corresponding values

response in response, the server response to the browser request

session session saves all pages to share information

application saves all visitors to share information

Object page of the current page

PageContext current page context object

out output content to a page on 

exception exception object page

config page configuration object

 

 

11 request objects

 

 

 

A common method

 

 

 

Difference method get and post in the form of Form

get in the address bar, to get the value of the length of the transmission mode is limited. Usually security, fast transmission speed.

post is not displayed in the address bar, post transfer is no limit value of the length (file uploading method can only be used post), better security, transmission efficiency in general.

 

 

12 response objects

The server responds to the client

Common methods:

response.sendRedirect ( "redirect address")

Similar jumps, the address bar will change to the redirection address.

 

 

13 Jump mode

 

1 redirection methods: column address change, the value of which do not transmit request field

response.sendRedirect(“url”)

2 forwarding mode: the address bar does not change, or stay the page before forwarding.

Forwarding mode request threshold is passed.

 

How to Set request field value?

Set; by request.setAttribute ( "key", Object)

How to get the value of the request?

To get through request.getAttribute ( "key")

 

Guess you like

Origin www.cnblogs.com/Xjx-zhenCai/p/11360470.html