I have a struts 1 application.
A user without an account comes in and I redirect them to a page to set up their account. The user came in with some parameters on the URL.
enter.do?sys=foo
The account creation page has a form with an iteration in it that uses the name sys.
public void setSys(Domain d, int i)
{...}
the result is is a stack dump as the framework tries to set foo into the bean.
java.lang.reflect.InvocationTargetException: Cannot set sys
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1025)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:242)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:216)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:132)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:352)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
at com.aaron.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:179)
How can I work around this name conflict? I could rename one of the fields, but I have still leave myself open for other name conflicts.
I ended up renaming the field to avoid the name conflict. If someone comes up with a different way please go ahead and post it.