Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable struts 2 Table generation for Form?

Tags:

Struts 2 automatically generate HTML table for it's <s:form> tag. How can I disable it? Any help will be appreciated. Thank You.

like image 992
zawhtut Avatar asked Dec 30 '10 08:12

zawhtut


2 Answers

Struts2 have theme generation functionality based on which it generares either Table based HTMl code for its tags default is x_html which is your case . You can avoid this by setting theme as simple on page level or each tags has theme property which will generate div based html contents

<s:form name="test" theme="simple"> 

or you can set theme for entire page as below static value

<s:set name="theme" value="'simple'" scope="page" /> 

property

<s:set name="theme" value="%{myTheme}" scope="page" /> 

you can set it across entire application by

<constant name="struts.ui.theme" value="simple" /> 
like image 157
Umesh Awasthi Avatar answered Sep 27 '22 19:09

Umesh Awasthi


Just add

<struts>     <constant name="struts.ui.theme" value="simple" />     <package name="default" extends="struts-default"> 

constant name="struts.ui.theme" value="simple" in struts.xml. It wont apply struts default themes.

like image 24
Muthu Avatar answered Sep 27 '22 18:09

Muthu