This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes configuring the DD for each servlet??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "configuring the DD for each servlet???" Watch "configuring the DD for each servlet???" New topic
Author

configuring the DD for each servlet???

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Feb 27, 2002
Posts: 8904

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?


Groovy
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Aug 15, 2004
Posts: 2874
I haven't gone through this book. But I love to.
Have you tried the book index?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

DD == Deployment Descriptor
Your web.xml file.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Feb 27, 2002
Posts: 8904

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

Joined: Aug 15, 2004
Posts: 2874
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

Joined: May 24, 2004
Posts: 783
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...


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
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

Joined: Aug 15, 2004
Posts: 2874
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.
 
Don't get me started about those stupid light bulbs.
 
subject: configuring the DD for each servlet???
 
Similar Threads
Webapps thread basic questions
string and string buffer
Misc URLyBird questions not covered in the assignment instructions
init missing in servlet
What version of the deployment descriptor is tested?