2017-06-29 27 views
6

我正在使用一些使用Struts html標記而不是標準html標記的傳統Struts 1.x應用程序。我正在嘗試對UI進行現代化,而不進行功能更改。將引導樣式應用於Struts 1.x html標記

例如: 輸入字段是<html:text property="someProperty" styleClass="someCssStyle">

代替<input type="text" class="someCssStyle">

如果我改變,<html:text><input type="text">的屬性綁定場所即在輸入字段中的值不傳遞到的代碼。

如果我嘗試將自舉樣式應用於<html:text>,它不起作用。

如何將Bootstrap樣式應用於傳統struts html標籤?

+1

是的styleClass = 「形式控制」 不working – want2learn

+0

不可以。不適用與相關的圓角邊緣風格至

+0

https://stackoverflow.com/questions/13893498/how-to-use-css-styles-in-struts2-tags – ajc

回答

2

您已將樣式添加到styleClass屬性。

例如:

<html:text property="propName" name="formName" styleClass="form-control"></html:text> 

<html:submit styleClass="btn btn-link">submit</html:submit> 

這裏是在GitHub一個非常基本的樣品的應用程序,示出了該工作: https://github.com/lviviani/sample-struts-bootstrap