wood burning stoves 2.0*
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help in using jsp:include tag" Watch "Help in using jsp:include tag" New topic
Author

Help in using jsp:include tag

Kamal SampathKumar
Greenhorn

Joined: Aug 09, 2001
Posts: 11
Hi,
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();
System.out.println(queueJSP);
%>
<jsp:include page="<%=queueJSP%>" />
</logic:equal>
Is this a right way of using include tag ?
Please let me know the answer
Regards
Kamal
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 JavaPerformanceTuning.com team, Newsletter 039.
Kamal SampathKumar
Greenhorn

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 ???
Regards
Kamal
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4456
    
    6

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
Greenhorn

Joined: Aug 09, 2001
Posts: 11
Hi,
That worked fine after importing struts tlds.
Thanks a lot!!!
Kamal
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help in using jsp:include tag