Results 1 to 3 of 3

Thread: Problem with SimpleFormController

  1. #1

    Default Problem with SimpleFormController

    Hi,
    I am using a controller with SimpleFormController as base class and I am getting an exception the first time I go to the page :
    javax.servlet.ServletException: Could not find Errors instance for bean [MyBean] in request: add the Errors model to your ModelAndView via errors.getModel()
    here is the method I implemented in my controller :
    Code:
        protected void doSubmitAction(Object command) throws Exception {
            log.info(command);
        }
    and here is the jsp view :
    Code:
          	<spring&#58;bind path="MyBean.text">
            	<input type="text" name="$&#123;status.expression&#125;">
           	</spring&#58;bind>
    Any idea ?

  2. #2
    Join Date
    Aug 2004
    Location
    Mount Joy, PA
    Posts
    34

    Default

    Try this if MyBean is the command object:

    Code:
    <spring&#58;bind path="command.text">
      <input type="text" name="$&#123;status.expression&#125;">
    </spring&#58;bind>
    or this if your command object has a "myBean" property (e.g. getMyBean):

    Code:
    <spring&#58;bind path="command.myBean.text">
      <input type="text" name="$&#123;status.expression&#125;">
    </spring&#58;bind>
    I am assuming that you have not changed the default commandName of your controller. If you have changed it, substitute "command" in the above examples with your custom commandName.

    Also note that if you want the text box to be initialized with the value of the "text" property you will need to do this:

    Code:
    <input type="text" name="$&#123;status.expression&#125;" value="$&#123;status.value&#125;">
    ~ Daniel Miller

  3. #3

    Default

    thanks a lot. It worked !

Similar Threads

  1. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  2. pagination and continuation problem in SWF
    By yfmoan in forum Web Flow
    Replies: 6
    Last Post: Jun 29th, 2005, 03:42 AM
  3. Replies: 0
    Last Post: Feb 16th, 2005, 01:45 PM
  4. Oracle Jdbc invalid url problem
    By jfuchs in forum Data
    Replies: 5
    Last Post: Nov 1st, 2004, 11:33 AM
  5. Lazy Load Problem when Doing UnitTest
    By yoshi in forum Data
    Replies: 7
    Last Post: Sep 29th, 2004, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •