struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Huber <gregh3...@gmail.com>
Subject HttpParametersAware
Date Wed, 12 Oct 2016 08:03:16 GMT
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