This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages 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: 65225
95
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