Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP include tag problem, please help!

 
ziqiang wu
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a html file (myfile.html) that will be included in my jsp code by
<jsp:include page="myfile.html" flush="true"/>. Problem is:
How to detect that myfile.html is NOT existing??? or How to get a signal that myfile.html can not be found???
Thanks!
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will get an exception, not a signal (this is Java )
 
vikinsa
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!,
You can't use that tag to find out first hand whether that file exists or not. For that before including you'll have to use URLConnection from java. If it returns http 200 that means the file exists and can be linked to. Then you use that file in the tag.
Enjoy

Originally posted by ziqiang wu:
a html file (myfile.html) that will be included in my jsp code by
<jsp:include page="myfile.html" flush="true"/>. Problem is:
How to detect that myfile.html is NOT existing??? or How to get a signal that myfile.html can not be found???
Thanks!

 
ziqiang wu
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tony, there is no exception when the file can not be found. That is Exception for Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic