cancel
Showing results for 
Search instead for 
Did you mean: 

forEach Loop inside form

jcosano
Champ in-the-making
Champ in-the-making
I have this loop inside a form:

    
<select name="assignedUser">
   <c:forEach items="${subunitUsers}" var="aUser">
       <option value="${aUser}">${aUser}</option>
    </c:forEach>
</select>
<input type="hidden" name="assignedUser_type" value="String" />

And I have an error that property aUser doesn't exists. (It's true I only have subunitUsers that is an arrayList of Strings)

I simplify this code using this:


<c:forEach var="i" begin="1" end="10" step="1">
     <c:out value="${i}" />
    <br />
</c:forEach>

And Exception is the same:
Exception from executeScript - redirecting to status template error: 08290001 Wrapped Exception (with status template): problem evaluating script: javax.el.PropertyNotFoundException: Cannot find property i
org.springframework.extensions.webscripts.WebScriptException: 08290001 Wrapped Exception (with status template): problem evaluating script: javax.el.PropertyNotFoundException: Cannot find property i
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:731)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:167)
   at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:307)
   at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:178)
   at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:619)
Caused by: org.activiti.engine.ActivitiException: problem evaluating script: javax.el.PropertyNotFoundException: Cannot find property i
   at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:69)
   at org.activiti.engine.impl.cmd.GetFormCmd.execute(GetFormCmd.java:89)
   at org.activiti.engine.impl.interceptor.DefaultCommandExecutor$InternalCommandInterceptorChain.execute(DefaultCommandExecutor.java:102)
   at org.activiti.engine.impl.interceptor.DefaultCommandExecutor$InternalCommandContextCreator.invoke(DefaultCommandExecutor.java:127)
   at org.activiti.engine.impl.interceptor.DefaultCommandExecutor$InternalCommandInterceptorChain.execute(DefaultCommandExecutor.java:95)
   at org.activiti.engine.impl.interceptor.DefaultCommandExecutor.execute(DefaultCommandExecutor.java:57)
   at org.activiti.engine.impl.TaskServiceImpl.getTaskForm(TaskServiceImpl.java:141)
   at org.activiti.rest.api.tasks.TaskFormGet.executeWebScript(TaskFormGet.java:30)
   at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:85)
   at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
   … 17 more
Caused by: javax.script.ScriptException: javax.el.PropertyNotFoundException: Cannot find property i
   at com.sun.script.juel.JuelScriptEngine.evalExpr(JuelScriptEngine.java:463)
   at com.sun.script.juel.JuelScriptEngine.eval(JuelScriptEngine.java:167)
   at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:216)
   at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:67)
   … 26 more
Caused by: javax.el.PropertyNotFoundException: Cannot find property i
   at de.odysseus.el.util.RootPropertyResolver.getValue(RootPropertyResolver.java:86)
   at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:231)
   at de.odysseus.el.util.SimpleResolver.getValue(SimpleResolver.java:120)
   at de.odysseus.el.tree.impl.ast.AstIdentifier.eval(AstIdentifier.java:84)
   at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:51)
   at de.odysseus.el.tree.impl.ast.AstComposite.eval(AstComposite.java:35)
   at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:28)
   at de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:122)
   at com.sun.script.juel.JuelScriptEngine.evalExpr(JuelScriptEngine.java:459)

Then… I'm doing something wrong? or is it a bug?

My target:
I have an arrayList variable with String and i would put this values inside a select values of the form.
6 REPLIES 6

jbarrez
Star Contributor
Star Contributor
It's not jsp tags that are used inside the forms, but freemaker.
You can do loops in various ways, for example: http://fmpp.sourceforge.net/freemarker/ref_directive_list.html

jcosano
Champ in-the-making
Champ in-the-making
Ok, I will try it!

jcosano
Champ in-the-making
Champ in-the-making
<#assign x=3>
<#list 1..x as i>
  ${i}
</#list>


Error

05-oct-2010 11:00:39 org.springframework.extensions.webscripts.AbstractRuntime executeScript
GRAVE: Exception from executeScript - redirecting to status template error: 09050000 Wrapped Exception (with status template): problem evaluating script: javax.el.PropertyNotFoundException: Cannot find property i
org.springframework.extensions.webscripts.WebScriptException: 09050000 Wrapped Exception (with status template): problem evaluating script: javax.el.PropertyNotFoundException: Cannot find property i
    at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:731)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:167)
    at org.springframework.extensions.webscripts.PresentationContainer.executeScript(PresentationContainer.java:69)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:307)
    at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:178)
    at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)
Caused by: org.activiti.engine.ActivitiException: problem evaluating script: javax.el.PropertyNotFoundException: Cannot find property i
    at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:69)
    at org.activiti.engine.impl.cmd.GetRenderedFormCmd.execute(GetRenderedFormCmd.java:92)
    at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:36)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
    at org.activiti.engine.impl.TaskServiceImpl.getRenderedTaskForm(TaskServiceImpl.java:119)
    at org.activiti.rest.api.tasks.TaskFormGet.executeWebScript(TaskFormGet.java:31)
    at org.activiti.rest.util.ActivitiWebScript.executeImpl(ActivitiWebScript.java:76)
    at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)
    … 17 more
Caused by: javax.script.ScriptException: javax.el.PropertyNotFoundException: Cannot find property i
    at org.activiti.engine.impl.scripting.JuelScriptEngine.evaluateExpression(JuelScriptEngine.java:107)
    at org.activiti.engine.impl.scripting.JuelScriptEngine.eval(JuelScriptEngine.java:83)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:216)
    at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:67)
    … 25 more
Caused by: javax.el.PropertyNotFoundException: Cannot find property i
    at de.odysseus.el.util.SimpleResolver.get(SimpleResolver.java:109)
    at de.odysseus.el.util.SimpleResolver.getValue(SimpleResolver.java:129)
    at de.odysseus.el.tree.impl.ast.AstIdentifier.eval(AstIdentifier.java:71)
    at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:42)
    at de.odysseus.el.tree.impl.ast.AstComposite.eval(AstComposite.java:35)
    at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:28)
    at de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:121)
    at org.activiti.engine.impl.scripting.JuelScriptEngine.evaluateExpression(JuelScriptEngine.java:105)
    … 28 more

jbarrez
Star Contributor
Star Contributor
I verified it, and you are correct. The internal form rendering engine has been switched from Freemarker to Juel (hence my link to the Freemarker website).

However, I cannot find staright away how to do loops with JUEL.
Could you file a JIRA describing that it would be better to switch back to Freemarker again ?

jcosano
Champ in-the-making
Champ in-the-making

cr2121
Champ in-the-making
Champ in-the-making
I hava the same question.