In my Struts2 web application, I have the following files:
member.jsp
:
<script type="text/javascript">
String str1 = "aaa";
String str2 = "bbb";
xmlhttp.open("GET", "http://localhost:8080/project/editprofile.action", true);
xmlhttp.send(null);
</script>
struts.xml
:
<action name="editprofile" method="editProfile" class="controller.ControllerSln">
<result name="success" type="stream">
<param name="contentType">text/html</param>
<param name="inputName">inputStream</param>
</result>
</action>
ControllerSln.java
:
public String editProfile() throws UnsupportedEncodingException {
return SUCCESS;
}
I am looking for a way to use Ajax to send the strings "aaa" and "bbb" to the
controller.ControllerSln#editProfile()
method. Can anyone assist with accomplishing this task?