Skip to content

Document the use of ParameterMappingInterceptor for typical Portlet MVC setup [SPR-3162] #7848

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

1 votes, 4 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions