This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Session gets null on mapping the application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Session gets null on mapping the application " Watch "Session gets null on mapping the application " New topic
Author

Session gets null on mapping the application

Manpreet Patil
Greenhorn

Joined: Oct 18, 2009
Posts: 18
Hello guys,

I am using struts 2 and saving some information in the session. When i try to access the application using the folllowing url
http://www.example.net:8080/MyApp
it works fine.

But i have mapped the application at http://www.example.net. When i am using the application using this url the session gets null.

Could anyone tells me where am i mistaking.

thanks in advance.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Can you explain what you mean by "the session gets null"?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Manpreet Patil
Greenhorn

Joined: Oct 18, 2009
Posts: 18
I mean to say that values in the session that i put get invalidated.
I am saving some values in the session but when i try to retrieve those values those it throws null pointer exceptions

i have done apache to tomcat mapping using mode proxy for mapping the url "www.example.com:8080/myapp" into www.example.com. but after mapping i got the session null exception in my application in some place. but it's work fine in my old URL "www.example.com:8080/myapp"
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19968
    
  25

Are cookies enabled? If not and you do not use URL rewriting to include the session ID in the URL, the server doesn't know there already is a session and creates a new one.

Anyway, I'm moving this to Servlets.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session gets null on mapping the application