Results 1 to 3 of 3

Thread: Not able to retrive form object in FormAction

  1. #1
    Join Date
    Sep 2005
    Location
    Pune, India
    Posts
    7

    Default Not able to retrive form object in FormAction

    Hi All,

    I am not able to retrive form object in FormAction.

    I have tried following two ways, but not succedded. Credentials is my form object class.

    1. Credentials credentials = (Credentials)getFormObject(requestContext);
    2. Credentials credentials = (Credentials) requestContext.getExternalContext().getSessionMap( ).get(objectKey);

    Your kind guidence will be appriciated

    regards,
    Bakul.

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Has the formObject been setup by calling setupForm on your FormAction? See sellitem or phonebook samples for an example.

    Keith
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Sep 2005
    Location
    Pune, India
    Posts
    7

    Default

    Hi Keith,

    I want to load formObject from jsp form.

    currently I am going on this way,

    protected Object loadFormObject(RequestContext requestContext) throws Exception {
    HttpServletRequest request = getRequest(requestContext);
    String userName = request.getParameter("username"); //working fine
    String password = request.getParameter("password");
    Credentials credentials = new Credentials();
    credentials.setPassword(password);
    credentials.setUsername(userName);

    return credentials;
    }

    where getRequest(Rc) is my own method, that returns HttpServletRequest.

    So, is there any way that spring web flow takes care of loading formObject, as we have in spring MVC and struts.

    If yes, can you suggest the way or some example.

    Expecting your quick reply.

    regards,
    Bakul.

Posting Permissions

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