• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat properties

 
SoonAnn Lim
Ranch Hand
Posts: 155
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Author
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the <context-param> tag in the web deployment descriptor (web.xml)
i.e.
<context-param>
<param-name>url</param-name>
<param-value>http://www.mysite.com</param-value>
</context-param>
This will now be avaliable through the use of ServletContext.getInitParameter(paramName)...
Hope this helps
Sam
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic