• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on uri and RequestDispatcher

 
kavitha Partha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI friends,
I have couple of questions.. Here it goes. Thanks for your time in advance

1)With regard to uri attribute in the jsp , I was under the impression that it can be of any kind which means it can refer to the actual tld location or it some arbitrary unique string which has to have a matching string in the tld. But I found out when I took one of the mock exams, that if tld location is not specified in web.xml(taglib-location), uri in the jsp should refer to the actual location of the tld file?? Can you please confirm that ? Also can somebody please explain the uri naming/value rules?
2)With regard to RequestDispatcher.forward() and RequestDispatcher.include() method I came across in the mock exam that we cannot use these methods to do forward/include of a static content. I�m not sure why the case. Can some body please explain.?

Thanks
Kavitha
 
Amit Y Desai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check out below link...yes if uri is not specifed then it is taken as real path from context root..

link to sun website for referecnce....
 
swapna rao
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
check out below link...yes if uri is not specifed then it is taken as real path from context root..
link to sun website for referecnce....

i went through the SUN link and below info is given in that.

If the URI is a URL or URN, then the TLD is located by consulting the mapping indicated in web.xml extended using the implicit maps in the packaged tag libraries. If URI is pathname, it is interpreted relative to the root of the web application and should resolve to a TLD file directly, or to a JAR file that has a TLD file at location META-INF/taglib.tld

Kavitha,
If you didn't specify anything in web.xml it doesn't mean that uri points to the actual location of TLD file.Actually mapping in the web.xml is used only before JSP2.0.From JSP2.0 container itself searched all JAR ,TLD files within web application to find the corresponding TLD file.uri can be URL/URN/PATH info.Hope this clears this doubt.
 
kavitha Partha
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I think it does atleast for now hahaha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic