Is it possible to call a method in Java by button onclick in JSP?
For example:
Java:
@UrlBinding("/Student/import.action")
public class StudentAction implements ActionBean {
public void testMe() {
//do something
}
}
JSP
<stripes:form beanclass="com.example.action.StudentAction">
<input type="button" value="Test" onClick="call testMe"/>
</stripes:form>
I read some posts on Internet that it could be done by Ajax/jQuery, but I couldn't understand how they do it. I just know itshould be something like this:
$.ajax({
type:"POST"
url:
})
or
$(document).ready(function() {
$("#button").click(function(){
})
})
is there any other way to do this, and if no, I would appreciate a simple explanation of how to do it with Ajax/JQuery.
Note: I don't want to use submit input or stripes:submit!