I am trying to make a login page in java J2EE. Actually, I succed in making a jsp page, called login.jsp
, an ActionSupport class called LoginAction
. In my jsp I've created some text area, password area and submit, allowing me to send informations entered in those areas and get them in my action. This works fine.
My problem is that I don't succed in using another function than execute
. In my action I have several other functions and I can't call them in my ajax function :
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script>
$(function() {
$('#submit').click(function() {
var login=$("#login").val();
var password=$("#password").val();
$.ajax({
type: 'POST',
url: 'login.action/test', // -> here it fails.............
data: { login: login, password: password },
success: function() {
alert('YEAH'); },
error: function() {
alert('Request failed'); }
});
});
});
</script>
What should I put in url
area, if I want for example to call test
function in my LoginAction class? (I've done a test.jsp
page, it doesn't change anything...)