*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 19651
    
  18

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
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: Session gets null on mapping the application
 
Similar Threads
SessionBindingListener
Session gets null when mapping the url
Doubt in JSP working with Netscape4.76?
Getting Session as null
Invoking a new Session