File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60049
    
  65

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: 1506
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
 
Consider Paul's rocket mass heater.
 
subject: how to retrieve init parameters in servlets from JSP
 
Similar Threads
init parameters for jsp
question on implicit objects in EL?
Accessing elements of Web.xml in .Java file
getter and setters
web application - property file