Hi Raj
Looks like the computation of the location you want to forward is done in
the scriplet part of the JSP,
and some where downstream you are using the <jsp:forward> to forward to that
site. To make the <jsp:forward> action, part of the "if" do as follows

<%
if(retVal != null)
{ %>
    <jsp:forward page="<%=retVal%>"/>;
<%
    }
%>

Since this is not a good readable code, try using the sendRedirect method of
the response object available in the JSP..

<%
if(retVal != null)
    response.sendRedirect(retVal);
%>

Both should work the same way.
Viren

----- Original Message -----
From: Raj S <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 13, 2000 8:30 PM
Subject: Forwarding problem...


> Hi,
>   I am facing a forwarding problem.
> I have to forward to another page,based on a return value from a method
> called CheckLogin()
> But when I try to do so, it does not recognize the variable returned.
> How can I ensure that <jsp:forward page="<%=retVal%>"/>;  is executed
within
> the if loop,so that it gets the required value?
>
> Any Suggestions.
>
> Part of code::
>
> String name = request.getParameter("loginname");
> String Pwd = request.getParameter("password");
> out.println("str is "+name);
> out.println("pwd is "+Pwd);
> if(name!=null&Pwd!=null)
> {
> String retVal= AuthenticateLogin.CheckLogin(name,Pwd);
> out.println("retval is "+retVal);
> }
> <jsp:forward page="<%=retVal%>"/>;
>
> Thanks,
>
> Raj
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>


____________NetZero Free Internet Access and Email_________
Download Now     http://www.netzero.net/download/index.html
Request a CDROM  1-800-333-3633
___________________________________________________________

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to