Announcement Announcement Module
Collapse
No announcement yet.
Form Controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form Controller

    Hi,
    I have a question in the onSubmit method of the UserFormController of the myusers application of equinox.

    What does the following code mean?
    What is its function?
    request.getSession().setAttribute("message",
    getMessageSourceAccessor().getMessage("user.saved" ,
    new Object[] {user.getFirstName +
    ' ' + user.getLastName()}));

    Thanks in Advance.
    Sherihan.

  • #2
    Hi,

    it adds a message - Something like "User -name- has been saved succesfully" (in suitable localization according your resource bundles)

    -RB-

    Comment


    • #3
      Hi,
      Thanks for your reply.
      But would u plz give me more details about the arguments it takes and where does it add this message.
      Thanks.
      Sherihan.

      Comment


      • #4
        request.getSession(). // get session scope

        setAttribute("message", // store attribute message to this scope

        getMessageSourceAccessor(). // get acessor to ResourceBundle (WEB-INF/classes/ApplicationResources_en.properties)

        getMessage("user.saved", // from ResourceBundle get message defined as user.saved=User {0} has been saved

        new Object[] {user.getFirstName +' ' + user.getLastName()})); // add argument - will be inserted in {0}

        Comment


        • #5
          Thanks a lot.

          Comment

          Working...
          X