Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Re: Problems with the JSP forward tag.


Message #1 by "Guess What :\)" <datingu@e...> on Thu, 05 Jul 2001 21:16:51 +0800
try to use it like this 

<%
if (dataInsertGood.equals("true") && okToSubmit == "true") {
%>
<jsp:forward page='<%=/agenda/agenda.jsp%>'/>
<%


good luck


-----Original Message-----
From: dmkarr@e... (David M. Karr)
Date: 29 Jun 2001 17:46:59 -0700
To: "Pro_JavaServer_Pages" <pro_jsp@p...>
Subject: [pro_jsp] Re: Problems with the JSP forward tag.


> >>>>> "nickm" == nickm  <Nick> writes:
> 
>     nickm> Hi:
> 
>     nickm> I am trying to use the JSP forward tag and have been getting strange
>     nickm> behaviour where I  keep getting 404 errors.
> 
>     nickm> I am using a MVC (sort of) approach to web application design except instead
>     nickm> of using a servlet as the target of my forms I use a JSP page who's
>     nickm> function it is too pass the form variables to a bean and then forward the
>     nickm> user to another page if no errors are thrown.
> 
>     nickm> The conditional code that intiates a forward action:
> 
>     nickm> if (dataInsertGood.equals("true") && okToSubmit == "true") {
>     nickm> %>
>     nickm> <jsp:forward page="/agenda/agenda.jsp"/>
>     nickm> <%
> 
>     nickm> The file I want it to forward to is in a folder called 'agenda' that sits on
>     nickm> the root of the web application. One thing I noticed is that when I forward
>     nickm> to the new page (in this case agenda.jsp) the url does not display the page
>     nickm> I forwarded to, rather it displays the JSP page that I used as the
>     nickm> controller?
> 
> Don't use "==" to compare strings.  That checks if they are the SAME OBJECT,
> not whether they have the same contents.  Use ".equals()", as you did for the
> other one.
> 
> -- 
> ===================================================================
> David M. Karr          ; Best Consulting
> dmkarr@e...   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)
> 
>

  Return to Index