Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7897811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:15:51+00:00 2026-06-03T08:15:51+00:00

I am using 3.1.1 here. This works fine, the form is dislayed correctly @RequestMapping(value={/universities},

  • 0

I am using 3.1.1 here.

This works fine, the form is dislayed correctly

@RequestMapping(value={"/universities"}, params="new", method=RequestMethod.GET)
public String addUniversity(Model model) {
    model.addAttribute("addForm", AddForm.newUniversity());
    return "page/add-university";
}

When testing the validation error (by emptying the fields), this results in 500 internal server error, and displays stacktraces with the main message :
Neither BindingResult nor plain target object for bean name ‘addForm’ available as request attribute

This is the method :

@RequestMapping(value={"/universities"}, method=RequestMethod.POST)
public String submitNewUniversity(@Valid AddForm form, BindingResult binding) {
    if (binding.hasErrors()) {
        return "page/add-university";
    }

    // do others here ...
}

Here is my JSP :

<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="t" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" 
    session="false" %>

<s:url var="action" value="/universities" />
<sf:form method="POST" modelAttribute="addForm" action="${action}">         
   <fieldset> 
   <table cellspacing="0">
      <tr>
         <th><sf:label path="name">University:</sf:label></th>
         <td><sf:input path="name" size="30" /> <br/>
             <sf:errors path="name" cssClass="error" />
         </td>
      </tr>
      .....
</sf:form>

So far what i’ve researched are these :

  • The bean name is correct, which is “addForm”, both in the controller and the JSP tile.
  • The view exists, since displaying the form works fine.
  • The field names in the JSP are also correct, since displaying the form works fine.
  • The order of parameters are fine, BindingResult follows the command bean
  • I am sure that the submitNewUniversity is called by the output of the logs i added

I wonder what i did wrong here ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:15:52+00:00Added an answer on June 3, 2026 at 8:15 am

    Found it !

    I changed from

    @Valid AddForm form
    

    to

    @Valid @ModelAttribute("addForm") AddForm form
    

    Although this works fine, i tried removing the annotation and changing the form name to be the same variable name as the request attribute :

    @Valid AddForm addForm
    

    and this still throws the same error.

    I guess i’ll just have to stick with @ModelAttribute from now on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the test page I'm using. This version works fine, forwarding to #success: <!DOCTYPE
I am having a spacing issue with CSS when using Firefox. This works fine
Here in this html i need to get the image name arrow_down using jquery
This question is an extension to the one raised here: Using factory_girl in Rails
I am attempting to follow along to this tut: HERE but using a sprite
There are a lot of posts on here about this, I'm using this code
Im using Doctrine and i dont quite understand this code here: $this->hasColumn('id', 'integer', 8,
i am developing parser using bison...in my grammar i am getting this error Here
Just using this as an example... Here are the columns in my UserProfile table:
I am using this code taken from here : import smtplib def prompt(prompt): return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.