• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

ip and page context

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic