Results 1 to 3 of 3

Thread: Binding the "submit" field

Hybrid View

  1. #1

    Default Binding the "submit" field

    I have a simple form with two buttons that submit the form. (using <input type="submit" value="button text"/>) Although the form handling should be the same regardless, I want to be able to respond differently depending on which button is pressed. How is the best way to access the "submit" value? I tried accessing it in request.getAttribute("submit"), to no avail. Should I bind it to a field in my Command? If so, how? Thanks very much for your help.

  2. #2
    Join Date
    Aug 2004
    Location
    Netherlands
    Posts
    8

    Default

    <input type="submit" name="explode" value="Boom!" /> :evil:

    request.getParameter("explode")

  3. #3
    Join Date
    Oct 2004
    Location
    London, UK
    Posts
    71

    Default

    check out this post

    http://forum.springframework.org/showthread.php?t=11086

    it describes some code that can be found
    http://lostinlondon.blogs.com/lil_te...ontroller.java
    and
    http://lostinlondon.blogs.com/lil_te...eResolver.java

    Like a basic form handler but it allows you to have different submission methods in the form handler depending on which submit button was pressed, the SubmitParameterPropertiesMethodNameResolver resolves a method name base on the name of the submit button pressed.
    Last edited by robyn; May 19th, 2006 at 05:38 AM.
    Stuart Eccles
    Technical Consultant

Similar Threads

  1. Replies: 7
    Last Post: Sep 13th, 2005, 01:45 AM
  2. Replies: 4
    Last Post: Jun 14th, 2005, 09:28 PM
  3. Stop validation if binding fails.
    By sherihan in forum Web
    Replies: 0
    Last Post: Feb 8th, 2005, 03:18 AM
  4. Binding Numeric ID Field
    By Aaron in forum Web
    Replies: 2
    Last Post: Sep 13th, 2004, 04:10 PM
  5. Replies: 2
    Last Post: Aug 17th, 2004, 04:16 PM

Posting Permissions

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