Actually, I am using interface [ValidationWorkflowAware] instead of
annotation [InputConfig] for the purpose of repopulation when input
validation fail happen.

You can see how ValidationWorkflowAware work when you read the source
code of DefaultWorkflowInterceptor.

Basically, the idea is similar. But, [InputConfig] need you to appoint
a method name every time.
So I think it is more convenient if I use ValidationWorkflowAware.

My solution looks like:
(1)Define a class BaseAction as the base class for all my Action class
(2)In BaseAction, implement [ValidationWorkflowAware]
(3)In the method [getInputResultName], call a protected method
[loadData] which is empty(for now), and then return [INPUT] as the
result name
(4)In specific action class, override the method [loadData], and do
the real repolulation job for this page

So I can keep all the action class do the same work in the same way.
When the project and the develop team get large, I think the
consistency of code convention
is much important than just get the job done.

Hope this helps.



2010/11/6 Alfredo Manuel Osorio Martinez <alfredo.oso...@afirme.com>:
> Hello,
>
> By looking at DefaultWorkflowInterceptor I saw an annotation that I
> didn't know existed. I am talking about:
>
> com.opensymphony.xwork2.interceptor.annotations.InputConfig
>
> I think it can be used for input repopulation and can be used as an
> alternative to Preparable and <s:action/>.
>
> What surprised me was that there is a little documentation about the use
> of the annotation or examples.
>
> Haver you ever used this one before?
>
> Is it a good idea to use it for input repopulation for example
> collections for selects in case a validation fails?
>
> Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to