Results 1 to 2 of 2
  1. #1
    Lutra is offline Member
    Join Date
    Feb 2011
    Rep Power

    Default jsp:forward problem


    I'm pretty new to JSP and JSTL. At the moment I'm trying to create a simple login system and ran into a weird problem I haven't been able to solve.

    I have a login.jsp page which has a standard html form for username and password and also a JSTL core tag that looks like this:

    <c:if test="${sessionScope.login == 'ok'} >
    <jsp:forward page="LoginServlet" />

    The idea is that if the user has already logged in succesfully, the LoginServlet creates a session which has login attribute with a value 'ok'. If the user after that comes to the login.jsp page, the page forwards the user automatically. Well, it works on some level...

    The problems start if I happen the restart the Tomcat server my application runs on. Before the restart everything is working as it should be. After the restart when I come to the login page, it tries to forward me even though there should be no session nor login attribute anywhere! The same thing happens even if I invalidate the session or assign the login attribute null values before restarting the server.

    I honestly have no idea what's going on and it would be great if someone could help me with this.

  2. #2
    akiravelmont is offline Member
    Join Date
    Mar 2011
    Rep Power

Similar Threads

  1. Forward references
    By Norm in forum Advanced Java
    Replies: 2
    Last Post: 06-30-2010, 03:19 AM
  2. jsp:forward vs jsp:redirect / XML tag if
    By lse123 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 01-25-2010, 09:23 AM
  3. [SOLVED] Problem using jsp:forward to a servlet
    By Norm in forum Java Servlet
    Replies: 6
    Last Post: 04-27-2009, 10:49 PM
  4. Replies: 5
    Last Post: 07-29-2008, 03:13 PM
  5. jsp:forward action
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-24-2007, 11:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts