I'm beginner to java and i read a lot of article about posting data into java class , using Servlet ,or on click method. (read this article)
MY CODE
<form action="test/login" method="post" role="form">
<input type="text" class="form-control" name="username" id="username" placeholder="username" autocomplete="off" />
<input type="password" class="form-control" name="password" id="password" placeholder="password" autocomplete="off" />
<input type="submit" name="btnLogin" value="Login" />
</form>
JAVA CLASS
public class test{
public function login(username,password){
//do something.
}
}
but any better way to call .java class method after form submission?
is it possible? or the only way is Servlet ?
Servlet vs Ajax call, which act better?