【问题标题】:how to pass value from jquery to Strut2 Action class如何将值从 jquery 传递到 Struts2 Action 类
【发布时间】:2013-02-24 18:15:14
【问题描述】:

从选择框中选择任何值后,我创建了一个选择框我正在调用已选择值的 jquery 函数,我需要将此值传递给我的 Action 类,我不想使用选择标签因为我需要用struts2学习jquery。

【问题讨论】:

  • 那么,你想要什么?

标签: jquery struts2


【解决方案1】:

我认为你需要这样的东西;只是一个例子:

window.open('http://localhost:8080/PMBM/userdataedit.action?' + sel_id + '&operation=Edit', '_self');

您可以根据自己的方便使用.load()方法。

【讨论】:

    【解决方案2】:
      <script>
    function callMe() {
        $.ajax({
            type : "POST",
            url : "test.action", //this action is fired
            data : {fname='rohit'} //you can pass variable 'fname' with value 'rohit'
                    }).done(function(data) {
    
                       //Ajax response is recevied in "data"
                       //you can put other process on "data"            
    
                     } 
    
    
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2012-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-03
      • 1970-01-01
      • 2013-12-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多