Fórum

jsp parameters dont send to the controller in spring portlet 4.0.2

thumbnail
babak naddaf, modificado 10 Anos atrás.

jsp parameters dont send to the controller in spring portlet 4.0.2

New Member Postagens: 23 Data de Entrada: 06/07/11 Postagens Recentes
Hi every one

I have written a simple Spring4.0.2 portlet including one jsp page (which sends two simple text parameters to the controller) every thing is okey the the jsp correctly jump to the right actionMapping method but the sent parameters(two textboxes) are null. The controller and jsp are as follow :

controller:

@ActionMapping(params = "action=formSetValuesAction")

public void simpleActionMethod(ActionRequest actionRequest, ActionResponse actionResponse) {


String firstName = actionRequest.getParameter("firstname");

String lastName = actionRequest.getParameter("lastname");

System.out.println("Here your user first name: "+firstName);

System.out.println("Here your user first name: "+lastName);

}

Jsp :

<%@ page import="java.text.Format" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Set" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
<%@include file="./include.jsp"%>
<portlet:defineObjects />



<portlet:actionURL var="formSetValuesURL">
<portlet:param name="action" value="formSetValuesAction"></portlet:param>
</portlet:actionURL>

<form action="${formSetValuesURL}" method="post">
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
<input type="submit" value="Submit"/>
</form>

can any one help me to solve this problem,?
http://stackoverflow.com/questions/22268535/spring-4-0-2-portlet-mvc
thumbnail
Harish Kumar, modificado 10 Anos atrás.

RE: jsp parameters dont send to the controller in spring portlet 4.0.2

Expert Postagens: 483 Data de Entrada: 31/07/10 Postagens Recentes
Liferay version ??

If you using Liferay 6.2, then you have to set the following property in liferay-portlet.xml file

<requires-namespaced-parameters>false</requires-namespaced-parameters>
thumbnail
Muhammed Shafeek V, modificado 10 Anos atrás.

RE: jsp parameters dont send to the controller in spring portlet 4.0.2

Regular Member Postagens: 140 Data de Entrada: 22/07/13 Postagens Recentes
Thank you Harish.
I too have facing the same problem. but it resolved your answeremoticon

Shafeek
thumbnail
babak naddaf, modificado 9 Anos atrás.

RE: jsp parameters dont send to the controller in spring portlet 4.0.2

New Member Postagens: 23 Data de Entrada: 06/07/11 Postagens Recentes
Thanks Harish