• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem while developing my spring application... (urgent!)

Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a very strange issue while developing my spring application,

I am posting the code snippets from my application for better understanding of the problem. Following are the relevant files which are in use:
controller.java which extends simpleformcontroller

Here is the code in the servlet-action.xml:

<bean id="gameValidator" class="com.lbadmin.validator.ManageGameValidator"></bean>
<bean id="manageGameController" class="com.lbadmin.web.ManageGameController">
<property name="failedView"><value>fail</value></property>
<property name="commandClass"><value>com.lbadmin.model.Game</value></property>
<property name="commandName"><value>gamemanage</value></property>
<property name="gameservice"><ref bean="gameService"/></property>
<property name="validator"><ref bean="gameValidator"/></property>

(Here the thing to notice is that i have not included the formview property as i am using customized form view)

The code in the controller looks like this:

protected BindException bindObject(HttpServletRequest request,
Object command, Validator validator) throws Exception {
ServletRequestDataBinder binder = createBinder(request, command);
BindException errors = new BindException(command,
System.out.println("commandname=" + getCommandName());
if (validator.supports(command.getClass())) {
ValidationUtils.invokeValidator(validator, command, errors);
return errors;

protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception {
// TODO Auto-generated method stub
Map model = new HashMap();
if (request.getSession().getAttribute("userName") != null) {
String operation = RequestUtils.getStringParameter(request,
"operation", "");
if (operation.equals("showgames")) {
} else if (operation.equals("addgame")) {

return handleAddGame(request, response, model, errors);

} else if (operation.equals("editgame")) {
handleEditGame(request, response, model);
} else if (operation.equals("deletegame")) {
handleDeleteGame(request, response, model);

return new ModelAndView(getViewName(), "model",model);

protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object obj, BindException errors)
throws Exception {

Map model = new HashMap();
if (request.getSession().getAttribute("userName") != null) {
String operation = RequestUtils.getStringParameter(request,
"operation", "");
if (operation.equals("submitGameDetails")) {

handleSaveGame(response, model, obj);

return new ModelAndView(getViewName(), "model", model);

As you can see in the above code we are using the bindobject() and the show form() methods.

Now the code in the jsp will look like this:

<td width="173">
<b class="UserName">Top Scores To Show</b></td>
<td width="296" align="left">

<spring:bind path="gamemanage.topscore">
<input name="topscore" type="text" class="smallTextBox" size="30" maxlength="3" width="50"
value="<c ut value="${status.value}"/>"/>
<c:if test="${status.error}">
<span id="<c ut value="${status.expression}"/>Error" class="error">
<c ut value="${status.errorMessage}"/>


Here topscore is the property i am trying to bind and validate...

however when the above application is run i am getting the following exception:

javax.servlet.ServletException: Neither Errors instance nor plain target object for bean name 'gamemanage' available as request attribute

I think i am missing somthing here?? can someone please help.... i am really stuck up....
thanks in advance
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Map model = new HashMap();
return new ModelAndView(getViewName(), "model", model);

Do you put anything in your map or is it still empty when you get to the jsp?

    Bookmark Topic Watch Topic
  • New Topic