tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benny Bräuer" <>
Subject Re: mod_jk, Tomcat, Session, Servlets & Portlets
Date Sat, 18 Aug 2007 08:13:15 GMT
Hi Rainer,

I'm using a single node. Here's some code from the servlet:

HttpSession session = request.getSession(false);

if(session.getAttribute("aValueSavedInThePortlet") != null) {...}
else {...}

I get a correct NullPointerException, because "session" is empty. So,
back to the problem: Using the real Tomcat-url to call portal
container and then calling the servlet within its portlet works fine,
"session" is not null. Using the "Apache/mod_jk"-url to do this
returns the NullPointerException because of the empty session. Kindly
note that I can't use "request.getSession(true);" in this case, I
can't allow the action  in the if statement without a valid session
was generated in the portlet container before.

So I think the problem is the session which is bound to the Tomcat-url
( and do not not to the virtual-host / alias url
( of the Apache with mod_jk.

I apologize for my English, I'm still learning.

Benny Bräuer
C3-Grid Developing @ Computing and Data Centre
Alfred-Wegener-Institute for polar and marine research
27570 Bremerhaven, Germany
"Do your work, then step back.
The only path to serenity."
  ~Lao Tzu - The Tao Te Ching

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message