File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletConfig!!!

 
T Rai
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am wondering i can servletConfig be able to carry information stored in web.xml? could you please explain me this mechanism?
thanks.
 
Phil Chuang
Ranch Hand
Posts: 251
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the web.xml, under the servlet definition, you can define init parameters something like this: (I do not remember exactly, check first)

Or something like that.
Now, in your servlet's init method, you can use

to get "some value".
 
Brian Smith
Ranch Hand
Posts: 232
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Phil Chuang:
In the web.xml, under the servlet definition, you can define init parameters something like this: (I do not remember exactly, check first)

Or something like that.
Now, in your servlet's init method, you can use

to get "some value".

yes, inti-param can be defined in web.xml which can be accessed by servletConfig object. but what i am not getting here is how the servletConfig can be able to carry these information?
thanks.
 
Phil Chuang
Ranch Hand
Posts: 251
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, you want the data to persist in the servlet itself?
Simple, just define some instance variables in the servlet, then set them in the init method.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic