• 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

problem with web.xml path

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is there any api to retreive the path of web.xml
in jsp file i have written like this
<%=config.getInitParameter("sys")%>
i should get the value as 100 but it is displaying null
my web.xml
<web-app>
<servlet>
<servlet-name>ss</servlet-name>
<jsp-file>/initparams.jsp</jsp-file>
<init-param>
<param-name>sys</param-name>
<param-value>100</param-value>
</servlet>
now i have deployed as war in another directory with same code and same web.xml.now when iam accessing in the browser iam getting the value.so the problem is not with the code.in my first program it is not accessiong the web.xml i think.so i need to retreive the path of the web.xml.if there is an api to retreive the path of web.xml please reply to this
</web-app>
 
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
Are you hitting the JSP directly?
If so, you will not be able to read the init parameters set in web.xml.

Create a servlet mapping and use the url-pattern from your mapping to refer to the JSP and you should get the value that you expect.
 
trinadh reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i have modified that web.xml and added <servlet-mapping> enties also
but still it is displaying null.
i think it is not accessiong the corrext web.xml as i expected.
in websphere i have dumped jsp file in
N:\IBM\WebSphere\AppServer\profiles\puvvada\installedApps\esignNode01Cell\DefaultApplication.ear\DefaultWebApplication.war
and web.xml is in
N:\IBM\WebSphere\AppServer\profiles\puvvada\installedApps\esignNode01Cell\DefaultApplication.ear\DefaultWebApplication.war\WEB-INF
if i have deployed by copying the jsp file into that directory where should i edit my entries in web.xml. i have edited my entries in the above mentioned path web.xml.but it is displaying null
 
Ben Souther
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 have created a servlet-mapping and are using that url-pattern for accessing your JSP, then it should be working.

I'll ask to have this thread moved to the Websphere forum.
The folks over there should be able to help you out with websphere specific deployement issues.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic