• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which classes r imported automatically for JSP pages

 
Mahesh Pinnamaneni
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Manoj Gundawar
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also find that in the java source code generated for the JSP.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tomasz Luchowski
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic