JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > WebWork > JSP
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  JSP
Added by 黑灵, last edited by scud on Mar 16, 2006  (view change)
Labels: 
(None)

Webwork中的JSP支持非常简单:缺省的webwork-default.xmlDispatcher Result作为默认的result(参见Result Types).这意味着任何JSP 1.2+ 容器可以直接支持Webwork.

快速上手

因为JSP支持通过默认的result Dispatcher Result触发,在配置xwork.xml时你不需要显式声明type属性:

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

test-success.jsp 中:

<%@ taglib prefix="ww" uri="webwork" %>

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

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

</body>
</html>

这里 name 是你的action中的一个属性.这样就可以了!

Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators