5

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

我需要包括任何额外的罐子吗?

4

2 回答 2

2

解决方案 n.1

使用simple主题并自己编写与 Bootstrap 兼容的 HTML:

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

解决方案 n.2

使用Struts2 Boostrap 插件( showcase ) 和bootstrap主题,让它从 Struts 标签自动生成与 Bootstrap 兼容的 HTML:

<constant name="struts.ui.theme" value="bootstrap" />
于 2014-10-03T10:11:18.280 回答
2

Struts 2 在呈现 JSP 页面的输出时使用主题。您可以在Struts 2 Themes中阅读有关主题的更多信息。要更改默认主题,请将其放入struts.xml

<constant name="struts.ui.theme" value="simple"/>
于 2014-10-03T08:46:24.103 回答