In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.