David Farrell wrote the following on 10/10/2004 7:52 AM:

When that page loads, I want to load the html:form that is appropriate for this type of module (each module will have a corresponding form and actions to recieve the form's input).

This is handled automagically for you by the strtus-config action mappings. When you want to go to XYZ.jsp to perform a certain behavior (say "edit employee") you would associate your form with that action in your struts config so it's already there for you. (no need for you to worry about making sure it's there).



My first attempt was:

<%@ include file="includes/<bean:write name="module" property="includeFile"/>" %>

But of course that doesn't work.

Then I changed the 'includeFile' property of module to actually be the whole include tag.

so I did:

<bean:write name="module" property="includeFile"/>

What kind of stuff does this "includeFile" have in it? I'm pretty sure there is a much easier way to skin a cat than the approach you are taking (although I'm not clear what you are trying to accomplish:)


<snip>
Because it is not precompiled but instead compiled at run time, it should (if syntax allows it) be able to include a different file each time.

That is correct.


So... .

I think I can somehow use the <jsp:include tag and instead of just having a hardcoded string that specifies the file, I oughta be able to say " the string you want comes from bean 'module' and its' property called 'includeFile" but I can't figure out how to do this.

Well if you have a bean "module" put into correct scope (request if right before you do the forward to the page or session), I'd use the c:import tag since it appends the context for you...


<c:import url='/someDir/${module.includeFile}'/>

(assumed bean module is in scope and it has a getter getIncludeFile() )

I'm still thinking you are making this harder on yourself than it needs to be, though.



--
Rick

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



Reply via email to