aspose file tools
The moose likes Servlets and the fly likes context parameters from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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?
 
 
subject: context parameters from jsp
 
Similar Threads
Naming of servletContext Initialization parameter
configuring the DD for each servlet???
Attributes X Parameters
EL retrieving init param in servlet element
how to get InitParameter from JSP