<welcome-file-list>。。。不能直接把struts的Action作为欢迎文件,以下是在欢迎文件中调用struts action。
在struts-config.xml配置文件中添加如下一段代码
<global-forwards>
<forward name="welcome" path="HelloWorld.do"/>
</global-forwards>
在welcome.jsp页面中添加如下一段代码:
<body>
<logic:forward name="welcome"/>
</body>
在web.xml页面中添加如下一段代码:
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
分享到:
相关推荐
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> <!-- 默认找的...
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> 把servlet-name等的servlet改为filter就变成了过滤器了。 说明:要继承HttpServlet类 一、 ①处可以随便取一个名字,但一般是和...
<filter-name>struts-cleanup</filter-name> <filter-class> org.apache.struts2.dispatcher.ActionContextCleanUp </filter-class> </filter> <filter-mapping> <filter-name>struts-cleanup</filter-name> ...
<welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- 配置核心拦截器 --> <filter> <filter-name>struts2</filter-name> <!-- Filter的实现类 struts2.5 --&...
接触新版本出了问题后,解决了把jar文件...<package name="default" namespace="/" extends="struts-default"> <action name="helloworld"> <result> /helloWorld.jsp </result> </action> </package> </struts>
<filter-name>struts-cleanup</filter-name> <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> filter> <filter> <filter-name>sitemesh</filter-name> <filter-class>...
logging-1.0.4.jar<br>commons-validator-1.3.1.jar<br>jstl-1.0.2.jar<br>oro-2.0.8.jar<br>standard-1.0.2.jar<br>struts-core-1.3.8.jar<br>struts-el-1.3.8.jar<br>struts-extras-1.3.8.jar<br>struts-faces-...
<servlet-class>org.apache.struts2.views.freemarker.FreemarkerServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>freemarker</servlet-name> <url-pattern>*.ftl</url-pattern> </...
<include file="struts-default.xml"></include> <constant name="struts.i18n.encoding" value="GBK"></constant> <!--设置临时上传目录--> <constant name="struts.multipart.saveDir" value="d:\"></constant> ...
<?xml version=”1.0” encoding=”ISO-8859-1”?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" ...</struts-config>
<taglib-uri>/tags/struts-bean</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/tags/struts-logic</taglib-uri> <taglib-location>/...
<filter-name>struts2</filter-name> <!-- 过滤器的名字 --> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> <!-- 引用个具体类文件 --> </...
spring3.2+strut2+hibernate4 注解方式。<struts> spring.xml <beans xmlns="http://www.springframework.org/schema/beans" ... ... <include file="/resource/struts-user.xml"></include>
<include file="struts-default.xml"></include> <!-- package提供了将多个Action组织为一个模块的方式 package的名字必须是唯一的 package可以扩展 当一个package扩展自 另一个package时该package会在本身...
前几天搞 Spring + Hibernate + Struts 事务配置 ,网上找了好多资料,不过好无语,大多都是 Ctrl + V,浪费俺的宝贵时间 现在我总结配出一套,给大家参考参考,可能有不足,请大家多多交流。 附:内有弹出...
-- 定义包管理配置的action 继承struts-default.xml中的配置 --> <package name="actions" extends="struts-default"> <!-- 定义Action(login.action) --> <action name="login" class="mypack.UserAction"> <!...
<include file="struts-default.xml"/> </struts> 然后在新建一个内容为空的struts.properties文件。 至此项目搭建完毕,然后将其发布。 3、发布项目 在myeclipse里面可以嵌入tomcat,配置外部tomcat然后将项目...
<description>struts2初始配置文件</description> <param-name>config</param-name> <param-value>conf/struts/struts.xml</param-value> </init-param> </filter> <filter-mapping> <filter-name>...
<struts-config> <form-beans> <form-bean name="LoginForm" type="com.yza.struts.form.LoginForm"></form-bean> </form-beans> <global-exceptions /> <global-forwards /> <action-mappings> <action ...
<package name="struts2" extends="struts-default"> <!-- 用于处理上传文件的ACTION --> <action name="uploadUtil" class="com.struts.action.UploadUtilAction" method="uploadFile" /> <!-- 用于展示所有...