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

configuring the DD for each servlet???

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Please explain me this line from HFS&J book (line 4 on 157 page):

what is configuring DD for each servlet???

It should be like this, so we don't have to worry about putting init parameter in each servlet tag..... just put it into context...

Please comments.
Thanks.
[ November 10, 2005: Message edited by: rathi ji ]
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rathi,

Could you provide the context.
I havent read the book.Are they saying put some name/value pairs in the context parameter list rather than putting it under the servlet parameter list?
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and it is clear to me. I am just worried (confused) about the language they used (configuring DD per servlet...).
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't gone through this book. But I love to.
Have you tried the book index?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DD == Deployment Descriptor
Your web.xml file.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adeel Ansari:
I haven't gone through this book. But I love to.
Have you tried the book index?


Sorry, I didn't get it.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
DD == Deployment Descriptor
Your web.xml file.


Yes, and thatswhy I am confuse in 'configuring DD per servlet...'.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Every servlet to be used must find an entry in web.xml so where does the question of not configuring the DD arise?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradip Bhat:
Every servlet to be used must find an entry in web.xml so where does the question of not configuring the DD arise?


Yeah, thats the reason I didn't think Deployment Descriptor. Otherwise, its obvious.
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are talking about using context init parameters versus many servlet init parameters.
Context init parameters work just like servlet init parameters, except context parameters are available to the entire webapp, not just a single servlet. So that means any servlet or JSP in the app automatically has access to the context init parameters, so we don't have to worry about configuring the DD for every servlet, and when the value changes, you only have to change it in one place!
It pretty much means that if you have a parameter that will be used by multiple servlets, it makes more sense to put it in a context init parameter, than in several servlet init parameters. Makes sense to me...
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What they want to say is clear to me from the beginning. But as I told I didn't understand the language.



Context init parameters work just like servlet init parameters, except context parameters are available to the entire webapp, not just a single servlet. So that means any servlet or JSP in the app automatically has access to the context init parameters, so we don't have to worry about configuring the DD for every servlet, and when the value changes, you only have to change it in one place!


what I think is , the text that is in bold should be this:

so we don't have to worry about configuring the init parameter for every servlet
[ November 10, 2005: Message edited by: rathi ji ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:
so we don't have to worry about configuring the init parameter for every servlet


And init parameters are defined in Deployment Descriptor. Therefore, they wrote DD. Its just fine. But i can understand that it was difficult for you to get that. It might be confusing for some folks.

But now it is confirmed, what they meant. You took it well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic