This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I call a servlet and set a session attributes, it then calls a jsp(menu page), next I click a menu item to call a servlet which uses the afore mentioned attributes but it acts like they don't exist, well sometimes.
We have a local intranet which contains a company page containing links to my web apps. The above happens when a remote part of our company tries to use the app accross a t1 line. However, if the same users directly type in the address to the site it works fine. [ January 18, 2008: Message edited by: Steve Dyke ]
since servlets don't 'call' JSPs. They can forward to them or issue sendRedirect command to get the browser to make a new request for the JSP.
In any case since you're talking about session scope either should work. In your subnet, are the machines always using the exact same address to locate the machine or are some using an IP, while others use a machine name via WINS or some other naming service?
If the same site is accessed by the same browser but with a different domain or IP, the requests will generate separate sessions.
In our main building we have our servers including the iSeries server which hosts the Web Apps. We also have a building where the users there connect through a TI line. Everyone can access our intranet site. From here there are fully qualified links to the web apps index.jsp page. This index.jsp has a link to a main servlet where session attributes are set. This servlet, after preforming its functions which includes the RequestDispatcher which opens a mainmenu.jsp page. This jsp has links on it used to make requests to another servlet to display data. This servlet depends on session attributes set in first servlet.
Now everyone in main building has no problems. Anyone remote has no problems if they access the Webapp from a web browser using fully qualified URL. But remote users use the intranet links can access the web app, the index.jsp works, the first servlet works(I have verified the session attributes are set with proper values), the mainmenu.jsp will display ok but links from this point will fail because servlets requested from here that use the session attributes set before see them as null.
It seems like a session starts then it starts another session.