File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes tomcat properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "tomcat properties" Watch "tomcat properties" New topic

tomcat properties

SoonAnn Lim
Ranch Hand

Joined: Jun 21, 2001
Posts: 155
Can somebody show me where i can put a string property in tomcat webserver so i don't have to retype the url over and over in every jsp or servlet. I would like this property accessible to all .jsp and servlet through a simple string variable like 'url'. Thanks a lot.
Sam Dalton
Ranch Hand

Joined: Jul 26, 2001
Posts: 170
You can use the <context-param> tag in the web deployment descriptor (web.xml)
This will now be avaliable through the use of ServletContext.getInitParameter(paramName)...
Hope this helps

<a href="" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of []Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>
I agree. Here's the link:
subject: tomcat properties
It's not a secret anymore!