struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Huber <gregh3...@gmail.com>
Subject Re: HttpParametersAware
Date Wed, 12 Oct 2016 08:49:13 GMT
I think as a work around I can call setActionMessages(null); before I start
my action, which removes these messages just for this case.

On 12 October 2016 at 09:03, Greg Huber <gregh3269@gmail.com> wrote:

> I have tested this and looks OK.
>
> .....I have an action that implements HttpParametersAware so I can use the
> properties from the request eg:
>
>     public void setParameters(HttpParameters parameters) {
>         this.params = parameters.toMap();
>     }
>     private String getParameter(String key) {
>         String[] p = (String[]) this.params.get(key);
>         if (p != null && p.length > 0) {
>             return p[0];
>         }
>         return null;
>     }
>
> In my db, I have a properties file with key=site.description, value='
> My Site Description.'
>
> On my config form, I have a field with the name of site.description which
> is a key and is a string (ie not getSite().getDescription()) eg:
>
> <input id="config_site_description" type="text" value="My Site
> Description." size="35" name="site.description">
>
> When I submit the form com.opensymphony.xwork2.util.ValueStack#setValue(..)
> tries to evaluate it to the bean.property rather than the string and throws
> an exception.  In DEV mode I get messages like:
>
> Error setting expression 'site.description' with value 'My Site
> Description.'
>
> I get a whole load of these as its my main config page, one for every
> config value.
>
> I guess there is no way to suppress these messages in dev mode?
>
> Cheers
>
>
>
>

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