The Artima Developer Community
Sponsored Link

Java Answers Forum
JSP question - jsp:forward vs. "refresh"

2 replies on 1 page. Most recent reply: Jul 1, 2004 7:39 AM by Lynn Hollerman

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Lynn Hollerman

Posts: 67
Nickname: gmholler
Registered: Mar, 2002

JSP question - jsp:forward vs. "refresh" Posted: Jun 30, 2004 11:16 AM
Reply to this message Reply
Advertisement
I am currently trying to understand some JSPs on the system here, and after running thru several JSP tutorials on-line and reading some books on JSPs, I found something in the code I can't find the answer to. Since JSPs often involve HTML, in several places there's code along the lines of:


<meta http-equiv="Refresh" content="0; URL=xxxxxxx.jsp">


but wouldn't a <jsp:forward page="/xxxxxxx.jsp" /> work? Is there a compelling reason for using one over the other - as in, does one create problems or anything like that?

Thanks!

Lynn.


Jeroen Wenting

Posts: 88
Nickname: jwenting
Registered: Mar, 2004

Re: JSP question - jsp:forward vs. "refresh" Posted: Jul 1, 2004 12:08 AM
Reply to this message Reply

<META REFRESH ...> is executed on the client after the specified interval.

<jsp:forward .../> is executed on the server, the client never sees the page being forwarded from.

<jsp:forward .../> is mainly of interest for controllers and to forward to for example a custom error page

Lynn Hollerman

Posts: 67
Nickname: gmholler
Registered: Mar, 2002

Re: JSP question - jsp:forward vs. "refresh" Posted: Jul 1, 2004 7:39 AM
Reply to this message Reply
Thanks for the reply!

Is one method preferred over the other?

Thanks again!

Lynn.

Flat View: This topic has 2 replies on 1 page
Topic: Table still does not get updated Previous Topic   Next Topic Topic: Random Number generator question.

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use