wood burning stoves 2.0*
The moose likes JSP and the fly likes How to check whether a JSP is present or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to check whether a JSP is present or not?" Watch "How to check whether a JSP is present or not?" New topic
Author

How to check whether a JSP is present or not?

Kannan Somaiah
Ranch Hand

Joined: Jun 06, 2006
Posts: 33
Hi,

I am working in a struts application. I am working on a screen(jsp) which has several sections. Each sections correspond to a jsp and I am using <c:import> to import jsp to load the individual sections inside the JSP.

for example...

I use the code below for each section

<c:import url="${param.urlLink}/bigPicture/xxx.jsp />

In the above code I want to check whether xxx.jsp is present or not.

If present I will display the jsp.. else I will display a message.

Please let me know how I can solve this.

Hope I made it clear.. if not please let me know

Thanks in advance.

Regards,
Somaiah
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

Use the var attribute of <c:import> to load the JSP into a scoped variable. If the JSP does not exist, the scoped variable will test positive for empty.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kannan Somaiah
Ranch Hand

Joined: Jun 06, 2006
Posts: 33
Thanks Bear Bibeault. Thanks for taking time and replying to my post.

Regards,
Somaiah
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to check whether a JSP is present or not?
 
Similar Threads
java.io.IOException: Server returned HTTP response code: 505 for URL
download a csv file from jsp
Including files in a jsp from different machine
help on c:import tag problem
Assign response text from AJAX to a JSP tag attribute