• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Implict Objects for Tag files.

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The specification says that the Tag files have ServletContext (application) but the HFS says (pag 500) that Tag files don't have ServletContext though it can use jspContext instead of Servlet context. What does that mean?
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question was reposted due to error. I just hit back button & refreshed it, as a result the question was posted twice. how to Delete the duplicate post?
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Don't worry about deleting the double post)

I have just taken a look at table

Table JSP.8-5 Implicit Objects Available in Tag Files

In the document jsp-2_0-fr-spec.pdf

And it does not appear to include any mention of ServletContext (application) it does however
metnion the config implicit object which is an instance of javax.servlet.ServletConfig
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application javax.servlet.ServletContext The servlet context
obtained from the servlet
configuration object
(as in the call getServlet-
Config().
getContext() )
application scope.

I read the spec again, it does mention about applicataion/servelet context. I have pasted the snippet from the spec. Or am i reading it wrong!!

Thanks
Shashank
 
Marcus Green
arch rival
Rancher
Posts: 2813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like you are reading it correctly to me. I just checked using NetBeans and when I type

application and hit the full stop (.) it shows me all the appropriate methods associated with that object in a tag file. It seems to me to be the same as the application implicit object available in a standard jsp page.

I just looked at the errata for that book at
http://www.oreilly.com/catalog/headservletsjsp/errata/

And this is not listed as an error
[ June 14, 2006: Message edited by: Marcus Green ]
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what does that mean?
 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried the following in the tag file
<img src="images\a.jpg"><img><br/>
<em><strong><jsp oBody/></strong></em><br/>
<%= application.getServerInfo() %>

it outputs correctly. That means that Tag file too has the ServletContext as the implict object. but the book HFS page 500 (There are no dumb questions) Does the Tag file have ..... implict objects?
A: You don't have a servletContext, though, a Tag file uses a jspContext instead of a ServletContext is wrong!! am i getting it correctly?
 
Gaurav Gambhir
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Shashank , i have also cross checked it we have both jspContext as well as application, available as Implicit objects in Tag files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic