In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the use of JSP page jump ways, the article is very detailed, has a certain reference value, interested friends must read it!
There are about three ways to jump to JSP pages:
Response.sendRedirect (); response.setHeader ("Location", "")
< jsp:forward page="" />The following rules are obtained through experiments:
JSP page jump rule one. Response.sendRedirect ()
Out.flush () is not allowed before this statement. If so, there will be an exception:
Java.lang.IllegalStateException: Can't sendRedirect () after data has committed to the client. At com.caucho.server.connection.AbstractHttpResponse.sendRedirect (AbstractHttpResponse.java:558)...
The browser address bar changes after the jump
If you want to jump to a different host, after the jump, the statement after this statement will continue to execute, as if a new thread has been opened, but it is no longer meaningful to the operation of response.
If you want to jump to the same host, the statement following this statement will not jump until the execution is completed.
JSP page jump rule 2. Response.setHeader ("Location", "")
Out.flush () is not allowed before this statement, and if so, the page will not jump.
The browser address bar changes after the jump, and the statement following this statement will not jump until the completion of the execution.
JSP page jump rule 3.
< jsp:forward page="">Out.flush () is not allowed before this statement. If so, there will be an exception:
Java.lang.IllegalStateException: forward () not allowed after buffer has committed. At com.caucho.server.webapp.RequestDispatcherImpl.forward (RequestDispatcherImpl.java:134) at com.caucho.server.webapp.RequestDispatcherImpl.forward (RequestDispatcherImpl.java:101) at com.caucho.jsp.PageContextImpl.forward (PageContextImpl.java:836)...
The browser address bar remains unchanged after the jump, but it can only jump to the current host, and the statement following this statement will not jump until the completion of the execution.
The above is all the contents of this article entitled "what are the ways to jump to JSP pages?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.