This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SuccessView isn't set

 
abhi jitnag
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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;
document.forms[0].submit();
}


In Controller

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

In dispatcher-servlet.xml

<bean name="/applicationContextTest.html" class="com.app.controller.ApplicationContextTest">
<property name="employeeService" ref="employeeService"></property>
</bean>

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">
<tr>
<td align="right" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td align="left" valign="middle"> </td>
</tr>
<tr>
<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" />
</td>
</tr>..........................

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(SimpleFormController.java:423)....................


Could anyone please suggest.



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic