您的位置:首页 > 其它

<s:textfield>标签的tr问题

2012-08-24 15:17 495 查看
在用s:textfield标签显示action中返回的值,用name属性即可。但是如果放在table中的td的话,就会出现一个问题。自动换行,在页面上看起来就是占了一个tr上下距离比较高。这个原因是标签定义的时候就定义成这样了。看看怎么定义的:

查看struts.properties或$ {struts-core-2.06.jar}/org/apache/struts2/default.properties文件,其中有如下配置:
struts.ui.theme=xhtml
struts.ui.templateDir=template
struts.ui.templateSuffix=ftl


修改成这样

struts.ui.theme=simple
struts.ui.templateDir=template
struts.ui.templateSuffix=ftl


这样修改的话能解决问题,但是要修改jar包总是不好的,建议用下面的方式修改:

在struts.xml文件中加入下面的代码即可;

<constant name="struts.ui.theme" value="simple" />
<constant name="struts.ui.templateDir" value="template" />
<constant name="struts.ui.templateSuffix" value="ftl" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: