It's not a secret anymore!*
The moose likes Servlets and the fly likes how to retrieve init parameters in servlets from 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 » Java » Servlets
Bookmark "how to retrieve init parameters in servlets from JSP" Watch "how to retrieve init parameters in servlets from JSP" New topic
Author

how to retrieve init parameters in servlets from JSP

bhavesh bhatnagar
Greenhorn

Joined: Jun 15, 2009
Posts: 26
i have a doubt about

1) How would servlets retrieve init parameters from JSP's?
2) And How would i configure the servlets init parameters?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

Servlet init parameters are meant for the servlet for which they are configured. The servlet can easily read them and pass them to a JSP as a scoped variable if appropriate.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Regarding how to configure servlet init parameters: See below. You can google for it for more info




Then use a reference to servletConfig to access the parameters As in ServletConfigReference.getInitParameter("param_name")

[AG Edit: Added code tags]


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to retrieve init parameters in servlets from JSP