File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes i can't understand this sentence ~~please help me,thanks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "i can Watch "i can New topic

i can't understand this sentence ~~please help me,thanks

Tu Ran
Ranch Hand

Joined: Feb 09, 2002
Posts: 30
import javax.servlet.*;
import javax.servlet.http.*;
public class toServlet1 extends HttpServlet{
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws IOException,ServletException{
<font color="red">this.getServletConfig().getServletContext().
}catch(Exception e){
//i can' understand this sentence:
//please explain i ,thanks

Enjoy java,enjoy life
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Your servlet inherits the getServletConfig() method from GenericServlet. This statement gets the ServletConfig object for this instance and calls getServletContext() to get the ServletContext object - that is the context that all servlets in your application operate under.
Finally the getRequestDispatcher method of ServletContext is called to get the associated RequestDispatcher. RequestDispatcher has a forward method which is called.
Tu Ran
Ranch Hand

Joined: Feb 09, 2002
Posts: 30
William Brogden
Thanks for your answer
I agree. Here's the link:
subject: i can't understand this sentence ~~please help me,thanks
It's not a secret anymore!