-1

I am trying to call an action class by AJAX with a parameter, but I can't find the right way.

I am using the following syntax from struts 2, without AJAX :

<s:url action="painel.visualizarErro.action" namespace="/errosView.jsp" var="id" />
window.location = '<s:property value="id" />?jobId=' + jobId;

The problem is I cannot pass <s:property value="id" />?jobId=' + jobId by AJAX

Sahil Patel
  • 1,570
  • 2
  • 15
  • 34
Ederson JR
  • 59
  • 1
  • 9

1 Answers1

0
$.ajax(contextPath,{
  type:'POST',
  data:{ 'actionToPerform': methodName,
         'param1': param1,
         'param2': param2
       },

  success: function(response){
  },
  error : function(response){
  }
  });