• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getServletConfig() in pageContext() not working

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I was experimenting with the init-param of a jsp file. My web.xml is



and the jsp page "BasicCounter.jsp" is



I got a result


My email is null
email is null

client email is alima1965@yahoo.com


I expected that since pageContext object is available in the page I can access the init-param values using that object. The same is the case with application object too. What is the reason for this behaviour?
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to add init-params to a JSP via web.xml, you need to create a servlet mapping for your JSP and use the url defined in that mapping when making the request.

Context init params, on the other hand are bound to the Context object (which is available to all components of the app) will be available, regardless of how your JSP was invoked.
 
sasikumar palakkizhi
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mr.Ben Souther,

It is working fine. Thanks for the reply.. When I mapped in web.xml, all the implicit objects are available in the page..

Thanks once again for the immediate answer

sasikumar
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic