--- crappycrumpet <[EMAIL PROTECTED]> wrote:
> Now I have a method in NoteAction called setNote(Note value) which sets the
> note field to the value. I also have getModel which returns a new note
> object if it's null. I however keep encountering the following error:
> ERROR [com.opensymphony.xwork2.interceptor.ParametersInterceptor] -
> ParametersInterceptor - [setParameters]: Unexpected Exception caught
> setting
> 'note' on 'class <blah.blah>.NoteAction: Error setting expression 'note'
> with value '[<BlahObject... blag... >]'
> 
> Below is my interator loop bits:
> 
> <s:iterator value="notes" status="recordStat">
>   <s:action name="iml_row" namespace="/emergency_iml"
> executeResult="true" ignoreContextParams="true">
>                     <s:param name="note" value="[0]"/>
> [...]

The <s:iterator...> tag pushes the current object of iteration onto the
stack.

One way to implement this functionality is to simply <s:include.../> the
desired page; your "note" object will be on the top of the stack, and can be
accessed appropriately.

As you suspected, you can't pass an actual object as a parameter to an
action; <s:action...> is basically making a request for that page, so you're
forced to follow the same conventions as if you were, say, submitting a form:
strings only. If you were dead-set on implementing your "note" component this
way you'd have to do something like pass a note ID and create it via J.
Random Mechanism in the sub-action (like type conversion, via the Preparable
interface, etc.)

You could also use Tiles here, similar to <s:include...>, but perhaps a bit
less hokey than just including a JSP. I dunno; I've done both, and for simple
models I don't really have much of an issue just including a JSP, but others
will probably laugh and point at me for that :)

Dave


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

Reply via email to