struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <thechrispr...@gmail.com>
Subject Re: paramsPrepareParamsStack only populates pojo, neither String nor int
Date Fri, 13 Dec 2013 18:06:20 GMT
I'm guessing that the user fields aren't actually getting set (since that's
done by the params interceptor that hasn't run yet), but you're seeing the
existing values of the object.  The passwordRepetition is showing null, but
it similarly hasn't been set by the params interceptor.

You can either call the params interceptor one more time before your
navigation interceptor or you can replicate the paramsPrepareParamsStack
into your new stack and put your navigation interceptor anywhere in that
stack you want.
  (*Chris*)


On Fri, Dec 13, 2013 at 6:53 AM, jotpe <jotpe.osm@gmail.com> wrote:

> Hello List,
>
> I build myself a custom interceptorstack. The core part has to be the
> paramsPrepareParamsStack, because i work with an or-mapper.
>
>     <interceptor-stack name="accessNavigationDialog">
>                 <interceptor-ref name="checkRoles" />
>                 <interceptor-ref name="navigation" />
>                 <interceptor-ref name="paramsPrepareParamsStack" />
>                 <interceptor-ref name="paginator" />
>    </interceptor-stack>
>
>
> In my action class, there are 2 variables:
>
>     private User user;
>     private String passwordRepetition;
>
>
> POST Parameters are for example:
>
> user.id=14
> user.password=secret
> passwordRepetition=secret
>
>
> Everthing is working fine, if the navigation interceptor is executed after
> the paramsPrepareParamsStack. But i need to execute it before, because no
> navigation content is generated in case of error detection in a validate
> method.
>
> Is the navigation interceptor executed befor the paramsPrepareParamsStack
> the user varianbles id and passwort are set proper:
> user.id=1
> user.password=secret
>
> but setPasswordRepetition is never called and passwordRepetition stays
> null!!!
>
>
> The navigation interceptor only generates some html content and saves it in
> the value stack. Is this no good idea? It's done in this way:
>
> ValueStack vs = ActionContext.getContext().getValueStack();
> vs.set("servicenav","<ul>...</ul>");
> return invocation.invoke();
>
> Can please anyone help me? This kind of error, raises a some distrust in
> me...
>
> regards Johannes
>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message