Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to retrieve init parameters in servlets from JSP

 
bhavesh bhatnagar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic