Struts2中s标签自动排版问题
在struts2中很多标签默认都会加入table tr td属性,导致排版的时候看起来换了一行
其原因便是s标签的配置文件中加入了默认样式导致的
查看查看struts.properties,或在核心标签库中,查找
/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
或者,在stuts.xml中添加如下配置便可
<constant name="struts.ui.theme" value="simple" />
<constant name="struts.ui.templateDir" value="template" />
<constant name="struts.ui.templateSuffix" value="ftl" />
保存之后刷新便好了
本文介绍了解决Struts2中S标签自动排版问题的方法,通过修改配置文件中的主题设置,避免了默认样式导致的排版换行现象。
1865

被折叠的 条评论
为什么被折叠?



