File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes which classes r imported automatically for JSP pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "which classes r imported automatically for JSP pages" Watch "which classes r imported automatically for JSP pages" New topic
Author

which classes r imported automatically for JSP pages

Mahesh Pinnamaneni
Ranch Hand

Joined: Jul 02, 2004
Posts: 100
hai guys,
i just want to know when we include page directive what java classes are imported by default.(just like in java prgms we know that java.lang.* is imported automatically).
thanks & regards,
Mahesh
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
I encourage you to take a look at the JSP spec for more details but there are only a few "included" classes:

request - javax.servlet.http.HttpServletRequest
response - javax.servlet.http.HttpServletResponse
out - javax.servlet.jsp.JspWriter
session - javax.servlet.http.HttpSession
application - javax.servlet.ServletContext
config - javax.servlet.ServletConfig
pageContext - javax.servlet.jsp.PageContext
[ October 07, 2004: Message edited by: Scott Dunbar ]

<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Manoj Gundawar
Ranch Hand

Joined: Nov 17, 2002
Posts: 169
You can also find that in the java source code generated for the JSP.


Manoj<br />SCJP, SCJD, SCWCD, IBM WSAD.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Looking at the Java source code generated for a JSP is one of the best JSP learning tools you can imagine. I highly recommend it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tomasz Luchowski
Greenhorn

Joined: Sep 16, 2004
Posts: 15
Originally posted by Mahesh Pinnamaneni:
hai guys,
i just want to know when we include page directive what java classes are imported by default.(just like in java prgms we know that java.lang.* is imported automatically).
thanks & regards,
Mahesh

According to Head First Servlets & JSP page 313, packages that are automatically imported for a JSP page are:
java.lang.*, javax.servlet.*, javax.servlet.http.*, javax.servlet.jsp.*

-- Tomasz
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which classes r imported automatically for JSP pages
 
Similar Threads
Enumerate imports for a class
Raising a number to the power. Help!
subclass question
pathing issue
websphere deploy