AJAX REQUEST TO SERVER [Sending data to Servlet by AJAX call ]
1. create one web application : example - TestAjax.
To create new Web Application in net beans Perform following Steps
Open Netbeans -> Select File -new - >Java Web Peoject - >Name To the project[ex. TestAjax] - Finish.
2. create one jsp file example :index.jsp and write a code .
download Jquery library and add it in your project.
<head>
<script src="text/javascript">
</script>
</head>
<form id="myform">
name:<input type="text" name="name" id="name">
email :<input type="text" name="email" id="email">
<input type="submit" value="registration" id="button1">
</form>
<script type="text/javascript">
$(document).ready(function(){
$('button1').click(function(e){
var name=$('#name').val();
var email=$('#email').val();
$.ajax({
type:"GET",
url:"reg",
data:"name="+name+ "&email="+email,
success:function(msg){
alert("success");
},
error:function(e){
alert("error);
}
});
});
});
</script>
Create One Servlet [With uRL pattern == reg]
// write following code inside body tag of process Request method.
String name=request.getParameter("name");
String password=request.getparameter("password");
= Call Me Or Whats App - 9561826040 .. If U face any Problem.
To create new Web Application in net beans Perform following Steps
Open Netbeans -> Select File -new - >Java Web Peoject - >Name To the project[ex. TestAjax] - Finish.
2. create one jsp file example :index.jsp and write a code .
download Jquery library and add it in your project.
<head>
<script src="text/javascript">
</script>
</head>
<form id="myform">
name:<input type="text" name="name" id="name">
email :<input type="text" name="email" id="email">
<input type="submit" value="registration" id="button1">
</form>
<script type="text/javascript">
$(document).ready(function(){
$('button1').click(function(e){
var name=$('#name').val();
var email=$('#email').val();
$.ajax({
type:"GET",
url:"reg",
data:"name="+name+ "&email="+email,
success:function(msg){
alert("success");
},
error:function(e){
alert("error);
}
});
});
});
</script>
Create One Servlet [With uRL pattern == reg]
// write following code inside body tag of process Request method.
String name=request.getParameter("name");
String password=request.getparameter("password");
= Call Me Or Whats App - 9561826040 .. If U face any Problem.
Never seen article like this, thanks for the wonderful content.
ReplyDeleteSEO Training in Chennai
JAVA Training in Chennai
Big Data Training in Chennai
Selenium Training in Chennai
German Classes in chennai
DOT NET Training in Chennai
Salesforce Training in Chennai
Salesforce Training in Anna Nagar
"super....!!!
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Nice information.. Hi dear, This is an nice and valuable post thanks for this information! Visit .
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
Useful Information... keep sharing your blog
ReplyDeleteRPA Training in Chennai
RPA Course in Bangalore
Amazing Blog...keep sharing like this
ReplyDeletePython Training in Chennai
Python course in Chennai
Python Classes in Chennai
Python Training in Bangalore
Python Classes in Bangalore
Python Training Institute in Bangalore