aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes implict object of jsp: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "implict object of jsp: "config"" Watch "implict object of jsp: "config"" New topic
Author

implict object of jsp: "config"

navat venu
Ranch Hand

Joined: May 14, 2006
Posts: 66
What is the main purpose of config implicit object in jsp?

As "servletConfig" facilitates to store name,value pairs(using <init-param> in web.xml for that particular servlet, is there any facility for jsp also?


I mean is there any facility to store name,value pairs in web.xml for using them in that particular jsp only?

pls clarify!!


-------------------- <br />SCJP 1.4<br />SCWCD 1.4<br />SCBCD 5(in progress)<br /> <br />"Do, what you think that you cannot do"
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
Did you noticed whom Head First Series - JSP is dedicated.....???

anyway coming to point "Config allows initialization data to be passed to a JSP page's servlet."

For more information please refer More info on implicit objects
[ August 27, 2006: Message edited by: Mohd Fuzail ]

Being defeated is often a temporary condition. Giving up is what makes it permanent.
navat venu
Ranch Hand

Joined: May 14, 2006
Posts: 66
shivani , can you please answer my query .
Shivani Chandna
Ranch Hand

Joined: Sep 18, 2004
Posts: 380

Is there any facility to store name,value pairs in web.xml for using them in that particular jsp only?


Okay Navat , did you see in web.xml that <servlet> has <jsp-file> sub-element to it?. (Normally one mentions a <servlet-class> instead of jsp file)

For example:


Now in the above case , you can see how the init-param have been given to the JSP - Also you can see that settings like load-on-startup have been used for the JSP file - so that it is translated and compiled and loaded before any request has been made for it.

-----

Fuzail , config implicit object in JSP page is reference to ServletConfig instance. Whereas the initParam implicit EL object is a Map of context initialization paramateres/values. I think you mixed the two

Ah and for humor let me quote the "dedicated to" in HFJS.


This book is dedicated to whoever decided that the EL implicit object for a context param should be named initParam


Regards,
Shivani
[ August 26, 2006: Message edited by: Shivani Chandna ]

/** Code speaks louder than words */
Mohd Fuzail
Ranch Hand

Joined: Feb 20, 2002
Posts: 107
My aplologies, yeah i mixed both of them....



Will take care with next posting..

thanks for updation
navat venu
Ranch Hand

Joined: May 14, 2006
Posts: 66
Thanks shivani!!

you gave the exact answer.The code give by you is working fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: implict object of jsp: "config"