I am using struts2_json plugin, I trigger an action to a java method but the whole class including all unnecessary method are invoked. some method need parameters, while invoke unnecessary method those parameters are catched as null pointer exception and parse error. How can I trigger each java method by an action without seperate method in each class( I mean that I don't want to be one method in one class). pls....
<action name="getProduct" class="com.ual.action.ProductAction" method="allProduct">
<result type="json" />
</action>
$.getJSON("getProduct",function(data){
// callback operation here
});
All action name you created must not be started 'get', cause it can confuse getter and setter of that class required for output ..... that means all getter and setter method must be invoked before any action method is operated.
<action name="requestProduct" class="com.ual.action.ProductAction" method="allProduct">
<result type="json" />
</action>
$.getJSON("requestProduct",function(data){
// callback operation here
});