Bootstrap与Struts 2兼容吗?

时间:2014-10-03 05:24:47

标签: html twitter-bootstrap jsp struts2 struts2-bootstrap-plugin

我正在使用Bootstrap进行UI开发。当我在其中使用Struts 2标签textfield时,完整的页面对齐被破坏。当我用普通标签替换s:(Struts 2标签)标签时,它工作正常。

我是否需要加入任何额外的罐子?

2 个答案:

答案 0 :(得分:2)

Struts 2在渲染JSP页面的输出时使用主题。您可以在Struts 2 Themes中详细了解主题。要更改默认主题,请将其放在struts.xml

<constant name="struts.ui.theme" value="simple"/>

答案 1 :(得分:2)

  

解决方案n.1

使用simple主题并自行编写符合Bootstrap的HTML:

<constant name="struts.ui.theme" value="simple" />
  

解决方案n.2

使用Struts2 Boostrap pluginshowcase)和bootstrap主题,让它自动生成Struts标记符合Bootstrap的HTML:

<constant name="struts.ui.theme" value="bootstrap" />
相关问题