Results 1 to 2 of 2

Thread: Process a submit with a Model object without using a form?

  1. #1
    Join Date
    Dec 2005
    Posts
    14

    Default Binding parameters from a post without using a form

    Let me explain a little bit more. My current code uses the following where my command object binds based on param names

    Code:
    protected ModelAndView handle(HttpServletRequest request, HttpServletResponse response,
    			Object command, BindException errors) throws Exception 
    {
    
    MyModelObject object  = (MyModelObject) command;
    
    }


    I have an external system that builds a URL and invokes my webapp where i use it to query a database to display a list of details on a webpage.

    The URL is: /icp/ca?ca=1234&ucrn1=3333&ucrn2=7777&ucrnN....

    This maps to a MyModelObject object which is just a plain bean (using command objects as above). What Im looking for is something like

    Code:
    @RequestMapping(method = RequestMethod.POST)
    public String processSubmit(@ModelAttribute MyModelObject  modelObject.......) 
    {
         // process
    }

    I am not using a form for submission. Do I have to write a custom editor? Apologies if I'm being a bit dim, I've got pet-clinic checked out so maybe missed something there that would help.


    Regards

    Stackie.
    Last edited by stackie; Jan 22nd, 2010 at 10:04 AM. Reason: rephrased

  2. #2
    Join Date
    Aug 2008
    Posts
    105

    Default

    Sorry, maybe I did not understood you properly..
    What you need to ensure is that the external system which is opening the URL is able to POST your page containing the command object...
    Bye

Posting Permissions

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