OK, I think it is related to my vhosts settings.
The problem is, that I'm using a vhost to forward from port 80 to my
internal webapp directory. I'm using ProxyPass and probably this causes the
problem.
My settings are:
*<Virtual Host xx.xx.xx.x:80>
Servername my.url.com
DocumentRoot "/home/me/webapps/myApp/WebContent"
ProxyRequest Off
<Proxy *>
Options FollowSymLinks Indexes
AllowOverride All
Order allow,deny
Allow from al
</Proxy>
ProxyPass / http://localhost:8080/myApp/
ProxyPassReverse / http://localhost:8080/myApp/
</VirtualHost>*
Does anyone know what I need to change, so I can use the HttpSession on the
server side through my entire application?
Thanks!
On Mon, Sep 21, 2009 at 10:24 AM, Dariusz <[email protected]> wrote:
> Hi!
>
> A simple scenario.
>
> - User logs in
> - User in database, save user object in HttpSession (works)
> - Forward to page /account and read the HttpSession (not working)
>
> Saving the user object in session works fine, but when I try to read
> it, I get a "NullPointerException". The session is not there.
>
> The weird part is here. If I run it on my local machine (http://
> localhost:8080/myApp) it's working fine and I can set and read the
> session through my entire application. If I deploy it on our server
> (Linux), I can set the session and read it with the same Impl class,
> but if I try to execute a different service (like AccountServiceImpl),
> then the session is not there anymore.
>
> My code looks like this:
> ...
> HttpServletRequest request = this.getThreadLocalRequest();
> HttpSession session = request.getSession();
> session.setAttribute( "user", userObject );
>
> User u = ( User )session.getAttribute( "user" );
> // here it is working
> System.out.println( "User name is: " +u.getName() );
>
> Now if I try to get the session in my AccountServiceImpl, I'm getting
> an exception???
>
> I'm wondering if it's a server setting issue or something with my
> code? (or maybe with my libraries)
>
> I would appreciate any help!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---