struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <Christoph.Nenn...@lex-com.net>
Subject Re: Whitespace in String-mapped properties
Date Wed, 06 Aug 2014 08:07:07 GMT
> I'm trying to implement mapped properties for buttons on a form. 
> Given the following code:
> 
> private Map<String, String> removeButtons = new HashMap<String, 
String>();
> public Map<String, String> getRemoveButtons() {
>     log.debug("Call to getRemoveButtons()");
>     return removeButtons;
> }
> 
> and the following HTML:
> 
> <input type="submit" value="Remove" name="removeButtons['<string>']"
> id="removebuttons['<string>']"/>
> 
> the getRemoveButtons function is never called if the string has 
> whitespace in it. Is this by design or a bug? Is there a workaround?
> 


A way to bypass this restriction is to use ParameterNameAware:


https://struts.apache.org/release/2.0.x/docs/parameters-interceptor.html
https://struts.apache.org/release/2.0.x/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParameterNameAware.html



regards,
Christoph


This Email was scanned by Sophos Anti Virus

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