tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benny Bräuer" <bbrae...@gmail.com>
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:

<code>
HttpSession session = request.getSession(false);

if(session.getAttribute("aValueSavedInThePortlet") != null) {...}
else {...}
</code>

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
(foo.bar.com:8080) and do not not to the virtual-host / alias url
(www.foobar.com) of the Apache with mod_jk.

I apologize for my English, I'm still learning.
-- 
Cheers,
Benny

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: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message