IntelliJ Java IDE
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes what is the difference between... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "what is the difference between..." Watch "what is the difference between..." New topic
Author

what is the difference between...

Niu Xiuyuan
Ranch Hand

Joined: Jun 08, 2001
Posts: 68
<%
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!


Sun Certified Java Programmer<br />Sun Certified Web Component Developer
Stephen Tallamy
Greenhorn

Joined: Jan 08, 2002
Posts: 16
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

Joined: Jun 03, 2000
Posts: 5040
seconded.
- satya


Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
IntelliJ Java IDE
 
subject: what is the difference between...
 
Two Laptop Bag