Author Login
Post Reply
user Digest 2 Jul 2008 07:34:41 -0000 Issue 8120
Topics (messages 188368 through 188388):
Re: Validating objects in Collections
188368 by: Asleson, Ryan
Struts 2 dojo and accessibility
188369 by: Struts Two
188381 by: Dave Newton
XSLTResult problem
188370 by: Eric Hamacher
188382 by: Dave Newton
188383 by: Dave Newton
188386 by: Chris Pratt
Validation and simple theme
188371 by: lei.java.gmail.com
188373 by: Lukasz Lenart
188377 by: lei.java.gmail.com
188378 by: lei.java.gmail.com
188380 by: Jim Kiley
Re: [s2] Problem with redirection
188372 by: Lukasz Lenart
188379 by: Milan Milanovic
188387 by: Lukasz Lenart
Re: Retrieve an hashtable entry within a jsp using struts tag and a bean as the key
188374 by: Paolo Niccolò Giubelli
Re: Showing messages after a redirect
188375 by: Adam Hardy
188376 by: Adam Hardy
188388 by: Dimitris Mouchritsas
Re: REST plugin URL syntax
188384 by: Mike Watson
Re: ParamPrepareParamsStack interceptor , how does this work???
188385 by: akoo
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_188368.ezm (zipped)
That's not a good solution. I don't want to pollute my domain objects
with Struts 2 annotations, plus I didn't even know that Struts 2
validation annotations could be used anywhere other than on a Struts
Action.
-----Original Message-----
From: Jim Kiley [mailto:jhkiley@(protected)]
Sent: Tuesday, July 01, 2008 11:43 AM
To: Struts Users Mailing List
Subject: Re: Validating objects in Collections
You can put the validation on Person's firstName() method.
On Tue, Jul 1, 2008 at 12:39 PM, Asleson, Ryan <asleson@(protected)>
wrote:
>
> Hello,
>
> I'm using Struts 2.0.11.
>
> I have an HTML table. Each row in the table represents a Person
object.
> Each column in the table has an input box for properties about the
> person, such as firstName, lastName, etc.
>
> My Action has a Persons property that is a List<Person>. Each input
> box in the HTML table is indexed so as to populate the correct Person,
> for
> example:
>
> <input type="text" name="persons[0].firstName" value="Fred" />
>
> When the user posts the form, Struts 2 will populate the Person
> objects appropriately. So far so good. However, I want to apply
> validations to the input. For example, firstName is required. I want
> to use annotations for these validations as that is how I've done it
elsewhere.
>
> I added this annotation to the method in the Action:
>
> @Validations(
> requiredStrings={
> @RequiredStringValidator( type=ValidatorType.SIMPLE, fieldName
> = "persons.firstName", message = "person.firstname.required" )
> }
> )
>
> Hoping that the firstName property of each Person within List<Person>
> would be checked to see if a value is provided. However, it doesn't
> seem to work; it always reports an error, even if all of the firstName
> input boxes are filled in.
>
> How can I validate the contents of objects within collections using
> annotations?
>
> Thank you!!!
>
> -Ryan
>
>
>
>
>
> This e-mail message is being sent solely for use by the intended
> recipient(s) and may contain confidential information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> phone or reply by e-mail, delete the original message and destroy all
copies. Thank you.
--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com
This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.

Attachment:
user_188369.ezm (zipped)I was wondering if the dojo version provided by struts 2 supports accessibility or not. I am aware that dojo 1.x supports accessibility by detecting if the browser is operating in high-contrast mode and then it renders the dijits according to augmented style, images and templates as necessary. I appreciate any info in this regard on dojo version provided with struts 2.0.11.1.
__________________________________________________________________
Get a sneak peak at messages with a handy reading pane with All new Yahoo! Mail: http://ca.promos.yahoo.com/newmail/overview2/

Attachment:
user_188381.ezm (zipped)You might have better luck asking on a Dojo list/forum. IIRC it's 0.4.3-ish.
Dave
--- On Tue, 7/1/08, Struts Two <strutstwo@(protected):
> From: Struts Two <strutstwo@(protected)>
> Subject: Struts 2 dojo and accessibility
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Tuesday, July 1, 2008, 2:27 PM
> I was wondering if the dojo version provided by struts 2
> supports accessibility or not. I am aware that dojo 1.x
> supports accessibility by detecting if the browser is
> operating in high-contrast mode and then it renders the
> dijits according to augmented style, images and templates
> as necessary. I appreciate any info in this regard on dojo
> version provided with struts 2.0.11.1.
>
>
>
> __________________________________________________________________
> Get a sneak peak at messages with a handy reading pane with
> All new Yahoo! Mail:
> http://ca.promos.yahoo.com/newmail/overview2/

Attachment:
user_188370.ezm (zipped)Struts 2.0.11
Hello:
It appears that XSLTResult is having trouble transforming a simple
Document:
<?xml version="1.0" ?>
<buidInfo>
<buid>999999</buid>
<buid>9999x99</buid>
</buidInfo>
My action is producing valid XML. I don't think it's the action causing
the problem. The error message printed on the screen:
XML Parsing Error: no element found
Location:
http://111.222.33.444:8989/ImageManager/download/BUDropdownAjaxAction.ac
tion?schema=XXXXX
Line Number 1, Column 1:
Here is the action execute method which creates the Document:
public String execute() throws ParserConfigurationException {
ImageManagerProperties props = new ImageManagerProperties();
props.load();
DocumentBuilderFactory dbfac =
DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
doc = docBuilder.newDocument();
Element root = doc.createElement("buidInfo");
doc.appendChild(root);
File directory = new File(props.getBaseDownloadDir() + "/" +
schema);
File[] buids = directory.listFiles();
for (File f: buids) {
if (f.isDirectory()) {
Element buid = doc.createElement("buid");
Text name = doc.createTextNode(f.getName());
buid.appendChild(name);
root.appendChild(buid);
}
}
return SUCCESS;
}
The configuration is as such:
<action name="BUDropdownAjaxAction"
class="download.BUDropdownAjaxAction">
<result type="xslt">
<param name="exposedValue">doc</param>
</result>
</action>
I assume that XSLTResult is available through the struts default
settings.
Can anybody see something obvious?
Regards,
Eric Hamacher
******************************
THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE ADDRESSEE(S), AND MAY
CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
EMAIL TO eric.hamacher@(protected) *******************************

Attachment:
user_188382.ezm (zipped)That's how the XSLT result works--see the XSLT result type page [1] for further explanation. In a nutshell *you* don't create the XML--you send an action to the XSLT.
Dave
[1] http://struts.apache.org/2.x/docs/xsl-result.html
--- On Tue, 7/1/08, Eric Hamacher <eric.hamacher@(protected):
> From: Eric Hamacher <eric.hamacher@(protected)>
> Subject: XSLTResult problem
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Tuesday, July 1, 2008, 3:30 PM
> Struts 2.0.11
>
>
>
> Hello:
>
>
>
>
>
>
>
> It appears that XSLTResult is having trouble transforming a
> simple
> Document:
>
>
>
> <?xml version="1.0" ?>
>
> <buidInfo>
>
> <buid>999999</buid>
>
> <buid>9999x99</buid>
>
> </buidInfo>
>
>
>
>
>
> My action is producing valid XML. I don't think
> it's the action causing
> the problem. The error message printed on the screen:
>
>
>
> XML Parsing Error: no element found
>
> Location:
> http://111.222.33.444:8989/ImageManager/download/BUDropdownAjaxAction.ac
> tion?schema=XXXXX
>
> Line Number 1, Column 1:
>
>
>
>
>
> Here is the action execute method which creates the
> Document:
>
>
>
> public String execute() throws
> ParserConfigurationException {
>
> ImageManagerProperties props = new
> ImageManagerProperties();
>
> props.load();
>
>
>
> DocumentBuilderFactory dbfac =
>
> DocumentBuilderFactory.newInstance();
>
> DocumentBuilder docBuilder =
> dbfac.newDocumentBuilder();
>
> doc = docBuilder.newDocument();
>
>
>
> Element root =
> doc.createElement("buidInfo");
>
> doc.appendChild(root);
>
>
>
> File directory = new
> File(props.getBaseDownloadDir() + "/" +
> schema);
>
> File[] buids = directory.listFiles();
>
> for (File f: buids) {
>
> if (f.isDirectory()) {
>
> Element buid =
> doc.createElement("buid");
>
> Text name =
> doc.createTextNode(f.getName());
>
> buid.appendChild(name);
>
> root.appendChild(buid);
>
> }
>
> }
>
>
>
> return SUCCESS;
>
> }
>
>
>
> The configuration is as such:
>
>
>
> <action name="BUDropdownAjaxAction"
> class="download.BUDropdownAjaxAction">
>
> <result type="xslt">
>
> <param
> name="exposedValue">doc</param>
>
> </result>
>
> </action>
>
>
>
> I assume that XSLTResult is available through the struts
> default
> settings.
>
>
>
> Can anybody see something obvious?
>
>
>
> Regards,
>
> Eric Hamacher
>
>
>
> ******************************
>
> THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE
> ADDRESSEE(S), AND MAY
> CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION.
> INTERCEPTION,
> COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE
> ADDRESSEE(S) IS
> PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY
> LAWS. IF YOU
> RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY
> ME BY RETURN
> EMAIL TO eric.hamacher@(protected)
> *******************************

Attachment:
user_188383.ezm (zipped)--- On Wed, 7/2/08, Dave Newton <newton.dave@(protected):
> That's how the XSLT result works--see the XSLT result [...]
I did, of course, mean "that's *not* how the XSLT result works..."
Dave

Attachment:
user_188386.ezm (zipped)You could try something like the attached Result instead.
(*Chris*)
On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <newton.dave@(protected):
> --- On Wed, 7/2/08, Dave Newton <newton.dave@(protected):
>> That's how the XSLT result works--see the XSLT result [...]
>
> I did, of course, mean "that's *not* how the XSLT result works..."
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188371.ezm (zipped)Hi there,
My validation works with "xhtml" them but doesn't work with "simple" theme.
Does struts2 validation framework NOT work with "simple" theme?
I don't like the layout by "xhtml" theme so I choose "simple" theme, but I
don't want to lose the validation framework.
Thanks.

Attachment:
user_188373.ezm (zipped)> My validation works with "xhtml" them but doesn't work with "simple" theme.
> Does struts2 validation framework NOT work with "simple" theme?
What you mean "not work"? Do you mean, you don't see error messages?
If so use <s:actionerror> tag [1] or <s:fielderror> with param list
for fields you want.
[1] http://struts.apache.org/2.0.11.2/docs/actionerror.html
[2] http://struts.apache.org/2.0.11.2/docs/fielderror.html
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_188377.ezm (zipped)Thanks. Your solutions solve my problems.
On Tue, Jul 1, 2008 at 4:25 PM, Lukasz Lenart <lukasz.lenart@(protected)>
wrote:
> > My validation works with "xhtml" them but doesn't work with "simple"
> theme.
> > Does struts2 validation framework NOT work with "simple" theme?
>
> What you mean "not work"? Do you mean, you don't see error messages?
> If so use <s:actionerror> tag [1] or <s:fielderror> with param list
> for fields you want.
>
> [1] http://struts.apache.org/2.0.11.2/docs/actionerror.html
> [2] http://struts.apache.org/2.0.11.2/docs/fielderror.html
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188378.ezm (zipped)Thanks. It solves my problems.
I notice that *<s:fielderror>...</s:fielderror>* is actually replaced
by *<ul><li>error
message</li></ul> *in the code. Is there a way to let the <s:fielderror> tag
only renders the error message instead of a list?
Thanks.
On Tue, Jul 1, 2008 at 4:25 PM, Lukasz Lenart <lukasz.lenart@(protected)>
wrote:
> > My validation works with "xhtml" them but doesn't work with "simple"
> theme.
> > Does struts2 validation framework NOT work with "simple" theme?
>
> What you mean "not work"? Do you mean, you don't see error messages?
> If so use <s:actionerror> tag [1] or <s:fielderror> with param list
> for fields you want.
>
> [1] http://struts.apache.org/2.0.11.2/docs/actionerror.html
> [2] http://struts.apache.org/2.0.11.2/docs/fielderror.html
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188380.ezm (zipped)Try using a different theme, I forget offhand whether 'simple' or
'css_xhtml' does what you want but if one of them doesn't, they are
remarkably easy to customize.
jk
On Tue, Jul 1, 2008 at 5:39 PM, lei.java@(protected)>
wrote:
> Thanks. It solves my problems.
>
> I notice that *<s:fielderror>...</s:fielderror>* is actually replaced
> by *<ul><li>error
> message</li></ul> *in the code. Is there a way to let the <s:fielderror>
> tag
> only renders the error message instead of a list?
>
> Thanks.
>
>
> On Tue, Jul 1, 2008 at 4:25 PM, Lukasz Lenart <
> lukasz.lenart@(protected)>
> wrote:
>
> > > My validation works with "xhtml" them but doesn't work with "simple"
> > theme.
> > > Does struts2 validation framework NOT work with "simple" theme?
> >
> > What you mean "not work"? Do you mean, you don't see error messages?
> > If so use <s:actionerror> tag [1] or <s:fielderror> with param list
> > for fields you want.
> >
> > [1] http://struts.apache.org/2.0.11.2/docs/actionerror.html
> > [2] http://struts.apache.org/2.0.11.2/docs/fielderror.html
> >
> >
> > Regards
> > --
> > Lukasz
> > http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
--
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Attachment:
user_188372.ezm (zipped)> <action name="change" class="MySecondAction">
> <!-- Redirect to another namespace -->
> <result type="redirect-action">
> showChanges
> /second
> </result>
> </action>
Add staticParamIntreceptor [1] or use paramsPrepareParamsStack [2] and
define result like that
<result type="redirect-action">
<params name="actionName">second</param>
<params name="namespace">/secondparam>
<params name="parse">true</param>
<params name="id">${id}</param>
</result>
[1] http://struts.apache.org/2.0.11.2/docs/static-parameters-interceptor.html
[2] http://struts.apache.org/2.0.11.2/docs/interceptors.html
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_188379.ezm (zipped)
Dear Lukasz,
does paramsPrepareParamsStack by default exist ?
--
Thx, Milan
Lukasz Lenart wrote:
>
>> <action name="change" class="MySecondAction">
>> <!-- Redirect to another namespace -->
>> <result type="redirect-action">
>> showChanges
>> /second
>> </result>
>> </action>
>
> Add staticParamIntreceptor [1] or use paramsPrepareParamsStack [2] and
> define result like that
>
> <result type="redirect-action">
> <params name="actionName">second
> <params name="namespace">/secondparam>
> <params name="parse">true
> <params name="id">${id}
> </result>
>
> [1]
> http://struts.apache.org/2.0.11.2/docs/static-parameters-interceptor.html
> [2] http://struts.apache.org/2.0.11.2/docs/interceptors.html
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188387.ezm (zipped)Hi,
> does paramsPrepareParamsStack by default exist ?
Upsss.... once again, paramsPrepareParamsStack exist and already
contain staticParams interceptor You can also use defaultStack.
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_188374.ezm (zipped)Ok, I used jstl and now it works!
Here's the code (it's changed since the first post, so don't compare it):
<logic:iterate id="category" name="pannelloForm"
property="highLevelCategories">
<div>
<h5><bean:write name="category" property="name"/> </h5>
<c:set var="subcategories"
value="${pannelloForm.highLevelCategoriesChildren[category.id]}"></c:set>
<ul>
<c:forEach var="subcategory" items="${subcategories}">
<li>${subcategory.contenuto.name}</li>
</c:forEach>
</ul>
</div>
</logic:iterate>
where:
- pannelloForm is the ActionForm bean
- highLevelCategories is an ArrayList<FProductCategory>
- highLevelCategoriesChildren is an
Hashtable<Integer,ArrayList<FProductCategory>>

Attachment:
user_188375.ezm (zipped)Dimitris Mouchritsas on 01/07/08 16:50, wrote:
> Ian Roughley wrote: Yes, for Struts 1.3.8, sorry I forgot to mention.
> Actually what I did (but it's more or less specific for the action) is to
> just forward, not redirect. But I've got another question now? Is there a way
> I can pass a parameter in the request? I need to pass an id for an Account
> when I go back to the Prepare action. But since I'm not manipulating the
> url?....
actually you can put the messages collection into the session if you're ok to
manage it yourself.
session.setAttribute(Globals.MESSAGE_KEY, messages);
and then in the next action redirected to:
ActionMessages messages = new ActionMessages((ActionMessages)
request.getAttribute(Globals.MESSAGE_KEY));
messages.add((ActionMessages)
session.getAttribute(Globals.MESSAGE_KEY));

Attachment:
user_188376.ezm (zipped)Dimitris Mouchritsas on 01/07/08 16:50, wrote:
>>
> Yes, for Struts 1.3.8, sorry I forgot to mention. Actually what I did (but
> it's more or less specific for the action) is to just forward, not redirect.
> But I've got another question now? Is there a way I can pass a parameter in
> the request? I need to pass an id for an Account when I go back to the
> Prepare action. But since I'm not manipulating the url?....
And you can pass a parameter in the request if you built a new Forward based on
the one you want and construct the URL manually. I dug this out of an old app:
forward = mapping.findForward(origForward);
forwardName = forward.getName();
redirect = forward.getRedirect();
//change URL if different URL given
forwardUrl = "/somewhere/else";
forwardUrl += "?" + customQueryString;
forward = new ActionForward(forwardName, forwardUrl,
redirect);

Attachment:
user_188388.ezm (zipped)Adam Hardy wrote:
> Dimitris Mouchritsas on 01/07/08 16:50, wrote:
>>>
>> Yes, for Struts 1.3.8, sorry I forgot to mention. Actually what I did
>> (but
>> it's more or less specific for the action) is to just forward, not
>> redirect.
>> But I've got another question now? Is there a way I can pass a
>> parameter in
>> the request? I need to pass an id for an Account when I go back to the
>> Prepare action. But since I'm not manipulating the url?....
>
> And you can pass a parameter in the request if you built a new Forward
> based on the one you want and construct the URL manually. I dug this
> out of an old app:
>
> forward = mapping.findForward(origForward);
> forwardName = forward.getName();
> redirect = forward.getRedirect();
> //change URL if different URL given
> forwardUrl = "/somewhere/else";
> forwardUrl += "?" + customQueryString;
> forward = new ActionForward(forwardName, forwardUrl,
> redirect);
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
Aaah, great; that seems to solve both of my problems :)
Thank you
Dimitris

Attachment:
user_188384.ezm (zipped)Hi Jeromy,
I've finally found time to try to resolve this but haven't had much luck.
Just to recap, I'm looking to be able to do something similar to the following:
/book -> returns a list of books
/book/123 -> returns book with id 123
/book/123/chapter/1 -> return chapter with id 1, retrieved from book
123 (this is a simplistic example, all resources have a unique ID)
I'd also like to be able to control access based on the
context/namespace used to access a resource e.g.:
/logo/abc -> read or update
/book/123/logo/abc -> read only
(would I need multiple LogoControllers for this?)
Using Namespaces as described by Jeromy below certainly seems to make
sense but as soon as I start to try the example provided I lose the
ability to GET /book/123, and I've tried with BookController having
namespace of "/" or "/book" and neither works. And so far I haven't
been able to successfully hit the ChapterController using a url like
/book/123/chapter.
Am I missing something really obvious? Is there something I need to
put in the struts.xml to configure the namespaces as well as using the
@Namespace annotation?
Jeromy, you seem to be pretty knowledgeable about this - can you think
of anything I might be doing wrong?
Thanks in advance for your help.
Mike
2008/6/18 Jeromy Evans <jeromy.evans@(protected)>:
> Don Brown wrote:
>>
>> I believe it is technically possible to do this, but not at all
>> intuitive right now. This is probably my number one improvement
>> request for the REST plugin.
>>
>> You should be able change the wildcard mapper to one that recognizes
>> named wildcards then use them in your namespace annotation like this:
>> @Namespace("/book/{bookId}")
>>
>>
>> Don
>>
>
> Yeah, I use this feature heavily to support URIs matching Mike's
> requirement.
>
> in struts.xml
> <bean type="com.opensymphony.xwork2.util.PatternMatcher"
> name="namedVariablePatternMatcher"
> class="com.opensymphony.xwork2.util.NamedVariablePatternMatcher"/>
>
> in *actions.*.ChapterContoller.java
> @Namespace("/book/{bookId}")
> public class ChapterController implements ModelDriven<Chapter> {
>
> private void setBookId(Long id) {...}
> private void setId(Long id) { ..}
> private Chapter getModel() {...}
>
> public HttpHeaders show() {
> model = bookService.lookupChapter(bookid, id);
> if (model != null) {
> return new DefaultHttpHeaders("show");
> } else {
> return new DefaultHttpHeaders("error");
> }
> }
> public HttpHeaders index() {...}
> }
>
> and
>
> in *actions.BookContoller.java
> @Namespace("/")
> public class BookController implements ModelDriven<Book> { }
>
> regards,
> Jeromy Evans
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188385.ezm (zipped)
thanks I think I figured out the problem. I had implemented the model driven
interface, but had it returning a new Product() object instead. It works
now.
The OP's approach is appropriate when using the param-prepare-params
pattern. Sometimes it's essential that the domain objects are
instantiated/loaded in a prepare method prior to setting their params.
eg. #1. if it's impossible for S2 to instantiate it (when there's no
default constructor or an unknown concrete type).
eg. #2.where a parameter is required to load the domain object prior to
setting its it's params
For the OP:
You haven't indicated whether you're using a getter (getProduct()) or
ModelDriven<Product>. It appears to me that your problem is unrelated to
the paramsPrepareParams stack and more related to your parameters name.
The first invocation of the params interceptor will set all params of
your action (productId, name, color etc). In this case, a Product does
not exist but the productId is set.
The prepare method is invoked and your Product created loaded.
The second invocation of the params interceptor will set all params of
your action again (productid, name, color). In this case a Product does
exist, but you're not setting its own parameters.
I suspect you haven't applied the ModelDriven<Product> interface. You
need to use that if you want to call your parameter "name".
Otherwise you need a getProduct() method with param names such as
"product.name" and "product.color".
regards,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
--
Sent from the Struts - User mailing list archive at Nabble.com.