File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes use EL to access servlet init in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "use EL to access servlet init in web.xml" Watch "use EL to access servlet init in web.xml" New topic

use EL to access servlet init in web.xml

Brenda Kwok
Ranch Hand

Joined: Nov 30, 2004
Posts: 38
How to use use EL to access admin eamil


Wasim Ayoubi
Ranch Hand

Joined: Nov 21, 2004
Posts: 46
Hi Brenda

I did not find any direct way to access the Servlet Init Param from EL but you can still do it using EL functions you can do this --->

Create a class and define the following function

package whatever;
public class ELFunctions {
public static String getInitParam(PageContext pageContext, String key){
return pageContext.getServletConfig().getInitParameter(key);
define a whatever.tld file, it should look like this

<function-signature>java.lang.String getInitParam(javax.servlet.jsp.PageContext, java.lang.String)</function-signature>
in your jsp file
<%@taglib uri="" prefix="wia"%>


your dd file looks like this

try it and I think everything will be fine.

Wasim Ayoubi<br />SCJA1.0(BETA), SCJP1.4, SCWCD1.4<br />Next ???
I agree. Here's the link:
subject: use EL to access servlet init in web.xml
Similar Threads
Why is there no EL implicit object for Servlet Init Params?
EL- getting JSP Init Param
EL Expresion of request URI
A question about servlet initParameter