首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

s:param用法,该怎么处理

2012-05-22 
s:param用法在jsp页面是s:action namecreateMenuRoot idcreateMenuRoots:param nameflag valu

s:param用法
在jsp页面是<s:action name="createMenuRoot" id="createMenuRoot">
  <s:param name="flag" value="'0'"></s:param>
  <s:param name="roleCode" value="'s001'"></s:param>
  </s:action> 

在action中String flag = ServletActionContext.getRequest().getAttribute("flag").toString();
String ss= ServletActionContext.getRequest().getAttribute("roleCode").toString();
却获取不到roleCode参数的值,怎么才能获取2个参数值,在线等!

[解决办法]
在createMenuRoot请求对应的Action中定义flag和roleCode变量并有get/set方法,框架会自动传过去。

热点排行