san9665956539 / struts2-map-plugin

Automatically exported from code.google.com/p/struts2-map-plugin
0 stars 0 forks source link

Plugin Does not work on latest struts2 version #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I recently upgraded to struts2.3.15.1 and I could see that maps are not getting 
loaded using this plugin.

It will ftl error that template cannot be loaded.

Exact error is 

FreeMarker template error!

Expression center is undefined on line 142, column 99 in 
template/lalotech/map.ftl. The problematic instruction: ---------- ==> 
${center.latitude} [on line 142, column 97 in template/lalotech/map.ftl] in 
user-directive s.iterator [on line 122, column 9 in template/lalotech/map.ftl] 
---------- Java backtrace for programmers: ---------- 
freemarker.core.InvalidReferenceException: Expression center is undefined on 
line 142, column 99 in template/lalotech/map.ftl. at 
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125) at 
freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135) at 
freemarker.core.Dot._getAsTemplateModel(Dot.java:78) 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:221) at 
freemarker.core.MixedContent.accept(MixedContent.java:92) at 
freemarker.core.Environment.visit(Environment.java:221) at 
freemarker.core.Environment.visit(Environment.java:310) at 
freemarker.core.UnifiedCall.accept(UnifiedCall.java:130) at 
freemarker.core.Environment.visit(Environment.java:221) at 
freemarker.core.MixedContent.accept(MixedContent.java:92) at 
freemarker.core.Environment.visit(Environment.java:221) at 
freemarker.core.Environment.process(Environment.java:199) at 
freemarker.template.Template.process(Template.java:259) at 
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(F
reemarkerTemplateEngine.java:157) at 
org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:572) at 
org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:57) at 
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.
java:53) at 
org.apache.jsp.doctor.hospital.detailsPublic_jsp._jspx_meth_sl_005fmap_005f0(det
ailsPublic_jsp.java:3598) at 
org.apache.jsp.doctor.hospital.detailsPublic_jsp._jspService(detailsPublic_jsp.j
ava:466) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) 
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:305) at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210) at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java
:749) at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatc
her.java:487) at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.j
ava:412) at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.jav
a:339) at 
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatche
rResult.java:164) at 
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.ja
va:186) at 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvoc
ation.java:371) at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.j
ava:275) at 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(Debuggin
gInterceptor.java:256) at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.j
ava:246) at 
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(Defau
ltWorkflowInterceptor.java:167) at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilt
erInterceptor.java:98) at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.j
ava:246) at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationIn
terceptor.java:265) at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doInte
rcept(AnnotationValidationInterceptor.java:68) at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilt
erInterceptor.java:98) at 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.j
ava:246) at 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(Convers
ionErrorInterceptor.java:138) 

I am using 0.3 version of this plugin

Original issue reported on code.google.com by findecli...@gmail.com on 24 Aug 2013 at 9:24

GoogleCodeExporter commented 8 years ago
Well this does not work even with struts 2.3.8 or higher.

Original comment by ghotanka...@gmail.com on 6 Sep 2013 at 1:07

GoogleCodeExporter commented 8 years ago
Now I am getting a script error on struts2.3.15.1 with latest lib 0.5 release

geocerca1Options.center = new google.maps.LatLng(,);

Original comment by findecli...@gmail.com on 6 Sep 2013 at 6:52

GoogleCodeExporter commented 8 years ago
Well I see some change history of struts2 in version 2.3.14.3 i see following 
comment 

"Whitelisting of actions' names was introduced and double evaluation of OGNL 
expression was removed."

I think we depend on double expression which is breaking this code?

Should be able to fix if author spends some time

Original comment by ghotanka...@gmail.com on 6 Sep 2013 at 7:02

GoogleCodeExporter commented 8 years ago
Well this works with struts2.3.14.3 but not with struts2.3.15 or higher. 

Owner can comment on how it can be fixed? Here is the change list 
http://struts.apache.org/release/2.3.x/docs/version-notes-2315.html 

The parameters are not getting set to LatLng that's for sure, no idea what 
broke it.

Original comment by ghotanka...@gmail.com on 22 Sep 2013 at 8:31

GoogleCodeExporter commented 8 years ago
i'm sorry i'm busy right now,i come back with feedback about this issue

Original comment by lalokana on 25 Sep 2013 at 4:42

GoogleCodeExporter commented 8 years ago
i check the code and in template freemarker don't escape the parameter

<@s.property value="latlon.longitude"/>

i come back

Original comment by lalokana on 10 Oct 2013 at 9:41

GoogleCodeExporter commented 8 years ago
fixed at release 0.6 at 

https://github.com/lalotech/struts2-map-plugin and 
https://github.com/lalotech/struts2-tag-plugin-showcase

with struts2 version: 2.3.16

Original comment by lalokana on 19 Feb 2014 at 12:17