• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the difference between...

 
Niu Xiuyuan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%
ServletContext sc = getServletContext();
(1)RequestDispatcher rd = application.getRequestDispatcher( "/err.jsp" );
(2)RequestDispatcher rd = sc.getRequestDispatcher( "/err.jsp" );
%>
what is the diference between (1) and (2) in a jsp file!
 
Stephen Tallamy
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know there is no difference between the two statements.
application is the implicit object for the ServletContext of the JSP page. Hence your object sc is the same as the implicit object application.
[ January 09, 2002: Message edited by: Stephen Tallamy ]
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seconded.
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic