This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Help in using jsp:include tag 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 » Frameworks » Struts
Bookmark "Help in using jsp:include tag" Watch "Help in using jsp:include tag" New topic

Help in using jsp:include tag

Kamal SampathKumar

Joined: Aug 09, 2001
Posts: 11
I have a jsp page which uses struts framework. The problem is i get a file name from database based on some conditions and trying to include that page.
i am using jsp:include tag and its getting included in the page as html all the tags are not executed.
Here is my code
<logic:equal name="tableHandlerForm" property="tableDetails.queueForDevices" value="true">
com.airmantech.common.TableDetails tableDetails = (com.airmantech.common.TableDetails) session.getAttribute("tableDetails");
String queueJSP = tableDetails.getQueueType().getQueueTypeJSPtoInclude();
<jsp:include page="<%=queueJSP%>" />
Is this a right way of using include tag ?
Please let me know the answer
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
Nothing wrong with it, although I might suggest making a custom tag for it... =)

"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The team, Newsletter 039.
Kamal SampathKumar

Joined: Aug 09, 2001
Posts: 11
Thanks for your reply.
But the problem is the page which gets included uses stuts tags and these tags are not at all executed.
I am using Jboss as my application server.
Any suggestions ???
Junilu Lacar

Joined: Feb 26, 2001
Posts: 4442

First thing I'd check: make sure that the struts tlds are declared in the included JSP.

Junilu - [How to Ask Questions] [How to Answer Questions]
Kamal SampathKumar

Joined: Aug 09, 2001
Posts: 11
That worked fine after importing struts tlds.
Thanks a lot!!!
Consider Paul's rocket mass heater.
subject: Help in using jsp:include tag
Similar Threads
Including a File
No equal tag error even when equal tag present in struts-logic.tld
Difference between @include and RequestDispatcher.include()
How to replace a if(boolean) script with struts tag?
Including Servlets to JSP page