Results 1 to 2 of 2

Thread: there is a question to ask . "spring mvc"

  1. #1
    Join Date
    Aug 2004
    Posts
    1

    Default there is a question to ask . "spring mvc"

    There is a question to ask when i write an program of web application baseing springmvc.
    the founction Onsubmit of the class Acontroller return new ModelAndView(new RedirectView("bController.do"),mymodel);
    and some objects were put into mymodel,Would you tell me how to get the value of mymodel from bController??????

  2. #2
    Join Date
    Aug 2004
    Location
    Paderborn, Germany
    Posts
    24

    Default

    Hi,
    because you use a redirect instead of a forward, all request attributes in your
    mymodel Map are encoded in the URL. (key=value pairs).

    You can retrieve them with request.getParameter("key") in your controller.
    If you don't want to encode everything in the URL or if you want to ship complex classes like your JavaBeans you can save them in the session in controller a and retrieve them back in controller b.

    If redirection is not a must, you can of course forward the request from controller a to b. I think InternalResourceView is capable of forwarding requests between controllers.

    HTH, Chris

Similar Threads

  1. Forgot password (e.g. secret question) using Acegi
    By lowerymb77 in forum Security
    Replies: 1
    Last Post: Oct 16th, 2005, 10:46 PM
  2. HttpInvoker / Serialization question
    By ZeddMaxim in forum JMS
    Replies: 1
    Last Post: Apr 20th, 2005, 05:37 PM
  3. Need Help - Question regarding PetClinic Example
    By spring04 in forum Architecture
    Replies: 6
    Last Post: Nov 17th, 2004, 12:59 AM
  4. Replies: 6
    Last Post: Oct 8th, 2004, 02:21 PM
  5. Design question, c3p0 and more..
    By kantorn in forum Data
    Replies: 4
    Last Post: Oct 7th, 2004, 08:20 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
  •