Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading the web.xml file from a JSP...

 
Gabriel Fox
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys, how do i read an init parameter in a web.xml from a JSP page . All ideas are welcome.
I know to do it from a servlet :
getServletContext().getInitParameter("paramName");
All idea are welcomed....
 
arul murug
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the same way as
getServletContext().getInitParameter("paramName") after all JSPs are converted to servlets.
or more aptly you can use
application.getInitParameter( "parameterName" );
 
Gabriel Fox
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, i was just trying to over complicate the solution.
 
Srini Gogineni
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gabriel Fox:
Hello guys, how do i read an init parameter in a web.xml from a JSP page . All ideas are welcome.
I know to do it from a servlet :
getServletContext().getInitParameter("paramName");
All idea are welcomed....

hi,
define the init param in web.xml(in approot/WEB-INF) as
<context-param>
<param-name>CompanyName</param-name>
<param-value>Temasek Poly</param-value>
</context-param>
access using String value = getServletContext().getInitParameter("CompanyName");
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic