Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Struts 2 property tag

In the Hello World tutorial's example application on JSP HelloWorld.jsp was this code:

...

The most common use of the property tag is used to "get" the value returned by calling a public get method (of the Action class) and then to include that value in the HTML returned to the browser.

As discussed in the Hello World tutorial, the value of "messageStore.message" instructs Struts 2 to first call method getMessageStore of the Action class. That method call returns a MessageStore object. The ".message" part instructs Struts 2 to call the getMessage method of the MessageStore object. The getMessage method returns a String which will be included in the HTML returned to the browser.

...