This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Spring and the fly likes SuccessView isn't set Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "SuccessView isn Watch "SuccessView isn New topic

SuccessView isn't set

abhi jitnag

Joined: Oct 17, 2010
Posts: 13
Hi all,
I am facing a problem when trying to return value from formBackingObject

In Js

function callSearch(){
var empName=document.getElementById("empName").value;
document.forms[0].action = "applicationContextTest.html?empName="+empName;

In Controller

protected Object formBackingObject(HttpServletRequest request){
String empName = request.getParameter("empName");
NewEmployeeCmd employee = new NewEmployeeCmd();
return employee;

In dispatcher-servlet.xml

<bean name="/applicationContextTest.html" class="">
<property name="employeeService" ref="employeeService"></property>

In jsp
<form:form method="post" commandName="employee" action="${FORM_ACTION_PATH}">
<fieldset><legend>${LABEL_NAME} Employee Details</legend>
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="2">
<td align="right" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td align="left" valign="middle"> </td>
<td width="35%" align="right" valign="middle">Employee Name</td>
<td width="5%" align="center" valign="middle"> </td>
<td width="60%" align="left" valign="middle">
<form:hidden path="employeeId" /> <form:input id="empName" path="employeeName" size="35" />

The control is coming to Controller properly but when returning ,it is giving following exception.
22-Apr-2011 21:49:23 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet dispatcher threw exception
javax.servlet.ServletException: successView isn't set
at org.springframework.web.servlet.mvc.SimpleFormController.onSubmit(

Could anyone please suggest.

I agree. Here's the link:
subject: SuccessView isn't set
It's not a secret anymore!