Niraj Jha wrote:ServletContext is whole application based(common for all servlets inside an application), any attribute you want to be available on application level we set it into servletcontext.Although servletconfig is individual to one servlet.Take an example :
App1->four servlets
ServletContext-1
ServletConfig -4
ServletConfig contains individual servlet name ,their parameters declared inside <init-param> of web.xml.For more check ServletContext,ServletConfig
Bear Bibeault wrote:A forum is not a suitable substitute for a tutorial or the documentation. Have you read the javadoc entries for those classes? If so, what specific question do you have regarding them?
sekhar kiran wrote:
Bear Bibeault wrote:A forum is not a suitable substitute for a tutorial or the documentation. Have you read the javadoc entries for those classes? If so, what specific question do you have regarding them?
i know its forum for discussion about to related topics,i know concepts but i have regarding queries based on the concepts which i tried to clarify my doubts and develop in code
Niraj Jha wrote:If you know everything then what is your doubt?
When a dream is ending because to come true - OCPJP 6,7. OCE JPA EE6. MCTS
Cesar Loachamin wrote:Hi, as Bear Bibeault said your topic is generic and you must post a more specific question
Cesar Loachamin wrote:Hi, as Bear Bibeault said your topic is generic and you must post a more specific question, but I give you a generic answer and example, The ServletConfig is a interface that have methods to get information releted only to the servlet, as its name, and init parameters. The ServletContext is a more generic interface is as an ApplicationContext, it's generic for the whole application, with this interface you can get the global init parameters set an get attributes that are visible for the all application, and more. I give you an example.
I hope this help you
Kind regards
Cesar
Ulf Dittmer wrote:See http://docs.oracle.com/javaee/6/api/. If you look through the methods in javax.servlet.ServletConfig and javax.servlet.ServletContext it should become clear why they're useful (just ask yourself: if method X wasn't there, how would I accomplish what it does?).
I agree with Bear that working through a Servlet/JSP introduction or tutorial would probably serve you better at this point; you seem to have fundamental questions about these topics than can't be explained in a forum discussion like this.
sekhar kiran wrote: how to see java api like if we type in command javap java.lang.String means it shows full details like the way for jsp and servlets
SCJP, SCWCD.
|Asking Good Questions|
Amit Ghorpade wrote:
sekhar kiran wrote: how to see java api like if we type in command javap java.lang.String means it shows full details like the way for jsp and servlets
Add the JEE Javadoc to the IDE you are using.
Paul Clapham wrote:You can use javap on any class at all, if that's what you're asking. Just specify your classpath to include the class you wanted to disassemble. I'm not sure why you would want to do that, but then again perhaps that wasn't what you were asking. To tell the truth I couldn't really tell what your question was.
sekhar kiran wrote:it shows error ERROR:Could not find javax.http.ServletConfig
SCJP, SCWCD.
|Asking Good Questions|
i think your mentioning link which provided in previous post,i just want to know is it possible to see javaapi in command like what we seen in core java(example string,stringbuilder,collections)Paul Clapham wrote:It seems kind of pointless to spend time trying to run javap on those interfaces when the API documentation gives you the same information as javap and a lot more.
Amit Ghorpade wrote:
sekhar kiran wrote:it shows error ERROR:Could not find javax.http.ServletConfig
That is because the class was not found in the classpath.
Ulf Dittmer wrote:That has already been answered with "yes", and it has been pointed out to you why it doesn't work the way you are doing it. Please take the time to read and understand what the people who are trying to help you are writing.
sekhar kiran wrote:so whats the correct command to see the details
SCJP, SCWCD.
|Asking Good Questions|
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|