How to include a jsp file only once

Hi,

I have collected all my common jsp stuff in include.jsp that is included in all app jsp pages. Depending on business logic some jsp pages (say a.jsp) might redirect to other jsp pages (say b.jsp) - in this case the include.jsp would be included twice as part iof request and my app breaks

Does jsp have a "include once" feature - like PHP include_once or do I have to do messy stuff with request variables..

Thanks,

[444 byte] By [NielsPa] at [2007-11-27 8:26:55]
# 1
Can't you have some flags to restrict this?
skp71a at 2007-7-12 20:16:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
yes - I can write the below but thats kind of messy..if (request.getAttribute("include.jsp") != null)return;elserequest.setAttribute("include.jsp", "1");
NielsPa at 2007-7-12 20:16:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
You may use conditional includes. Pls see this topic for the same - http://forum.java.sun.com/thread.jspa?threadID=676322&tstart=0
MrReddya at 2007-7-12 20:16:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...