Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MV Porlet ActionMapping is not working
    primarykey
    data
    text
    <p>I have a simple login form with a controller in Spring MVC Portlet framework. Form looks like this</p> <pre><code>&lt;portlet:actionURL var="loginAction"&gt; &lt;portlet:param name="action" value="login" /&gt; &lt;/portlet:actionURL&gt; &lt;div class="portlet-section-body"&gt; &lt;form:form name="loginForm" method="post" action="${loginAction}" commandName="loginForm" &gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt;&lt;span class="portlet-form-field-label"&gt;Username: &lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;form:input class="portlet-form-input-filed" path="login" /&gt;&lt;/td&gt; &lt;td&gt;&lt;form:errors path="login" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;span class="portlet-form-field-label"&gt;Password: &lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;form:input class="portlet-form-input-filed" path="password" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input class="portlet-form-button" type="submit" value="Login"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form:form&gt; &lt;/div&gt; </code></pre> <p>and the controller </p> <pre><code>@Controller @RequestMapping(value="VIEW") public class LoginController { @RenderMapping("render=showBookListPage") public String showBookListPage() { return "bookList"; } @ActionMapping(params="action=login") public void loginUser(ActionResponse response) { response.setRenderParameter("render", "showBookListPage"); } @ModelAttribute("loginForm") public LoginForm getLoginForm() { return new LoginForm(); } } </code></pre> <p>And the problem is - when I submit the form, I get redirected to page <code>/bookShop-1.0/portal/classic/showcase/somePortalGeneratedString</code> which is wrong because my portlet is on <code>localhost:8080/portal/classic/showcase</code> URL so I get 404 error. <code>&lt;portlet:renderURL&gt;</code> tag and mapping is working correctly but I can't simply get this form working. </p> <p>My environment is: JBoss JPP 6.0 (based on GateIn 3.5), Spring 3.2.1 and Portlet 2.0</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload