The five-day training summary --Java Web

       JSP full name of the Java Server Pages, Chinese named java server pages, it simply is a simplified Servlet design, it is a Sun Microsystems promote the company, many companies participate together for establishing a dynamic web technology standards. JSP technology somewhat similar to ASP, it is a conventional web page HTML ( Standard Generalized Markup Language subset) files (.htm *, *. HTML ) Java insert block (Scriptlet) and JSP tag (Tag), thereby forming JSP files whose names (* .jsp). JSP development using Web applications are cross-platform , both run on Linux, it can also run on other operating systems.

It implements the java extension (in <%%> form) the Html syntax. JSP and Servlet, is executed on the server side. Usually returned to the client is an HTML text, so long as the client browser will be able to browse.

JSP technology using the Java programming language based on XML tags and scriptlets, to encapsulate the processing logic generating dynamic pages. Web application logic can access resources exist in the server through tags and scriptlets. JSP pages will be displayed separate logic and web design, support reusable component-based design that becomes quickly and easily develop Web-based applications. JSP (JavaServer Pages) is a dynamic page technology, its main purpose is to represent the logical Servlet separated in.

Java Servlet JSP technology base, and large-scale development needs of Web applications Java Servlet and JSP support to complete. JSP with the Java simple-to-use technology, fully object-oriented, with all the characteristics of platform independence and secure, mainly Internet-oriented.

        

        Servlet (Server Applet) is a Java Servlet short, called the small connector service programs or services, written in Java Server-side program, the main function is to interactively view and modify data, generate dynamic Web content.

It refers to a narrow Servlet interface to the Java language, broadly refers to any Servlet class implements the Servlet interface, under normal circumstances, people will understand Servlet for the latter. Servlet running on Java-enabled application servers. In principle, Servlet can respond to any type of request, but in most cases only used to extend the Servlet Web server based on HTTP protocol.

The earliest support JavaSoft Servlet standard is a Java Web Server, thereafter, began to support some other standard Java-based Web server Servlet.

 

Redirection and forwarding there is one important difference: When using forwarding, JSP container will use an internal call to the target page, a new page to continue processing the same request, and the browser will not know the process. In contrast, the redirection meaning the way is the first page tells the browser sends a new page request. Because, when you use the redirect, URL displayed in the browser will become the new page's URL, and when using forwards, the URL will remain the same. Redirect forward faster than slower, because the browser will have to issue a new request. At the same time, due to the redirection methods produce a new request, so after a redirect, the objects within the request will not be used.

 

When the Servlet with a request to forward the request, the form Jump Servlet page of the submission: get, post:

(运用RequestDispatcher接口的Forward)方法 forward()无法重定向至有frame的jsp文件,可以重定向至有frame的html文件,

同时forward()无法在后面带参数传递, 比如servlet?name=frank,这样不行,可以程序内通过response.setAttribute("name",name)来传至下一个页面.

即:  当 另一个页面(这里可以说是登录页面)跳转到Servlet 用get方式   request.getRequestDispatcher().forword(request.response);  是无法跳转的

 

 

 

发布了81 篇原创文章 · 获赞 62 · 访问量 7万+

Guess you like

Origin blog.csdn.net/qq_38021852/article/details/83659304