程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> struts2.0-struts2前台獲取數據問題

struts2.0-struts2前台獲取數據問題

編輯:編程綜合問答
struts2前台獲取數據問題

想不明白為什麼前台接收不到值啊。。
action:

 public String pylShow() throws Exception{
        getMonitorObj = getModel();  
        getMonitorObj = pylmonitormanager.pylgetmoninfo(getMonitorObj.getIdMon());
             return SUCCESS;
    }

struts.xml

 <action name="pylShow" class="PylAction" method="pylShow">
          <result name="success">/cold/pylshow.jsp</result>
          </action>

jsp:

 <input  name="test" id="test" value="<s:property value="getMonitorObj.idMon" />"/>

這個input標簽接收不到值。。求大神指教!

最佳回答:


用看看值棧中有沒有getMonitorObj,沒有的話在execute()中加上下面語句試試。
ActionContext ctx = ActionContext.getContext();
ctx.put("getMonitorObj",getMonitorObj);

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved