日期:2014-05-17 浏览次数:20692 次
在struts2如果使用了:disabled="true"那么后台传值传不过去,需要<s:hidden name="属性名"/>注:不是value,而是name
自定义标签也是:
???StringBuilder str = new StringBuilder();
???UserService userService = new UserService();
???Long value = (Long) stack.findValue(name);
???str.append("<select name=\"" + name + "\" id=\"" + name + "\"");
???if (disabled != null) {
????str.append(" disabled=\"" + disabled + "\"");
???}
???if (onchange != null) {
????str.append(" onchange=\"" + onchange + "\"");
???}
???if (style != null) {
????str.append(" style=\"" + style + "\"");
???}
???……
上面也提示了,onchange怎么写,style怎么写:
自定义标签在jsp页面的用法:
? <user:userShow name="user" project="curProject" onchange="this.form.submit()" style="background-color:#C4C4C4"?/>
?其实,跟html的用法一样