wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes How to get  Servlet Init parameters in EL. 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "How to get  Servlet Init parameters in EL." Watch "How to get  Servlet Init parameters in EL." New topic
Author

How to get Servlet Init parameters in EL.

Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
Hi

We have implicit object initParam in EL to get Context parameters.

Here my doubt is how to get servlet init parameters in EL ?

Please help me ..

Thanks
Praveen
Preparing for SCWCD.
Rufus Addis
Ranch Hand

Joined: Aug 21, 2008
Posts: 83
Does the following help:

http://faq.javaranch.com/java/InitParamsThruExpressionLanguage

Rufus.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41127
    
  45
Note that servlet init parameters are something different than context parameters.
[ October 14, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
nisha chidella
Ranch Hand

Joined: Jul 24, 2008
Posts: 57
so, does it mean that if the request directly comes to a jsp(not through a servlet) we cannot get servlet init parameter using EL ?


SCJP 5.0(100%)
Preparing for SCWCD
Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
Can't we get servlet config parameter from JSP file, using a config implicit object??

somthing like:-

config.getInitParameter OR config.getIntiParameterNames, and then we can store the return value as an attribute in any of the four specified scope.
EL then access that attribute to get the required parameter.

I am not sure, just assumed it, that it may happen.


Thanks


Thanks <br />Poonam Agarwal SCWCD 86%
ankit kumar
Ranch Hand

Joined: Apr 28, 2008
Posts: 108
ya I think poonam you are right . I did so and got the value


Cleared SCJP 1.5 | Cleared SCWCD 5.0
SCDJWS 6 in progress.....
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Nisha the original question is 4 months old. This is like WakingTheZombies. If you have any question, than it is better that you start a new topic for it ...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
nisha chidella
Ranch Hand

Joined: Jul 24, 2008
Posts: 57


Can't we get servlet config parameter from JSP file, using a config implicit object??



then you have to use scripting, the whole point of EL is to avoid scripting. isn't it ?



Nisha the original question is 4 months old. This is like WakingTheZombies.



Ankit, i wasn't trying to answer the question here which was asked few months back.i had similar question, and when i did a search this thread popped up and the answer wasn't clear to me so i continued in this same thread. Anyway, thanks, i didn't knew this rule. .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get Servlet Init parameters in EL.
 
Similar Threads
Why is there no EL implicit object for Servlet Init Params?
Is there any way to get Servlet Init Parameter using EL?
JSP EL have access to HttpSession & ServletConfig ??
A question about servlet initParameter
question on implicit objects in EL?