Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check whether a JSP is present or not?

 
Kannan Somaiah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65226
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kannan Somaiah
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear Bibeault. Thanks for taking time and replying to my post.

Regards,
Somaiah
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic