jsp页面获取struts2后台的值

xiaoxiao2021-02-28  139

业务需求:页面加载时设置“需求发起”查询文本框地为当前用户所属区部。

jsp页面代码:

 

<input class="easyui-textbox" value = "${defaultCode}">

jsp页面利用${}获取后台的defaultCode变量的值。后台只需要在加载页面时取得该值并定义get方法。

 

 

private String defaultCode; @Action(value = "index", results = { @Result(name = "success",type = "dispatcher", location = "../../../../line/subline_list.jsp") }) public String index() { defaultCode = getCurrentDefaultZoneCode(); Department department = departmentService.getDepartment(defaultCode); if(department!=null){ defaultCode = department.getAreaCode(); } return SUCCESS; } public String getDefaultCode() { return defaultCode; }

 

 

 

 

 

 

 

 

 

转载请注明原文地址: https://www.6miu.com/read-31458.html

最新回复(0)