Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4775

Action class Attributes(value stack) is not getting populated through Ajax url request parms

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.5.10
    • Fix Version/s: 2.5.12
    • Component/s: Value Stack
    • Labels:
      None

      Description

      Passing request attributes through Ajax - url is not populating the Action Form Attributes and coming up EMPTY . Instead they are available via request object currently.
      It was working correctly in struts 2.3.16 BUT it is NOT working with Struts 2.5.10 and posing big concern to upgrade to newer version which we want due to security risk.
      To better explain the issue, please check the below snippets. It is big part of our applications code and have a big impacts if we need to move to newer version.
      Below is sniipet of Ajax Method call to Action name:

      function callAjaxGet(value){
      $.ajax( {
      url : "strustSampleActionNameGet",
      type: "GET",
      data : 
      { param : "2"} 
      ,
      success : function(response)
      {alert('success');} 
      ,
      error : function(e)
      {alert('Message on error');} 
      });
      

      ---Action class snippet-----

      public class strustSampleActionClass extends ActionSupport implements SessionAware, ServletRequestAware, ServletResponseAware{
      private String param1;
      
      
      //getter and setter exist
      public string getParam1(){
      ...
      }
      
      public void setParam1(){
      ...
      }
      
      public String execute() throws exception
      { //getParam1 is null // but we can get it through request String parma1req= getRequest().getParameter("param1"); }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nitinperi nitin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: