struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Huber (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-3939) Spurious "Unexpected Exception caught setting" message from com.opensymphony.xwork2.interceptor.ParametersInterceptor on checkboxlist tags
Date Fri, 07 Dec 2012 09:19:21 GMT

    [ https://issues.apache.org/jira/browse/WW-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13526247#comment-13526247
] 

Greg Huber commented on WW-3939:
--------------------------------

Also fills the logs up with internal warnings which I guess should be ignored somehow.

2012-12-07 09:13:21,894 WARN  com.opensymphony.xwork2.interceptor.ParametersInterceptor CommonsLogger:warn
- Parameter [__multiselect_idEmails-1] didn't match acceptedPattern pattern!
2012-12-07 09:13:21,896 WARN  com.opensymphony.xwork2.interceptor.ParametersInterceptor CommonsLogger:warn
- Parameter [action:entry!save] didn't match acceptedPattern pattern!
2012-12-07 09:15:20,701 WARN  com.opensymphony.xwork2.interceptor.ParametersInterceptor CommonsLogger:warn
- Parameter [action:entryEdit!save] didn't match acceptedPattern pattern!

Takes too long to pick through these trying to find real issues!
                
> Spurious "Unexpected Exception caught setting" message from com.opensymphony.xwork2.interceptor.ParametersInterceptor
on checkboxlist tags
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3939
>                 URL: https://issues.apache.org/jira/browse/WW-3939
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Java Templates
>    Affects Versions: 2.3.7
>         Environment: Centos/Apache/Tomcat
>            Reporter: Greg Huber
>            Priority: Trivial
>
> Hello,
> There is another spurious "Unexpected Exception caught setting" message that comes from
the use of the checkboxlist tag as it renders its hidden field with the id beginning with
"__multiselect_".
> com.opensymphony.xwork2.interceptor.ParametersInterceptor line starting 314
> {code:java}
> for (Map.Entry<String, Object> entry : acceptableParameters.entrySet()) {
>             String name = entry.getKey();
>             Object value = entry.getValue();
>             try {
>                 newStack.setParameter(name, value);
>             } catch (RuntimeException e) {
>                 if (devMode) {
>                     String developerNotification = LocalizedTextUtil.findText(ParametersInterceptor.class,
"devmode.notification", ActionContext.getContext().getLocale(), "Developer Notification:\n{0}",
new Object[]{
>                              "Unexpected Exception caught setting '" + name + "' on '"
+ action.getClass() + ": " + e.getMessage()
>                     });
>                     LOG.error(developerNotification);
>                     if (action instanceof ValidationAware) {
>                         ((ValidationAware) action).addActionMessage(developerNotification);
>                     }
>                 }
>             }
>         }
> {code}
> It may be the way I am using the checkboxlist (list of checkboxes in a table), but if
I add to the id & name attributes the "cnt" number on the checkboxlist tag to match the
id on the checkbox tag the error message goes away?
> ie add   + "-" + Integer.toString(cnt)    below:
> CheckboxListHandler (on the javatempaltes tag!)
> {code:java}
> //Hidden input section
>                 a = new Attributes();
>                 a.add("type", "hidden")
>                         .add("id", "__multiselect_" + StringUtils.defaultString(StringEscapeUtils.escapeHtml4(id))+
"-" + Integer.toString(cnt))
>                         .add("name", "__multiselect_" + StringUtils.defaultString(StringEscapeUtils.escapeHtml4(name))+
"-" + Integer.toString(cnt))
>                         .add("value", "")
>                         .addIfTrue("disabled", disabled);
>                 start("input", a);
>                 end("input");
> {code}
> output code:
> <input id="favourites_idEmails-1" type="checkbox" value="test" name="idEmails">
> <input id="__multiselect_favourites_idEmails-1" type="hidden" value="" name="__multiselect_idEmails-1">
> ####
> The freemarket template may also need the modification to the hidden field, ie add -${itemCount}
to the id/name
> <input type="hidden" id="__multiselect_${parameters.id?html}-${itemCount}" name="__multiselect_${parameters.name?html}-${itemCount}"
>        value=""<#rt/>
> Cheers Greg

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message