Struts 2 Tips

s:text處理Null

<s:text name=”myObject.name”/>→如果myObject.name為null, 預設會顯示成”myObject.name”

<s:text name=”myObject.name”>空值</s:text>→此時就會顯示”空值”字眼

s:textfield不自動產生label及input組合

<s:textfield theme=”simple” name=”myObject.name”/>

※預設theme為xhtml會自動產生label及input的組合

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s