Results 1 to 3 of 3

Thread: adding parameters to a RedirectView...

  1. #1
    Join Date
    Aug 2004
    Posts
    11

    Default adding parameters to a RedirectView...

    I have a controller that extends SimpleFormController. It's onSubmit method currently returns the following value:

    Code:
    return new ModelAndView(new RedirectView(this.getSuccessView()));
    How would I go about adding a parameter (from the onSubmit method) to the resulting URL?

    My current success view is: doSomething.html

    I need it do be: doSomething.html?myParam=somethingDynamic

    A (hackish) way to do it would be:

    Code:
    String view = this.getSucccessView() + "?myParam=" + myParam;
    return new RedirectView(view);
    I'm wondering if there's a better way...

    Thanks,
    Brian Kuhn

  2. #2
    Join Date
    Dec 2004
    Posts
    12

    Default Re: adding parameters to a RedirectView...

    Brian,

    Given:

    protected void appendQueryProperties(StringBuffer targetUrl,
    Map model,
    String encodingScheme)
    throws UnsupportedEncodingException

    on RedirectView try this:
    Code:
    Map model = new HashMap();
        model.put("param1", "value1");
        ...
        return new ModelAndView(new RedirectView(getSuccessView()), model);
    hope this helps.

    ATTA

    Quote Originally Posted by briankuhn
    I have a controller that extends SimpleFormController. It's onSubmit method currently returns the following value:

    Code:
    return new ModelAndView(new RedirectView(this.getSuccessView()));
    How would I go about adding a parameter (from the onSubmit method) to the resulting URL?

    My current success view is: doSomething.html

    I need it do be: doSomething.html?myParam=somethingDynamic

    A (hackish) way to do it would be:

    Code:
    String view = this.getSucccessView() + "?myParam=" + myParam;
    return new RedirectView(view);
    I'm wondering if there's a better way...

    Thanks,
    Brian Kuhn

  3. #3
    Join Date
    Aug 2004
    Posts
    11

    Default that worked...

    Thanks ATTA. That worked...

Similar Threads

  1. RedirectView - Supporting collections
    By AndersEngstrom in forum Web
    Replies: 3
    Last Post: Sep 20th, 2005, 04:57 AM
  2. stale Oracle processes
    By compostellas in forum Data
    Replies: 7
    Last Post: Jun 27th, 2005, 12:14 PM
  3. Redirectview parameters
    By avspring in forum Web
    Replies: 1
    Last Post: Jun 15th, 2005, 05:17 AM
  4. Replies: 8
    Last Post: Dec 7th, 2004, 06:13 PM
  5. Replies: 2
    Last Post: Sep 5th, 2004, 10:49 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
  •