JSP & Session object
I have the problem that several others have had, and that is my JSP pages won't access the same HttpSession object that my servlets do.
I am using Apache server with jserv, Oracle 8.1.7 version. My JSP's even have @page session="true". (I have tried several things). Still, my session is empty even though the servlet session object has attributes.
You would think this one would be wasy. I have searched the forum for answers. I have worked on this for three days, and tried many, many things, but obviously not the correct thing. Is this a Jserv issue? Should I move to tomcat?
Anyone have a suggestions?
[647 byte] By [
jimscott] at [2007-9-26 3:27:33]

Can you post some of your code, how you obtain the session in your Servlet, what objects you're putting in it, how you access the objects from your JSP?
I've used Jserv for some time and never had the problem you're describing.
Although Jserv is an old spec. and is no longer supported, so I'd recommend on planning to move to something else.
-Derek
Servlet and JSP code snippets.
================================
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
AppMessage msg;
HttpSession session = request.getSession(true);
String myToken = (String)session.getValue("token");
if (myToken == null || !myToken.equals(token)) {
appLog.log("Invalid token.", appLog.SYSTEM);
response.sendRedirect(logonUrl);
}
session.removeValue("appMessage");
==========================
myToken has the proper value.
JSP
<%@page info="DetailTemplate" session="true"%>
<% AppConfig appConfig = new AppConfig(); %>
<% String logonUrl = appConfig.getVar("LOGON_URL"); %>
<% String token = appConfig.getVar("TOKEN"); %>
<% String myToken = (String)session.getAttribute("token"); %>
==========================
myToken is null.
Hi,To my mind It's because of Oracle...Oracle seems to have its own session manager, a collegue use Jserv with Portal (Oracle) and ave the same problem.If you find a solution please post it here
gentyt at 2007-6-29 11:50:23 >

Yes indeed! Jserv conforms to the 2.0 servlet specification, and therefore does not share the session object with JSP's. Oracle is trying to move everyone to their OCE (Oracle Servlet Engine) which conforms to the 2.2 servlet specification.
I didn't want to try to remove Jserv, and configure the OCE (I didn't readily see the documentation), to I am going to Apache and Tomcat.