aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Accessing various types of Parameters from EL 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 "Accessing various types of Parameters from EL" Watch "Accessing various types of Parameters from EL" New topic
Author

Accessing various types of Parameters from EL

Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

In EL, is there no way to access the servlet initialization parameters for the jsp?

initParam is a map of application context parameters & param is a map of request parameters but I don't see any implicit objects for the servlet init parameters defined in the DD for that jsp.

So, how could we access those in EL?


"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

It's rare to need such init parameters in a JSP that's properly focused on view generation, so such a capability was not added to the EL. If you really need them (and you're being careful not to be using the JSP for purposes for which it should not be used), you can grab the init params in the controller and pass them to the JSP as scoped variables.

Or, write a nice little custom tag that does it for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Thanks for the answer, Bear.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing various types of Parameters from EL
 
Similar Threads
JSP EL have access to HttpSession & ServletConfig ??
Why is there no EL implicit object for Servlet Init Params?
Servlet Object in JSP
Retrieving parameters from jsp
EL - application init parameters