|
|
Spring portlet MVC and exception handling
mons.logging.impl.Log4JLogger - Servlet.service() for servlet ViewRendererServlet threw exception
java.lang.IllegalStateException: Neither Errors instance nor plain target object for bean name 'form' available as request attribute at org..web.servlet.support.BindStatus .lt;initgt;(BindStatus.java:137) at org..web.servlet.tags.form.Abstract DataBoundFormElementTag.getBindStatus(AbstractData BoundFormElementTag.java:157) at org..web.servlet.tags.form.Abstract HtmlElementTag.resolveCssClass(AbstractHtmlElement Tag.java:502)
...
My question is: how can I avoid getting this exception and how do I map my exception handler to this form view that depends on a backing object being part of the request?
Thanks,
Anthony
I forgot to mention that my jsp uses a spring tag library to bind the form in the view.
lt;%@ taglib prefix=quot;formquot; uri=quot;tags/formquot; %gt;
lt;form:form method=quot;postquot; commandName=quot;formquot; action=quot;${formAction}quot;gt;
you miss the form which is the command name you define in the form tag. you need to add object with the name form in your ModelAndView in your controller class.
mav.add(quot;formquot;,object);
return mav; |
|