Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 12756
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
jQuery in Action, 2nd edition
subject: i can't understand this sentence ~~please help me,thanks
Similar Threads
How can I run this sample code?
want to pass a string to a servlet
Calling getRequestDispatcher method ??
More simple doubts....errr
Question getServletContext().getRequestDispatcher("/foo.jsp").forward(req, res); I