At 15.21 07/02/2003, Jason Carreira wrote:
Please post any details you have, and a sample app that shows the
problem, if possible.
Well, I have made some progress... Without changing the Java code (a class that extends ActionSupport and implements ApplicationAware and ParameterAware) I tried a different JSP approach.

I now have testblog.jsp and testblog2.jsp: the former includes the latter as

<html><head><title></title></head><body>
<jsp:include page="testblog2.jsp">
<jsp:param name="lowerBoundDay" value="3" />
<jsp:param name="upperBoundDay" value="-1" />
</jsp:include>
</body></html>

and testblog2.jsp is:

<%@ taglib uri="WebWorkTags" prefix="webwork" %>
<webwork:action name="'content.BlogPostAction'">
</webwork:action>

With this arrangement, my BlogPostAction class can now see the parameters: the setParameters method gets called, and in the log I see:

[2003-02-07 16:38:44,457] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - Action executing..
[2003-02-07 16:38:44,457] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - doExecute - mParameters = {lowerBoundDay=[Ljava.lang.String;@50d45b, upperBoundDay=[Ljava.lang.String;@49105b}
[2003-02-07 16:38:44,467] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - v = [3]
[2003-02-07 16:38:44,467] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - v = [-1]
[2003-02-07 16:38:44,807] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - doExecute - result = []
[2003-02-07 16:38:44,807] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - Action execution done
[2003-02-07 16:38:44,807] DEBUG com.datafaber.action.content.BlogPostAction content.BlogPostAction - Action executed in 350 ms

The mParameters variable is set in the setParameters() method of BlogPostAction, of course.

So, in the end I'm happy that I got it to work, but I still feel I do not understand WebWork as much as I'd like. I thought that I could pass parameters to actions via the param tag, and obviously it appears that I was wrong. Could someone enlighten me as to why the following syntax does not work as I originally thought?

<%@ taglib uri="WebWorkTags" prefix="webwork" %>
<webwork:action name="'content.BlogPostAction'">
<webwork:param name="'lowerBoundDay'" value="3" />
<webwork:param name="'upperBoundDay'" value="-1" />
</webwork:action>

Dunno if it matters, the setup I'm currently running is WebWork 1.2.1 and Tomcat 4.1.12.

Regards

Sebastiano Pilla
E-TREE S.p.a. Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107 fax +39.0422.310888
http://www.e-tree.com http://www.webanana.com



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


Reply via email to