Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Boostrap compatible with Struts 2?

I am using Bootstrap for my UI development. When I use Struts 2 tags for textfield in it, the complete page alignment is destroyed. When I replace the s: (Struts 2 tags) tags with normal tags, it is working fine.

Do I need to include any extra jar?

like image 969
AJE Avatar asked Sep 30 '22 17:09

AJE


2 Answers

Solution n.1:

Use the simple theme and write the Bootstrap-compliant HTML on your own:

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

Solution n.2:

Use the Struts2 Boostrap plugin (showcase) and the bootstrap theme and let it automatically generate the Bootstrap-compliant HTML from Struts tags:

<constant name="struts.ui.theme" value="bootstrap" />
like image 70
Andrea Ligios Avatar answered Oct 06 '22 13:10

Andrea Ligios


Struts 2 uses themes while rendering output of the JSP page. You can read more about themes in Struts 2 Themes. To change a default theme put this in the struts.xml

<constant name="struts.ui.theme" value="simple"/>
like image 2
Roman C Avatar answered Oct 06 '22 13:10

Roman C