读书人

struts2 使用记录

发布时间: 2012-09-12 09:21:30 作者: rapoo

struts2 应用记录

?

1.从url中获取一个参数为itemType的值再与一个数值做比较,明明返回的应该是true,但返回的确是false,问题就出现在参数的类型上,转换正确的类型问题解决。

<s:if test="(@java.lang.Integer@parseInt(#request.parameters.itemType))==4"> 

?

?

?

2.首页面不支持action跳转,在WebRoot目录中加入一个与action同名的文件即可解决问题。

?

<welcome-file-list>    <welcome-file>/indexshow</welcome-file></welcome-file-list>

?

?? ?或者使用一个静态页面来执行action,index.

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

?

?? ? index.html部分代码:

?

<meta http-equiv='refresh'  content='0;url=index.action'> 
?

?

?

?

读书人网 >软件架构设计

热点推荐