Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: Release 1.5.1, Release 1.5.2
-
Fix Version/s: None
-
Component/s: Tag Library
-
Labels:None
-
Environment:any
Description
google's collections API makes for a very novel way to make immutable maps:
http://code.google.com/p/google-collections/
http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/ImmutableMap.html
Map:
public static final Map<String, String> MAP = new ImmutableMap.Builder<String, String>()
.put("abc", "xyz")
.put("key2", "value2")
.build()
However, when the tag attempts to read the key and value out of the ImmutableEntry class (that extends Map.Entry) it throws an exception:
2009-12-08 11:00:46,817 ERROR [http-8080-Processor25] core.ApplicationDispatcher (ApplicationDispatcher.java:711) - Servlet.service() for servlet jsp threw exception
java.lang.IllegalAccessException: Class net.sourceforge.stripes.util.bean.JavaBeanPropertyAccessor can not access a member of class com.google.common.collect.ImmutableEntry with modifiers "public"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.reflect.Method.invoke(Method.java:588)
at net.sourceforge.stripes.util.bean.JavaBeanPropertyAccessor.getValue(JavaBeanPropertyAccessor.java:51)
at net.sourceforge.stripes.util.bean.PropertyExpressionEvaluation.getValue(PropertyExpressionEvaluation.java:588)
at net.sourceforge.stripes.util.bean.BeanUtil.getPropertyValue(BeanUtil.java:62)
at net.sourceforge.stripes.tag.InputOptionsCollectionTag.doStartTag(InputOptionsCollectionTag.java:242)
at org.apache.jsp.WEB_002dINF.jsp.account.find_jsp._jspx_meth_s_005foptions_002dcollection_005f0(find_jsp.java:859)
at org.apache.jsp.WEB_002dINF.jsp.account.find_jsp._jspx_meth_s_005fselect_005f0(find_jsp.java:777)
at org.apache.jsp.WEB_002dINF.jsp.account.find_jsp._jspService(find_jsp.java:235)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:346)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
Not supporting the google collections probably won't end the world, but they are surprisingly nice to work with.
Could you paste the related part of your JSP, too?