tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mazur <ma...@raincode.net>
Subject <jsp:forward> question
Date Sun, 13 May 2001 17:18:39 GMT
Is it true that you can not use out.print to send out an entire
<jsp:forward> tag and have it work?

For example, if I do this, it returns as an html page without the
forwarding action (ie. doesn't work):
--------------------------------------
<html>
<head><title></title></head>
<body>
<%
   out.println("<jsp:forward page=\"someother.jsp\"/></jsp:forward>");
%>

</body>
</html>
-----------------------------------------
But if I do this, it works and forwards to someother.jsp:
<html>
<head><title></title></head>
<body>
<%
   String redirection = "someother.jsp";
%>

<jsp:forward page='<%= redirection %>' />

</body>
</html>

------------------------------------
In each case above, the code is saved in a jsp file....so we're going
from one jsp to another.

I mean, the second option above will work fine, but I just don't
understand why the first option will not forward to the someother.jsp
page?

Anyone have some insight?

Rob

Mime
View raw message