struts2—from标签中 theme="simple" 用法 .
2011-11-14 11:10
155 查看
view plaincopy to clipboardprint?
<table align="center">
<tr>
<td>
<s:textfield label="%{getText('username')}" name="username" size="20" cssClass="input01" theme="simple"/>
</td>
</tr>
<tr>
<td>
<s:textfield label="%{getText('userpass')}" name="userpass" size="20" cssClass="input01"/>
</td>
</tr>
</table>
这样的话,struts2框架会自动生成label以及一些提示信息,生成的html代码如下:
view plaincopy to clipboardprint?
<table align="center">
<tr>
<td>
<input type="text" name="username" size="20" value="" id="_username" class="input01"/>
</td>
</tr>
<tr>
<td>
<tr>
<td class="tdLabel"><label for="_userpass" class="label">密码:</label></td>
<td>
<input type="text" name="userpass" size="20" value="" id="_userpass" class="input01"/>
</td>
</tr>
</td>
</tr>
</table>
我们会发现有生成许多代价,有些时候还会生成错误提示信息的代码,可我不想要它啊,我想把它放到别的地方去,或者干脆说,我只想用Struts的action处理机制,不想用struts的默认布局,又或者你想做。。。。。。总之就不要默认的,怎么办?
这就涉及到struts2的theme(主题)了,换不同的主题,可以让struts的代码输出不同的html代码,你也就相应得到不同的布局效果,我就是这么理解theme的,并且换theme也非常简单,这样你可以设定N个不同的主题,每五分钟换一个都行啊(你喜欢的话)
问题一:Struts2有哪些主题?
Struts2提供了三种主题,ajax, simple, xhtml,它默认的是xhtml主题,当然你可以写任意个你自己的主题,我们称之为自定义主题
问题二:Struts2怎么改?
比如现在你想用simple主题,在Struts.xml中,加上下一行代码就可以了
<constant name="struts.ui.theme" value="simple" />
或者:在你的struts.propertise内加入以下:
struts.ui.theme=simple
<table align="center">
<tr>
<td>
<s:textfield label="%{getText('username')}" name="username" size="20" cssClass="input01" theme="simple"/>
</td>
</tr>
<tr>
<td>
<s:textfield label="%{getText('userpass')}" name="userpass" size="20" cssClass="input01"/>
</td>
</tr>
</table>
这样的话,struts2框架会自动生成label以及一些提示信息,生成的html代码如下:
view plaincopy to clipboardprint?
<table align="center">
<tr>
<td>
<input type="text" name="username" size="20" value="" id="_username" class="input01"/>
</td>
</tr>
<tr>
<td>
<tr>
<td class="tdLabel"><label for="_userpass" class="label">密码:</label></td>
<td>
<input type="text" name="userpass" size="20" value="" id="_userpass" class="input01"/>
</td>
</tr>
</td>
</tr>
</table>
我们会发现有生成许多代价,有些时候还会生成错误提示信息的代码,可我不想要它啊,我想把它放到别的地方去,或者干脆说,我只想用Struts的action处理机制,不想用struts的默认布局,又或者你想做。。。。。。总之就不要默认的,怎么办?
这就涉及到struts2的theme(主题)了,换不同的主题,可以让struts的代码输出不同的html代码,你也就相应得到不同的布局效果,我就是这么理解theme的,并且换theme也非常简单,这样你可以设定N个不同的主题,每五分钟换一个都行啊(你喜欢的话)
问题一:Struts2有哪些主题?
Struts2提供了三种主题,ajax, simple, xhtml,它默认的是xhtml主题,当然你可以写任意个你自己的主题,我们称之为自定义主题
问题二:Struts2怎么改?
比如现在你想用simple主题,在Struts.xml中,加上下一行代码就可以了
<constant name="struts.ui.theme" value="simple" />
或者:在你的struts.propertise内加入以下:
struts.ui.theme=simple
相关文章推荐
- struts2—from标签中 theme="simple" 用法
- struts2—from标签中 theme="simple" 用法
- <s:form theme="simple">导致标签名显示不出来
- 在struts-2.2.3.1中加入<s:head theme="ajax"/>这个标签,报错
- 在使用struts标签的时候最好加上theme="simple"
- struts2中用ajax标签出错。。一使用<s:head theme="ajax"/>就报错或者标签的时间控件显示不出来
- <s:form action="xx" namespace="xx" theme="simple"
- radio取值,<s:radio name="view[%{#status.index}]" list='#{"同意":"同意","不同意":"不同意"}' theme="simple" />
- struts2 <s:action>标签的用法
- LA-3938-"Ray, Pass me the dishes!" 解题报告
- UVALive 3938 "Ray, Pass me the dishes!"
- HTML中a标签的rel属性使用 link标签的rel="search"用法
- Exception in thread "main" java.sql.SQLException: Connections could not be acquired from the underly
- Spring配置文件标签报错:The prefix "XXX" for element "XXX:XXX" is not bound.
- 解决Unable to locate theme engine in module_path: "pixmap"
- Struts2标签如何实现For循环 像JSTL's <c:forEach begin="..." end="..." ...> 中的用法
- UVA1400 - "Ray, Pass me the dishes!"
- From an inner class, "this" points to the inner object. How do I get a "this" pointer to the enclosing object?
- uva 1400 "Ray, Pass me the dishes!" 线段树
- ubuntu -- Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap"