Hi all,
I want to retrive Map<Key,value> pair in ftl, How can i do that. Phani -- G.Venkata Phanindra Mob:: 9849852989 |
value is retrieved by ${map.key}
freemarker.org would be a very beneficial site for this kind of stuff. --- "G.Venkata Phanindra" <[hidden email]> wrote: > Hi all, > I want to retrive Map<Key,value> pair in > ftl, How can i do that. > Phani > > -- > G.Venkata Phanindra > Mob:: 9849852989 > |
Hi Chris ..
My Map contains values as follows and i want to Display them in loop {2006/5=June 2006, 2006/6=July 2006, 2006/4=May 2006, 2006/7=August 2006} I want to use both Key anf value in an Anchor tag like <a href ="/archives/Key">value</a> ex :- <a href ="/archives/2006/05">May 2006</a> how can i display ?? Thanks Phani On 7/8/06, Chris Howe <[hidden email]> wrote: > > value is retrieved by ${map.key} > freemarker.org would be a very beneficial site for > this kind of stuff. > > --- "G.Venkata Phanindra" <[hidden email]> wrote: > > > Hi all, > > I want to retrive Map<Key,value> pair in > > ftl, How can i do that. > > Phani > > > > -- > > G.Venkata Phanindra > > Mob:: 9849852989 > > > > -- G.Venkata Phanindra Mob:: 9849852989 |
<#assign h = {"name":"mouse", "price":50}>
<#assign keys = h?keys> <#list keys as key>${key} = ${h[key]}; </#list> outputs name = mouse; price = 50; --- "G.Venkata Phanindra" <[hidden email]> wrote: > Hi Chris .. > My Map contains values as follows > and i want to Display them > in loop > {2006/5=June 2006, 2006/6=July 2006, 2006/4=May > 2006, 2006/7=August 2006} > I want to use both Key anf value in an Anchor tag > like > <a href ="/archives/Key">value</a> > ex :- > <a href ="/archives/2006/05">May 2006</a> > how can i display ?? > > Thanks > Phani > > On 7/8/06, Chris Howe <[hidden email]> wrote: > > > > value is retrieved by ${map.key} > > freemarker.org would be a very beneficial site for > > this kind of stuff. > > > > --- "G.Venkata Phanindra" <[hidden email]> > wrote: > > > > > Hi all, > > > I want to retrive Map<Key,value> pair in > > > ftl, How can i do that. > > > Phani > > > > > > -- > > > G.Venkata Phanindra > > > Mob:: 9849852989 > > > > > > > > > > -- > G.Venkata Phanindra > Mob:: 9849852989 > |
Hi...
This Example is working fine for me.But i am trying to use java.util.Map for which i am unable to use the same logic... I am getting following Error ..... My COde is <#assign keys = monthMap?keys> <#list keys as key>${key} = ${monthMap[key]}; </#list> hashCode = Error on line 7, column 39 in archives.ftl Expecting a string, date or number here, Expression monthMap[key] is instead a freemarker.ext.beans.SimpleMethodModel The problematic instruction: ---------- ==> ${monthMap[key]} [on line 7, column 37 in archives.ftl] ---------- Java backtrace for programmers: ---------- freemarker.core.NonStringException: Error on line 7, column 39 in archives.ftl Expecting a string, date or number here, Expression monthMap[key] is instead a freemarker.ext.beans.SimpleMethodModel at freemarker.core.Expression.getStringValue(Expression.java:126) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( FreeMarkerWorker.java:176) at org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) at org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( HtmlWidget.java:114) at org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) at org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString (ModelScreenWidget.java:806) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString( ModelScreenWidget.java:405) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString (ModelScreenWidget.java:532) at org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( ModelScreenWidget.java:193) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString (ModelScreenWidget.java:554) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( ModelScreenWidget.java:310) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( ModelScreenWidget.java:310) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString (ModelScreenWidget.java:500) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( ScreenWidgetViewHandler.java:85) at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:107) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection (Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) On 7/8/06, Chris Howe <[hidden email]> wrote: > > <#assign h = {"name":"mouse", "price":50}> > <#assign keys = h?keys> > <#list keys as key>${key} = ${h[key]}; </#list> > > outputs > name = mouse; price = 50; > > --- "G.Venkata Phanindra" <[hidden email]> wrote: > > > Hi Chris .. > > My Map contains values as follows > > and i want to Display them > > in loop > > {2006/5=June 2006, 2006/6=July 2006, 2006/4=May > > 2006, 2006/7=August 2006} > > I want to use both Key anf value in an Anchor tag > > like > > <a href ="/archives/Key">value</a> > > ex :- > > <a href ="/archives/2006/05">May 2006</a> > > how can i display ?? > > > > Thanks > > Phani > > > > On 7/8/06, Chris Howe <[hidden email]> wrote: > > > > > > value is retrieved by ${map.key} > > > freemarker.org would be a very beneficial site for > > > this kind of stuff. > > > > > > --- "G.Venkata Phanindra" <[hidden email]> > > wrote: > > > > > > > Hi all, > > > > I want to retrive Map<Key,value> pair in > > > > ftl, How can i do that. > > > > Phani > > > > > > > > -- > > > > G.Venkata Phanindra > > > > Mob:: 9849852989 > > > > > > > > > > > > > > > > -- > > G.Venkata Phanindra > > Mob:: 9849852989 > > > > -- G.Venkata Phanindra Mob:: 9849852989 |
where is your monthMap coming from?
--- "G.Venkata Phanindra" <[hidden email]> wrote: > Hi... > This Example is working fine for me.But i am > trying to use > java.util.Map > for which i am unable to use the same > logic... > I am getting following Error ..... > My COde is > <#assign keys = monthMap?keys> > <#list keys as key>${key} = ${monthMap[key]}; > </#list> > > hashCode = Error on line 7, column 39 in > archives.ftl Expecting a > string, date or number here, Expression > monthMap[key] is instead a > freemarker.ext.beans.SimpleMethodModel The > problematic instruction: > ---------- ==> ${monthMap[key]} [on line 7, column > 37 in archives.ftl] > ---------- Java backtrace for programmers: > ---------- > freemarker.core.NonStringException: Error on line 7, > column 39 in > archives.ftl Expecting a string, date or number > here, Expression > monthMap[key] is instead a > freemarker.ext.beans.SimpleMethodModel at > > at > freemarker.core.Expression.getStringValue(Expression.java:93) > at > freemarker.core.DollarVariable.accept(DollarVariable.java:76) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.MixedContent.accept(MixedContent.java:92) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) > at > freemarker.core.Environment.visit(Environment.java:351) > at > freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.MixedContent.accept(MixedContent.java:92) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.Environment.process(Environment.java:176) > at > freemarker.template.Template.process(Template.java:231) > at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > FreeMarkerWorker.java:176) at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > HtmlWidget.java:114) at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > (ModelScreenWidget.java:806) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > at > org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString( > ModelScreenWidget.java:405) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > (ModelScreenWidget.java:532) at > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > ModelScreenWidget.java:193) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > (ModelScreenWidget.java:554) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > (ModelScreenWidget.java:500) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) > at > org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( > ScreenWidgetViewHandler.java:85) at > org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) > at > org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) > at > org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:252) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.apache.catalina.core.StandardWrapperValve.invoke( > StandardWrapperValve.java:213) at > org.apache.catalina.core.StandardContextValve.invoke( > StandardContextValve.java:178) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at > org.apache.catalina.core.StandardEngineValve.invoke( > StandardEngineValve.java:107) at > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection > (Http11Protocol.java:744) at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > PoolTcpEndpoint.java:527) at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > LeaderFollowerWorkerThread.java:80) at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:684) at > java.lang.Thread.run(Thread.java:595) > > On 7/8/06, Chris Howe <[hidden email]> wrote: > > > > <#assign h = {"name":"mouse", "price":50}> > > <#assign keys = h?keys> > > <#list keys as key>${key} = ${h[key]}; </#list> > > > > outputs > > name = mouse; price = 50; > > > > --- "G.Venkata Phanindra" <[hidden email]> > wrote: > > > > > Hi Chris .. > > > My Map contains values as > follows > > > and i want to Display them > > > in loop > > > {2006/5=June 2006, 2006/6=July 2006, 2006/4=May > > > 2006, 2006/7=August 2006} > > > I want to use both Key anf value in an Anchor > tag > > > like > > > <a href ="/archives/Key">value</a> > > > ex :- > > > <a href ="/archives/2006/05">May 2006</a> > > > how can i display ?? > > > > > > Thanks > > > Phani > > > > > > On 7/8/06, Chris Howe <[hidden email]> > wrote: > > > > > > > > value is retrieved by ${map.key} > > > > freemarker.org would be a very beneficial site > for > > > > this kind of stuff. > > > > > > > > --- "G.Venkata Phanindra" > <[hidden email]> > |
Hi Chris
Map is comming from Context.i.e in the .bsh file i added it to Context. context.put("monthMap",monthMap); Phani On 7/8/06, Chris Howe <[hidden email]> wrote: > > where is your monthMap coming from? > > --- "G.Venkata Phanindra" <[hidden email]> wrote: > > > Hi... > > This Example is working fine for me.But i am > > trying to use > > java.util.Map > > for which i am unable to use the same > > logic... > > I am getting following Error ..... > > My COde is > > <#assign keys = monthMap?keys> > > <#list keys as key>${key} = ${monthMap[key]}; > > </#list> > > > > hashCode = Error on line 7, column 39 in > > archives.ftl Expecting a > > string, date or number here, Expression > > monthMap[key] is instead a > > freemarker.ext.beans.SimpleMethodModel The > > problematic instruction: > > ---------- ==> ${monthMap[key]} [on line 7, column > > 37 in archives.ftl] > > ---------- Java backtrace for programmers: > > ---------- > > freemarker.core.NonStringException: Error on line 7, > > column 39 in > > archives.ftl Expecting a string, date or number > > here, Expression > > monthMap[key] is instead a > > freemarker.ext.beans.SimpleMethodModel at > > > freemarker.core.Expression.getStringValue(Expression.java:126) > > at > > > freemarker.core.Expression.getStringValue(Expression.java:93) > > at > > > freemarker.core.DollarVariable.accept(DollarVariable.java:76) > > at > > > freemarker.core.Environment.visit(Environment.java:196) > > at > > > freemarker.core.MixedContent.accept(MixedContent.java:92) > > at > > > freemarker.core.Environment.visit(Environment.java:196) > > at > > > freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) > > at > > > freemarker.core.Environment.visit(Environment.java:351) > > at > > > freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) > > at > > > freemarker.core.Environment.visit(Environment.java:196) > > at > > > freemarker.core.MixedContent.accept(MixedContent.java:92) > > at > > > freemarker.core.Environment.visit(Environment.java:196) > > at > > > freemarker.core.Environment.process(Environment.java:176) > > at > > > freemarker.template.Template.process(Template.java:231) > > at > > > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > > FreeMarkerWorker.java:176) at > > > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > > at > > > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > > HtmlWidget.java:114) at > > > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > > at > > > > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > > (ModelScreenWidget.java:806) at > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > ModelScreenWidget.java:161) at > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > ModelScreenWidget.java:254) at > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > :144) > > at > > > org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString > ( > > ModelScreenWidget.java:405) at > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > ModelScreenWidget.java:161) at > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > > (ModelScreenWidget.java:532) at > > > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > > ModelScreenWidget.java:193) at > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > > (ModelScreenWidget.java:554) at > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > ModelScreenWidget.java:161) at > > > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > > ModelScreenWidget.java:310) at > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > ModelScreenWidget.java:161) at > > > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > > ModelScreenWidget.java:310) at > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > ModelScreenWidget.java:161) at > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > ModelScreenWidget.java:254) at > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > :144) > > at > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > > (ModelScreenWidget.java:500) at > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > ModelScreenWidget.java:161) at > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > ModelScreenWidget.java:254) at > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > :144) > > at > > > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) > > at > > > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) > > at > > > org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( > > ScreenWidgetViewHandler.java:85) at > > > org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java > :611) > > at > > > org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) > > at > > > org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) > > at > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > > at > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > > ApplicationFilterChain.java:252) at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter( > > ApplicationFilterChain.java:173) at > > > org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > > ApplicationFilterChain.java:202) at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter( > > ApplicationFilterChain.java:173) at > > > com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > > ApplicationFilterChain.java:202) at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter( > > ApplicationFilterChain.java:173) at > > > org.apache.catalina.core.StandardWrapperValve.invoke( > > StandardWrapperValve.java:213) at > > > org.apache.catalina.core.StandardContextValve.invoke( > > StandardContextValve.java:178) at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java > :126) > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java > :105) > > at > > org.apache.catalina.core.StandardEngineValve.invoke( > > StandardEngineValve.java:107) at > > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) > > at > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java > :148) > > at > > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > > at > > > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection > > (Http11Protocol.java:744) at > > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > > PoolTcpEndpoint.java:527) at > > > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > > LeaderFollowerWorkerThread.java:80) at > > > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > > ThreadPool.java:684) at > > java.lang.Thread.run(Thread.java:595) > > > > On 7/8/06, Chris Howe <[hidden email]> wrote: > > > > > > <#assign h = {"name":"mouse", "price":50}> > > > <#assign keys = h?keys> > > > <#list keys as key>${key} = ${h[key]}; </#list> > > > > > > outputs > > > name = mouse; price = 50; > > > > > > --- "G.Venkata Phanindra" <[hidden email]> > > wrote: > > > > > > > Hi Chris .. > > > > My Map contains values as > > follows > > > > and i want to Display them > > > > in loop > > > > {2006/5=June 2006, 2006/6=July 2006, 2006/4=May > > > > 2006, 2006/7=August 2006} > > > > I want to use both Key anf value in an Anchor > > tag > > > > like > > > > <a href ="/archives/Key">value</a> > > > > ex :- > > > > <a href ="/archives/2006/05">May 2006</a> > > > > how can i display ?? > > > > > > > > Thanks > > > > Phani > > > > > > > > On 7/8/06, Chris Howe <[hidden email]> > > wrote: > > > > > > > > > > value is retrieved by ${map.key} > > > > > freemarker.org would be a very beneficial site > > for > > > > > this kind of stuff. > > > > > > > > > > --- "G.Venkata Phanindra" > > <[hidden email]> > > > === message truncated === > > -- G.Venkata Phanindra Mob:: 9849852989 |
try...
<#list monthMap as mMap> ${mMap?key} = ${mMap.someAttributeOfTheMap} </#list> --- "G.Venkata Phanindra" <[hidden email]> wrote: > Hi Chris > Map is comming from Context.i.e in the > .bsh file i added it to > Context. > context.put("monthMap",monthMap); > > Phani > > On 7/8/06, Chris Howe <[hidden email]> wrote: > > > > where is your monthMap coming from? > > > > --- "G.Venkata Phanindra" <[hidden email]> > wrote: > > > > > Hi... > > > This Example is working fine for me.But i > am > > > trying to use > > > java.util.Map > > > for which i am unable to use the same > > > logic... > > > I am getting following Error ..... > > > My COde is > > > <#assign keys = monthMap?keys> > > > <#list keys as key>${key} = > ${monthMap[key]}; > > > </#list> > > > > > > hashCode = Error on line 7, column 39 in > > > archives.ftl Expecting a > > > string, date or number here, Expression > > > monthMap[key] is instead a > > > freemarker.ext.beans.SimpleMethodModel The > > > problematic instruction: > > > ---------- ==> ${monthMap[key]} [on line 7, > column > > > 37 in archives.ftl] > > > ---------- Java backtrace for programmers: > > > ---------- > > > freemarker.core.NonStringException: Error on > line 7, > > > column 39 in > > > archives.ftl Expecting a string, date or number > > > here, Expression > > > monthMap[key] is instead a > > > freemarker.ext.beans.SimpleMethodModel at > > > > > > > > > at > > > > > > freemarker.core.Expression.getStringValue(Expression.java:93) > > > at > > > > > > freemarker.core.DollarVariable.accept(DollarVariable.java:76) > > > at > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > at > > > > > > freemarker.core.MixedContent.accept(MixedContent.java:92) > > > at > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > at > > > > > > freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) > > > at > > > > > > freemarker.core.Environment.visit(Environment.java:351) > > > at > > > > > > freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) > > > at > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > at > > > > > > freemarker.core.MixedContent.accept(MixedContent.java:92) > > > at > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > at > > > > > > freemarker.core.Environment.process(Environment.java:176) > > > at > > > > > > freemarker.template.Template.process(Template.java:231) > > > at > > > > > > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > > > FreeMarkerWorker.java:176) at > > > > > > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > > > at > > > > > > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > > > HtmlWidget.java:114) at > > > > > > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > > > at > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > > > (ModelScreenWidget.java:806) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > ModelScreenWidget.java:161) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > > ModelScreenWidget.java:254) at > > > > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > > :144) > > > at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString > > ( > > > ModelScreenWidget.java:405) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > ModelScreenWidget.java:161) at > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > > > (ModelScreenWidget.java:532) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > > > ModelScreenWidget.java:193) at > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > > > (ModelScreenWidget.java:554) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > ModelScreenWidget.java:161) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > > > ModelScreenWidget.java:310) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > ModelScreenWidget.java:161) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > > > ModelScreenWidget.java:310) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > ModelScreenWidget.java:161) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > > ModelScreenWidget.java:254) at > > > > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > > :144) > > > at > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > > > (ModelScreenWidget.java:500) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > ModelScreenWidget.java:161) at > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > === message truncated === |
I am Unable access the value using the ${mMap.someAttributeOfTheMap}
my Map is monthMap<String,String> with monthMap<monthint,month> i tried to access it as ${monthMap.month} i am getting following Error Expected collection or sequence. monthMap evaluated instead to freemarker.ext.beans.MapModel on line 6, column 12 in archives.ftl. The problematic instruction: ---------- ==> list monthMap as mMap [on line 6, column 5 in archives.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateException: Expected collection or sequence. monthMap evaluated instead to freemarker.ext.beans.MapModel on line 6, column 12 in archives.ftl. at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135) at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:183) at freemarker.core.Environment.visit(Environment.java:351) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( FreeMarkerWorker.java:176) at org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) at org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( HtmlWidget.java:114) at org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) at org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString (ModelScreenWidget.java:806) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke( Method.java:585) at freemarker.ext.beans.BeansWrapper.invokeMethod( BeansWrapper.java:583) at freemarker.ext.beans.OverloadedMethodModel.exec( OverloadedMethodModel.java:111) at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Macro$Context.runMacro(Macro.java:164) at freemarker.core.Environment.visit(Environment.java:537) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:128) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( FreeMarkerWorker.java:176) at org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) at org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( HtmlWidget.java:114) at org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) at org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString (ModelScreenWidget.java:806) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString (ModelScreenWidget.java:532) at org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( ModelScreenWidget.java:193) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString (ModelScreenWidget.java:554) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( ModelScreenWidget.java:310) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( ModelScreenWidget.java:310) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString (ModelScreenWidget.java:500) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( ScreenWidgetViewHandler.java:85) at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:107) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection (Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Method public java.lang.String org.ofbiz.widget.screen.ScreenRenderer.render( java.lang.String) throws org.ofbiz.base.util.GeneralException, java.io.IOException,org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException threw an exception when invoked on org.ofbiz.widget.screen.ScreenRenderer@14b6ec8 The problematic instruction: ---------- ==> ${screens.render("component://giftsnideas/widget/ForumScreens.xml#archives")} [on line 121, column 1 in bloglib.ftl] in user-directive blog.renderBlog [on line 3, column 1 in showforum.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: Method public java.lang.String org.ofbiz.widget.screen.ScreenRenderer.render( java.lang.String) throws org.ofbiz.base.util.GeneralException, java.io.IOException,org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException threw an exception when invoked on org.ofbiz.widget.screen.ScreenRenderer@14b6ec8 at freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:134) at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Macro$Context.runMacro(Macro.java:164) at freemarker.core.Environment.visit(Environment.java:537) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:128) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:196) at freemarker.core.Environment.process(Environment.java:176) at freemarker.template.Template.process(Template.java:231) at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( FreeMarkerWorker.java:176) at org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) at org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( HtmlWidget.java:114) at org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) at org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString (ModelScreenWidget.java:806) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString (ModelScreenWidget.java:532) at org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( ModelScreenWidget.java:193) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString (ModelScreenWidget.java:554) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( ModelScreenWidget.java:310) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( ModelScreenWidget.java:310) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString (ModelScreenWidget.java:500) at org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( ModelScreenWidget.java:161) at org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( ModelScreenWidget.java:254) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( ScreenWidgetViewHandler.java:85) at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:107) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection (Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: org.ofbiz.base.util.GeneralException: Error rendering screen [component://giftsnideas/widget/ForumScreens.xml#archives]: java.lang.RuntimeException: Error rendering included template at location [component://giftsnideas/webapp/giftsnideas/forum/archives.ftl]: freemarker.template.TemplateException: Expected collection or sequence. monthMap evaluated instead to freemarker.ext.beans.MapModel on line 6, column 12 in archives.ftl. (Error rendering included template at location [component://giftsnideas/webapp/giftsnideas/forum/archives.ftl]: freemarker.template.TemplateException: Expected collection or sequence. monthMap evaluated instead to freemarker.ext.beans.MapModel on line 6, column 12 in archives.ftl.) at org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:155) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke( Method.java:585) at freemarker.ext.beans.BeansWrapper.invokeMethod( BeansWrapper.java:583) at freemarker.ext.beans.OverloadedMethodModel.exec( OverloadedMethodModel.java:111) ... 64 more On 7/8/06, Chris Howe <[hidden email]> wrote: > > try... > <#list monthMap as mMap> > ${mMap?key} = ${mMap.someAttributeOfTheMap} > </#list> > > --- "G.Venkata Phanindra" <[hidden email]> wrote: > > > Hi Chris > > Map is comming from Context.i.e in the > > .bsh file i added it to > > Context. > > context.put("monthMap",monthMap); > > > > Phani > > > > On 7/8/06, Chris Howe <[hidden email]> wrote: > > > > > > where is your monthMap coming from? > > > > > > --- "G.Venkata Phanindra" <[hidden email]> > > wrote: > > > > > > > Hi... > > > > This Example is working fine for me.But i > > am > > > > trying to use > > > > java.util.Map > > > > for which i am unable to use the same > > > > logic... > > > > I am getting following Error ..... > > > > My COde is > > > > <#assign keys = monthMap?keys> > > > > <#list keys as key>${key} = > > ${monthMap[key]}; > > > > </#list> > > > > > > > > hashCode = Error on line 7, column 39 in > > > > archives.ftl Expecting a > > > > string, date or number here, Expression > > > > monthMap[key] is instead a > > > > freemarker.ext.beans.SimpleMethodModel The > > > > problematic instruction: > > > > ---------- ==> ${monthMap[key]} [on line 7, > > column > > > > 37 in archives.ftl] > > > > ---------- Java backtrace for programmers: > > > > ---------- > > > > freemarker.core.NonStringException: Error on > > line 7, > > > > column 39 in > > > > archives.ftl Expecting a string, date or number > > > > here, Expression > > > > monthMap[key] is instead a > > > > freemarker.ext.beans.SimpleMethodModel at > > > > > > > > > > freemarker.core.Expression.getStringValue(Expression.java:126) > > > > at > > > > > > > > > > freemarker.core.Expression.getStringValue(Expression.java:93) > > > > at > > > > > > > > > > freemarker.core.DollarVariable.accept(DollarVariable.java:76) > > > > at > > > > > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > > at > > > > > > > > > > freemarker.core.MixedContent.accept(MixedContent.java:92) > > > > at > > > > > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > > at > > > > > > > > > > freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) > > > > at > > > > > > > > > > freemarker.core.Environment.visit(Environment.java:351) > > > > at > > > > > > > > > > freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) > > > > at > > > > > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > > at > > > > > > > > > > freemarker.core.MixedContent.accept(MixedContent.java:92) > > > > at > > > > > > > > > > freemarker.core.Environment.visit(Environment.java:196) > > > > at > > > > > > > > > > freemarker.core.Environment.process(Environment.java:176) > > > > at > > > > > > > > > > freemarker.template.Template.process(Template.java:231) > > > > at > > > > > > > > > > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > > > > FreeMarkerWorker.java:176) at > > > > > > > > > > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > > > > at > > > > > > > > > > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > > > > HtmlWidget.java:114) at > > > > > > > > > > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > > > > at > > > > > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > > > > (ModelScreenWidget.java:806) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > > ModelScreenWidget.java:161) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > > > ModelScreenWidget.java:254) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > > > :144) > > > > at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString > > > ( > > > > ModelScreenWidget.java:405) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > > ModelScreenWidget.java:161) at > > > > > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > > > > (ModelScreenWidget.java:532) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > > > > ModelScreenWidget.java:193) at > > > > > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > > > > (ModelScreenWidget.java:554) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > > ModelScreenWidget.java:161) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > > > > ModelScreenWidget.java:310) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > > ModelScreenWidget.java:161) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > > > > ModelScreenWidget.java:310) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > > ModelScreenWidget.java:161) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > > > ModelScreenWidget.java:254) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java > > > :144) > > > > at > > > > > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > > > > (ModelScreenWidget.java:500) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > > > > ModelScreenWidget.java:161) at > > > > > > > > > > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > > > === message truncated === > > -- G.Venkata Phanindra Mob:: 9849852989 |
maybe this will help http://freemarker.org/docs/ref_builtins_hash.html Fred G.Venkata Phanindra wrote: > I am Unable access the value using the ${mMap.someAttributeOfTheMap} > my Map is monthMap<String,String> with monthMap<monthint,month> > i tried to access it as ${monthMap.month} i am getting following > Error > > > > Expected collection or sequence. monthMap evaluated instead to > freemarker.ext.beans.MapModel on line 6, column 12 in archives.ftl. The > problematic instruction: ---------- ==> list monthMap as mMap [on line 6, > column 5 in archives.ftl] ---------- Java backtrace for programmers: > ---------- freemarker.template.TemplateException: Expected collection or > sequence. monthMap evaluated instead to freemarker.ext.beans.MapModel on > line 6, column 12 in archives.ftl. at > freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135) > > at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:183) at > freemarker.core.Environment.visit(Environment.java:351) at > freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.Environment.process(Environment.java:176) at > freemarker.template.Template.process(Template.java:231) at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > FreeMarkerWorker.java:176) at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > HtmlWidget.java:114) at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > > (ModelScreenWidget.java:806) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at > sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke( > Method.java:585) at freemarker.ext.beans.BeansWrapper.invokeMethod( > BeansWrapper.java:583) at freemarker.ext.beans.OverloadedMethodModel.exec( > OverloadedMethodModel.java:111) at > freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at > freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at > freemarker.core.Expression.getStringValue(Expression.java:93) at > freemarker.core.DollarVariable.accept(DollarVariable.java:76) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.Macro$Context.runMacro(Macro.java:164) at > freemarker.core.Environment.visit(Environment.java:537) at > freemarker.core.UnifiedCall.accept(UnifiedCall.java:128) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.Environment.process(Environment.java:176) at > freemarker.template.Template.process(Template.java:231) at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > FreeMarkerWorker.java:176) at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > HtmlWidget.java:114) at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > > (ModelScreenWidget.java:806) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > > (ModelScreenWidget.java:532) at > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > ModelScreenWidget.java:193) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > > (ModelScreenWidget.java:554) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > > (ModelScreenWidget.java:500) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at > org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( > ScreenWidgetViewHandler.java:85) at > org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) > at > org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) > at > org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:252) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.apache.catalina.core.StandardWrapperValve.invoke( > StandardWrapperValve.java:213) at > org.apache.catalina.core.StandardContextValve.invoke( > StandardContextValve.java:178) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > > at org.apache.catalina.core.StandardEngineValve.invoke( > StandardEngineValve.java:107) at > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection > > (Http11Protocol.java:744) at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > PoolTcpEndpoint.java:527) at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > LeaderFollowerWorkerThread.java:80) at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Method public > java.lang.String org.ofbiz.widget.screen.ScreenRenderer.render( > java.lang.String) throws org.ofbiz.base.util.GeneralException, > java.io.IOException,org.xml.sax.SAXException, > javax.xml.parsers.ParserConfigurationException threw an exception when > invoked on org.ofbiz.widget.screen.ScreenRenderer@14b6ec8 The problematic > instruction: ---------- ==> > ${screens.render("component://giftsnideas/widget/ForumScreens.xml#archives")} > > [on line 121, column 1 in bloglib.ftl] in user-directive blog.renderBlog > [on > line 3, column 1 in showforum.ftl] ---------- Java backtrace for > programmers: ---------- freemarker.template.TemplateModelException: Method > public java.lang.String org.ofbiz.widget.screen.ScreenRenderer.render( > java.lang.String) throws org.ofbiz.base.util.GeneralException, > java.io.IOException,org.xml.sax.SAXException, > javax.xml.parsers.ParserConfigurationException threw an exception when > invoked on org.ofbiz.widget.screen.ScreenRenderer@14b6ec8 at > freemarker.ext.beans.OverloadedMethodModel.exec(OverloadedMethodModel.java:134) > > at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93) at > freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at > freemarker.core.Expression.getStringValue(Expression.java:93) at > freemarker.core.DollarVariable.accept(DollarVariable.java:76) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.Macro$Context.runMacro(Macro.java:164) at > freemarker.core.Environment.visit(Environment.java:537) at > freemarker.core.UnifiedCall.accept(UnifiedCall.java:128) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.MixedContent.accept(MixedContent.java:92) at > freemarker.core.Environment.visit(Environment.java:196) at > freemarker.core.Environment.process(Environment.java:176) at > freemarker.template.Template.process(Template.java:231) at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > FreeMarkerWorker.java:176) at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > HtmlWidget.java:114) at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > > (ModelScreenWidget.java:806) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > > (ModelScreenWidget.java:532) at > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > ModelScreenWidget.java:193) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > > (ModelScreenWidget.java:554) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > > (ModelScreenWidget.java:500) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at > org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( > ScreenWidgetViewHandler.java:85) at > org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) > at > org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) > at > org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:252) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.apache.catalina.core.StandardWrapperValve.invoke( > StandardWrapperValve.java:213) at > org.apache.catalina.core.StandardContextValve.invoke( > StandardContextValve.java:178) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > > at org.apache.catalina.core.StandardEngineValve.invoke( > StandardEngineValve.java:107) at > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection > > (Http11Protocol.java:744) at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > PoolTcpEndpoint.java:527) at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > LeaderFollowerWorkerThread.java:80) at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) Caused by: > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://giftsnideas/widget/ForumScreens.xml#archives]: > java.lang.RuntimeException: Error rendering included template at location > [component://giftsnideas/webapp/giftsnideas/forum/archives.ftl]: > freemarker.template.TemplateException: Expected collection or sequence. > monthMap evaluated instead to freemarker.ext.beans.MapModel on line 6, > column 12 in archives.ftl. (Error rendering included template at location > [component://giftsnideas/webapp/giftsnideas/forum/archives.ftl]: > freemarker.template.TemplateException: Expected collection or sequence. > monthMap evaluated instead to freemarker.ext.beans.MapModel on line 6, > column 12 in archives.ftl.) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:155) > > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) at > sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) at > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke( > Method.java:585) at freemarker.ext.beans.BeansWrapper.invokeMethod( > BeansWrapper.java:583) at freemarker.ext.beans.OverloadedMethodModel.exec( > OverloadedMethodModel.java:111) ... 64 more > > > > On 7/8/06, Chris Howe <[hidden email]> wrote: > >> >> try... >> <#list monthMap as mMap> >> ${mMap?key} = ${mMap.someAttributeOfTheMap} >> </#list> >> >> --- "G.Venkata Phanindra" <[hidden email]> wrote: >> >> > Hi Chris >> > Map is comming from Context.i.e in the >> > .bsh file i added it to >> > Context. >> > context.put("monthMap",monthMap); >> > >> > Phani >> > >> > On 7/8/06, Chris Howe <[hidden email]> wrote: >> > > >> > > where is your monthMap coming from? >> > > >> > > --- "G.Venkata Phanindra" <[hidden email]> >> > wrote: >> > > >> > > > Hi... >> > > > This Example is working fine for me.But i >> > am >> > > > trying to use >> > > > java.util.Map >> > > > for which i am unable to use the same >> > > > logic... >> > > > I am getting following Error ..... >> > > > My COde is >> > > > <#assign keys = monthMap?keys> >> > > > <#list keys as key>${key} = >> > ${monthMap[key]}; >> > > > </#list> >> > > > >> > > > hashCode = Error on line 7, column 39 in >> > > > archives.ftl Expecting a >> > > > string, date or number here, Expression >> > > > monthMap[key] is instead a >> > > > freemarker.ext.beans.SimpleMethodModel The >> > > > problematic instruction: >> > > > ---------- ==> ${monthMap[key]} [on line 7, >> > column >> > > > 37 in archives.ftl] >> > > > ---------- Java backtrace for programmers: >> > > > ---------- >> > > > freemarker.core.NonStringException: Error on >> > line 7, >> > > > column 39 in >> > > > archives.ftl Expecting a string, date or number >> > > > here, Expression >> > > > monthMap[key] is instead a >> > > > freemarker.ext.beans.SimpleMethodModel at >> > > > >> > > >> > >> freemarker.core.Expression.getStringValue(Expression.java:126) >> > > > at >> > > > >> > > >> > >> freemarker.core.Expression.getStringValue(Expression.java:93) >> > > > at >> > > > >> > > >> > >> freemarker.core.DollarVariable.accept(DollarVariable.java:76) >> > > > at >> > > > >> > > >> > >> freemarker.core.Environment.visit(Environment.java:196) >> > > > at >> > > > >> > > >> > >> freemarker.core.MixedContent.accept(MixedContent.java:92) >> > > > at >> > > > >> > > >> > >> freemarker.core.Environment.visit(Environment.java:196) >> > > > at >> > > > >> > > >> > >> freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) >> > > > at >> > > > >> > > >> > >> freemarker.core.Environment.visit(Environment.java:351) >> > > > at >> > > > >> > > >> > >> freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) >> > > > at >> > > > >> > > >> > >> freemarker.core.Environment.visit(Environment.java:196) >> > > > at >> > > > >> > > >> > >> freemarker.core.MixedContent.accept(MixedContent.java:92) >> > > > at >> > > > >> > > >> > >> freemarker.core.Environment.visit(Environment.java:196) >> > > > at >> > > > >> > > >> > >> freemarker.core.Environment.process(Environment.java:176) >> > > > at >> > > > >> > > >> > >> freemarker.template.Template.process(Template.java:231) >> > > > at >> > > > >> > > >> > >> org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( >> > > > FreeMarkerWorker.java:176) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) >> > > > at >> > > > >> > > >> > >> org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( >> > > > HtmlWidget.java:114) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) >> > > > at >> > > > >> > > >> > > >> > >> >> org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString >> >> > > > (ModelScreenWidget.java:806) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( >> > > > ModelScreenWidget.java:161) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( >> > > > ModelScreenWidget.java:254) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java >> > > :144) >> > > > at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$IncludeScreen.renderWidgetString >> >> > > ( >> > > > ModelScreenWidget.java:405) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( >> > > > ModelScreenWidget.java:161) at >> > > > >> > > >> > > >> > >> >> org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString >> >> > > > (ModelScreenWidget.java:532) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( >> > > > ModelScreenWidget.java:193) at >> > > > >> > > >> > > >> > >> >> org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString >> >> > > > (ModelScreenWidget.java:554) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( >> > > > ModelScreenWidget.java:161) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( >> > > > ModelScreenWidget.java:310) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( >> > > > ModelScreenWidget.java:161) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( >> > > > ModelScreenWidget.java:310) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( >> > > > ModelScreenWidget.java:161) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( >> > > > ModelScreenWidget.java:254) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java >> > > :144) >> > > > at >> > > > >> > > >> > > >> > >> >> org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString >> >> > > > (ModelScreenWidget.java:500) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( >> > > > ModelScreenWidget.java:161) at >> > > > >> > > >> > >> org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( >> > >> === message truncated === >> >> > > |
In reply to this post by G.Venkata Phanindra
could you attatch your script that is creating
mapMonth? --- "G.Venkata Phanindra" <[hidden email]> wrote: > I am Unable access the value using the > ${mMap.someAttributeOfTheMap} > my Map is monthMap<String,String> with > monthMap<monthint,month> > i tried to access it as ${monthMap.month} > i am getting following > Error > > > > Expected collection or sequence. monthMap evaluated > instead to > freemarker.ext.beans.MapModel on line 6, column 12 > in archives.ftl. The > problematic instruction: ---------- ==> list > monthMap as mMap [on line 6, > column 5 in archives.ftl] ---------- Java backtrace > for programmers: > ---------- freemarker.template.TemplateException: > Expected collection or > sequence. monthMap evaluated instead to > freemarker.ext.beans.MapModel on > line 6, column 12 in archives.ftl. at > > at > freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:183) > at > freemarker.core.Environment.visit(Environment.java:351) > at > freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.MixedContent.accept(MixedContent.java:92) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.Environment.process(Environment.java:176) > at > freemarker.template.Template.process(Template.java:231) > at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > FreeMarkerWorker.java:176) at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > HtmlWidget.java:114) at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > (ModelScreenWidget.java:806) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) > at > sun.reflect.GeneratedMethodAccessor56.invoke(Unknown > Source) at > sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:25) at > java.lang.reflect.Method.invoke( > Method.java:585) at > freemarker.ext.beans.BeansWrapper.invokeMethod( > BeansWrapper.java:583) at > freemarker.ext.beans.OverloadedMethodModel.exec( > OverloadedMethodModel.java:111) at > > at > freemarker.core.Expression.getAsTemplateModel(Expression.java:89) > at > freemarker.core.Expression.getStringValue(Expression.java:93) > at > freemarker.core.DollarVariable.accept(DollarVariable.java:76) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.MixedContent.accept(MixedContent.java:92) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.Macro$Context.runMacro(Macro.java:164) > at > freemarker.core.Environment.visit(Environment.java:537) > at > freemarker.core.UnifiedCall.accept(UnifiedCall.java:128) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.MixedContent.accept(MixedContent.java:92) > at > freemarker.core.Environment.visit(Environment.java:196) > at > freemarker.core.Environment.process(Environment.java:176) > at > freemarker.template.Template.process(Template.java:231) > at > org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplateAtLocation( > FreeMarkerWorker.java:176) at > org.ofbiz.widget.screen.HtmlWidget.renderHtmlTemplate(HtmlWidget.java:86) > at > org.ofbiz.widget.screen.HtmlWidget$HtmlTemplate.renderWidgetString( > HtmlWidget.java:114) at > org.ofbiz.widget.screen.HtmlWidget.renderWidgetString(HtmlWidget.java:73) > at > org.ofbiz.widget.screen.ModelScreenWidget$PlatformSpecific.renderWidgetString > (ModelScreenWidget.java:806) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSection.renderWidgetString > (ModelScreenWidget.java:532) at > org.ofbiz.widget.screen.ModelScreenWidget$SectionsRenderer.render( > ModelScreenWidget.java:193) at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorSectionInclude.renderWidgetString > (ModelScreenWidget.java:554) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Container.renderWidgetString( > ModelScreenWidget.java:310) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > at > org.ofbiz.widget.screen.ModelScreenWidget$DecoratorScreen.renderWidgetString > (ModelScreenWidget.java:500) at > org.ofbiz.widget.screen.ModelScreenWidget.renderSubWidgetsString( > ModelScreenWidget.java:161) at > org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString( > ModelScreenWidget.java:254) at > org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:144) > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:115) > at > org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:100) > at > org.ofbiz.widget.screen.ScreenWidgetViewHandler.render( > ScreenWidgetViewHandler.java:85) at > org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:611) > at > org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:396) > at > org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:191) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > at > javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:252) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:258) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > com.ecomzera.giftsnideas.urlpattern.GniFilter.doFilter(GniFilter.java:92) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( > ApplicationFilterChain.java:202) at > org.apache.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:173) at > org.apache.catalina.core.StandardWrapperValve.invoke( > StandardWrapperValve.java:213) at > org.apache.catalina.core.StandardContextValve.invoke( > StandardContextValve.java:178) at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at > org.apache.catalina.core.StandardEngineValve.invoke( > StandardEngineValve.java:107) at > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection > (Http11Protocol.java:744) at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( > PoolTcpEndpoint.java:527) at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt( > LeaderFollowerWorkerThread.java:80) at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run( > ThreadPool.java:684) at > java.lang.Thread.run(Thread.java:595) Method public > java.lang.String > org.ofbiz.widget.screen.ScreenRenderer.render( > java.lang.String) throws > org.ofbiz.base.util.GeneralException, > === message truncated === |
Free forum by Nabble | Edit this page |