• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ip and page context

 
Neeraj Macker
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a JSP. i set an object in the page context as :

String lang = "en";
pageContext.setAttribute("lang", lang, PageContext.SESSION_SCOPE);

and later access this object. the problem is that when i access this JSP using the ip address of the server, the object is not stored in the page context. the access code throws null pointer exception. But when i access the code using the server name (localhost etc), everything works fine.

can some one please explain.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not storing anything in the page context. According to your code, you are storing it in the session. And different domains will each get their own session.
[ September 05, 2005: Message edited by: Bear Bibeault ]
 
Neeraj Macker
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
You're not storing anything in the page context. According to your code, you are storing it in the session. And different domains will each get their own session.

[ September 05, 2005: Message edited by: Bear Bibeault ]


i cud not understand. can u please explain in detail and give me the remedy.
 
Neeraj Macker
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
You're not storing anything in the page context. According to your code, you are storing it in the session. And different domains will each get their own session.

[ September 05, 2005: Message edited by: Bear Bibeault ]


also, i am accessing the code with the same domain and not diffrent domains...i.e. http://200.200.145.123/myApp and through the diffrent pages the object is not available
 
Neeraj Macker
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i found the problem. at one place in my code i have hard coded the server name in the URL. ip and url dont work together.i.e when the first request is made by ip and the object is set in the page context, later in the session the object has to be accessed from withn the pages called with the ip and not server name. vice versa.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic