Can I able to access method as action in Struts 2 with Codebehind plugin? Since there is no struts.xml
file and its works as action!method
in the URL.
Just I'm wondering to access a method
How to use Struts tag on class?
"@Action(name="action"), <s:url action="action" method="method" />
Class :
@Action(name = "JSONexample")
@Result(name="success",type=JSONResult.class,value="",params={"root","List"})
public class PartAction extends ActionSupport {
public String JSONexample{
-----
return SUCCESS;
}
public String readxml { }
}
if I access below method on submit button click , will I get the JSON data?
$.getJSON('ajax/sayHi.action', formInput,function(data)
So i can access action in URL as
localhost:7001/Sample/JSONmethod.action
to get the JSON data ?