FREEMARKER&&STRUTS2 基础问题

同时使用FREEMARKER和STRUTS2的时候,WEB.XML该怎么配啊??? 除了STRUTS2的过滤器得配置之外还有什么要配的??

WEB.XML 正常配置

[code="xml"]

<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<filter>
    <filter-name>struts</filter-name>
    <filter-class>
        org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
</filter>

<filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

[/code]

对于struts.xml的配置时,只需要简单的修改result type请看

[code="xml"]

    <action name="list" method="execute" class="testAction">
        <result name="success" type="freemarker">pages/list.ftl</result>
        <result name="input" type="freemarker">pages/input.ftl</result>
    </action>

[/code]

很容易吧。