Results 1 to 2 of 2

Thread: Multiple submit sources delegated to only one method

  1. #1
    Join Date
    Jan 2005
    Posts
    7

    Default Multiple submit sources delegated to only one method

    Hi! I'm working with JSP / JSTL, and I have a form that has multiple submit sources, i. e. 4 submit buttons and one dropdown that submits the form.
    The form is submitted to a method of a Spring MultiActionController, and what I want to do is discover what is the source of the request, WITHOUT using request.getParameter("name")... I think I was told not to do that... Is there a more ellegant way to do this?? Thanks in advance!!!

  2. #2
    Join Date
    Nov 2004
    Location
    Minneapolis, MN
    Posts
    19

    Default Why not...

    Why not have each button submit to different methods then call the common method they all need to eventually access?

    Code:
    void submit() {
    // do some code here that's common to all submit methods.
    }
    
    void submitA() {
    // log something
    submit();
    }
    
    void submitB() {
    // log something
    submit();
    }
    
    etc...
    Object Partners, Inc.
    Minneapolis, MN

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. PerformanceMonitorInterceptor
    By tnist in forum AOP
    Replies: 3
    Last Post: Aug 24th, 2005, 01:39 PM
  5. Replies: 1
    Last Post: Jul 28th, 2005, 05:08 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
  •