This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass initParameter to the servlet

 
Doshi Milan
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I would like to pass some init parameters to the servlet, such that I can later retrieve it through the
ServletContext context =getServletContext();
String paraRetrieved=context.getInitParameter("SOMENAME");
:
My probelem is how to initialise/send the Parameters?
Also I am getting a strange probelem when I write:
context.setAttribute("Name",new String("Milan"));
stating that method() setAttribute(String, String) not found!
I am using JSDK2.0.
Please guide me.
Thanx,
Milan Doshi
 
Bosun Bello
Ranch Hand
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to use some kind of external mechanism such as a file or database. The specifics on doing this could vary depending on the webserver you are using.

Bosun
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check the post i just made here: http://www.javaranch.com/ubb/Forum7/HTML/000638.html
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic