Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

JSP Sessions

  • 23-03-2006 7:31pm
    #1
    Registered Users, Registered Users 2 Posts: 1,991 ✭✭✭


    I seem to be losing a value thats stored in a session variable while moving to a certain page, the register page and the login page both go to the user page while on the user page the username variable from the session always returns null!

    this is the code on the top of the user page:
    <%@page import="java.util.*" session="true"%>
    <%
      String username=(String) session.getAttribute("username");
      if(username=="") username=null;
    %>
    

    this is the code in the main body of the page:
    <%= username %>
    <%= user.name(username) %>
    


Comments

  • Moderators, Politics Moderators Posts: 42,123 Mod ✭✭✭✭Seth Brundle


    change
    if(username=="") username=null;
    to
    if(username.equals"") username=null;


Advertisement