• Post Reply Bookmark Topic Watch Topic
  • New Topic

implict object of jsp: "config"

 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivani , can you please answer my query .
 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ]
 
Mohd Fuzail
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My aplologies, yeah i mixed both of them....



Will take care with next posting..

thanks for updation
 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks shivani!!

you gave the exact answer.The code give by you is working fine.
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!