论坛首页 入门讨论版 Struts

STRUTS2.0下的include问题

浏览 846 次
该帖已经被评为新手帖
作者 正文
时间:2007-08-11
A.FTL是调用ACTION返回的结果页面,在A.FTL中,include了B.FTL页面。为什么在B.FTL页面中,${session}不能解释。仍然作为一个字符串显示。

web.xml配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<web-app >
<display-name>jaee</display-name>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

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

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

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


<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.ac</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.ftl</url-pattern>
</filter-mapping>
<taglib>
<taglib-uri>/s</taglib-uri>
<taglib-location>/WEB-INF/struts-tags.tld</taglib-location>
</taglib>
</web-app>
   
时间:2008-06-09
${session} 改成 大写 ${Session}试试
   
0 请登录后投票
论坛首页 入门讨论版 Struts

跳转论坛:
JavaEye推荐