File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes JSP include tag problem, please help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP include tag problem, please help!" Watch "JSP include tag problem, please help!" New topic
Author

JSP include tag problem, please help!

ziqiang wu
Greenhorn

Joined: Jun 18, 2001
Posts: 25
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

Joined: Jan 30, 2000
Posts: 3222
    
    5
You will get an exception, not a signal (this is Java )


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
vikinsa
Ranch Hand

Joined: Apr 18, 2001
Posts: 46
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!


Vikas Aggarwal<BR>Technology Associate<BR>http://www.vikinsa.com
ziqiang wu
Greenhorn

Joined: Jun 18, 2001
Posts: 25
Hi Tony, there is no exception when the file can not be found. That is Exception for Java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP include tag problem, please help!