Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

The default configuration (struts-default.xml) configures the Dispatcher Result as the default result, which works welll well with JavaServer Pages. Any JSP 1.2+ container can work with Struts 2 JSP tags immediately.

...

Because JSP support occurs through the Dispatcher Result, which is the default result type, you don't need to specify the type attribute when configuration configuring struts.xml:

Code Block
xml
<action name="test" class="com.acme.TestAction">
    <result name="success">test-success.jsp</result>
</action>

...

Code Block
xml
<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
    <title>Hello</title>
</head>
<body>

Hello, <s:property value="name"/>

</body>
</html>

...

The following are ways to obtained obtain Application scope attributes, Session scope attributes, Request scope attributes, Request parameters and framework Context scope parameters:-

...