Message Boards

Submitting a form in Liferay using Ajax and Spring

Adam Causey, modified 16 Years ago.

Submitting a form in Liferay using Ajax and Spring

Junior Member Posts: 70 Join Date: 6/13/07 Recent Posts
I've followed the tutorial on submitting a form via Ajax in Liferay, but have been unsuccessful so far. The only difference between what I'm doing and the example is that I'm not using struts, so I don't have a struts_action parameter. I'm using spring portlet mvc instead of struts.

I get the following error after pressing the submit button on the form.

Nov 13, 2007 11:31:29 AM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk ignored.
Nov 13, 2007 11:31:29 AM org.apache.tomcat.util.http.Parameters processParameters
WARNING: Parameters: Invalid chunk ignored.


Here is the important code.

<portlet:actionurl var="actionURL" windowState="<%=LiferayWindowState.EXCLUSIVE.toString()%>" />

<c:set var="namespace" scope="page"><portlet:namespace /></c:set>


	${namespace}submitEntry = function(form) {
 		AjaxUtil.submit(form, "${namespace}poll");
}


<div id="${namespace}poll">
<form:form commandname="pollCommand" action="${actionURL}" name="${namespace}pollfm" onsubmit="${namespace}submitEntry(document.${namespace}pollfm); return false;">
						<c:foreach var="c" items="${question.choices}">
							<form:radiobutton path="choiceId" value="${c.choiceId}" />${c.prompt}
								<c:if test="${c.allowUserInput}">
								<form:input path="response" />
							</c:if>
							<br>
						</c:foreach>
						<c:if test="${question.allowComments}">
								Additional Comments:
								<br>
							<form:textarea path="comments" rows="3" cols="30" />
						</c:if>
						<input type="submit" value="Vote!">
					</form:form>
</div>