<%@taglib uri='/WEB-INF/tlds/struts-bean.tld' prefix='bean' %>
<%@taglib uri='/WEB-INF/tlds/struts-logic.tld' prefix='logic' %>

<logic:present name='source'>
        <bean:define name='mysourcebean' id='source' scope='session'
toScope='page' type='SourceBean' />
        <bean:include id='content' page='<%= mysourcebean.getSource() %>' />
        <%= content %>
</logic:present>
<logic:notPresent name='source'>
        <%@include file="/welcome.jsp" %>
</logic:notPresent>

The logic:present parameters might not be right - its first up in the
morning :) You get the drift though.

To do it the way you were doing it, you could also have used <jsp:include
flush='true' page='<%= mysourcebean.getSource() %>' /> but I like the struts
way better :)

Cheers,
Brett

-----Original Message-----
From: Mohammed [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 29 November 2001 10:49 PM
To: Struts Users Mailing List
Subject: <%@ include File =" <%= includefile%> " %> is there a way doto
this 


Hello evreybody,

in an action class SourceAction I am setting a variable in the session

SourceBean sourcebean = new SourceBean();
sourcebean.setSource(  myform.getcommand());
session.setAttribute("source", sourcebean);

in the jsp file I want to do the following

<%
SourceBean mysourcebean = (SourceBean)session.getAttribute("source");

if(mysourcebean!=null) {
String includefile= mysourcebean.getSource();
%>

<%@ include File ="  <%= includefile%>  %>    // this is not working ----->
ERROR:   file <%= includefile%> not found

<%}

else {%>
<%@ include File ="  welcome.jsp>  %>

<%}%>


Thanks for any help


Mohammed









--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to