struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Brown (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (WW-1567) Poor error reporting in the select freemarker template
Date Sat, 06 Jan 2007 09:16:17 GMT

     [ https://issues.apache.org/struts/browse/WW-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Don Brown resolved WW-1567.
---------------------------

    Resolution: Fixed
      Assignee: Don Brown

Applied to both key and value.  Thanks for the patch!

> Poor error reporting in the select freemarker template
> ------------------------------------------------------
>
>                 Key: WW-1567
>                 URL: https://issues.apache.org/struts/browse/WW-1567
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Views
>    Affects Versions: 2.0.2
>            Reporter: Tom Schneider
>         Assigned To: Don Brown
>            Priority: Minor
>             Fix For: 2.0.3
>
>
> Freemarker throws a stack trace when the value for option is null.  (This is using a
LinkedHashMap as the source for the select list)  Just seeing the error, it is hard to figure
out what is causing it.  Secondly, it seems like the select template should handle this better,
like check if the value is null and render an empty select option.  (e.g. <option value="">Not
a valid selection)  This would make it easier to figure out which option is the issue and
it wouldn't throw an ugly stacktrace.
> This is the resulting freemarker error:
> --------------------
> Error on line 48, column 13 in template/simple/select.ftl
> stack.findString(parameters.listValue) is undefined.
> It cannot be assigned to itemValue
> The problematic instruction:
> ----------
> ==> assignment: itemValue=stack.findString(parameters.listValue) [on line 48, column
13 in template/simple/select.ftl]
>  in user-directive s.iterator [on line 40, column 1 in template/simple/select.ftl]
>  in include "/${parameters.templateDir}/simple/select.ftl" [on line 2, column 1 in template/xhtml/select.ftl]
> ----------
> Java backtrace for programmers:
> ----------
> freemarker.core.InvalidReferenceException: Error on line 48, column 13 in template/simple/select.ftl
> stack.findString(parameters.listValue) is undefined.
> It cannot be assigned to itemValue
> 	at freemarker.core.Assignment.accept(Assignment.java:111)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.IfBlock.accept(IfBlock.java:82)
> 	...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message