Description
Jonathan van Alteren opened SPR-3162 and commented
I'm evaluating Portlet MVC for use in WebSphere Portal 5.1 JSR-168 portlets.
I have created a simple form controller that processes a very simple command class. I have configured it to use a validator and I have set the 'formView' and 'successView' properties. Furthermore, I have configured an internal resource view resolver in a separate applicationContext.xml file.
I am able to navigate the portlet to get to the form, so I guess the formView works for that part. If I enter faulty data in my form I can see in the logs that validation errors occur. However, I am returned to the 'home' view (which is where I started from) instead of going back the formView. I need to be able to show the errors to the user and allow him to resubmit the form (as you would expect).
Am I doing something wrong here? I looked at the code in SimpleFormController (in the ...web.portlet.mvc package) and unlike the non-portlet variety, it does not call showForm(..) (see below).
I can't find anything about this in the docs. Please help!
----------- excerpt from org.springframework.web.portlet.mvc.SimpleFormController.java:
...
protected void processFormSubmission(
ActionRequest request, ActionResponse response, Object command, BindException errors)
throws Exception {
if (errors.hasErrors()) {
if (logger.isDebugEnabled()) {
logger.debug("Data binding errors: " + errors.getErrorCount());
}
if (isRedirectAction()) {
setFormSubmit(response);
}
passRenderParameters(request, response);
}
else if (isFormChangeRequest(request)) {
...
Affects: 2.0.2
Attachments:
- applicationContext.xml (902 bytes)
- selfcare-portlet.xml (1.95 kB)
1 votes, 4 watchers