This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes context parameters from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "context parameters from jsp" Watch "context parameters from jsp" New topic
Author

context parameters from jsp

Dennis Cannell
Greenhorn

Joined: Sep 04, 2001
Posts: 3

Hi,
How does one retrieve context parameters from web.xml via jsp pages. There are many examples of retrieving init-parameters (i.e. via ServerConfig object) but none for context-parameters (i.e. via ServerContext object).
I've tried
parameter = getSerlvetContext.getInitParamters("whatever");
The init method of a jsp servlet is not allowed to be overridden so you can't recreate a servlet approach to the problem.
The JSP specs. mention an implicit object called "application" which is supposedly the ServletContext of a JSP page but when I try
String parameter = application.getInitParameter("whatever");
I get
"Undefined variable or class name: application"
perhaps I'm doing this wrong.
Does any one have any idea?
Thanks for any help
Dennis Cannell
Greenhorn

Joined: Sep 04, 2001
Posts: 3

BTW, I've also tried:
ServletContext context = config.getServletContext();
String value = (String)context.getInitParameter("whatever");
I get
"Undefined variable or class name: config"
According to the documentation these objects are supposed to exist already like "out" and "request" hence the name "implicit"?
Can anyone throw any light on what I'm missing here?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: context parameters from jsp
 
Similar Threads
EL retrieving init param in servlet element
Naming of servletContext Initialization parameter
Attributes X Parameters
configuring the DD for each servlet???
how to get InitParameter from JSP