Solved

Ajax with jsp and servlet

Posted on 2009-04-10
4
1,673 Views
Last Modified: 2013-11-24
Hi,

I have a jsp which as customer names in a select box. Now when a customer selects any of the customer names, his app details will be populated in another box using his cust id. Now in the first select box i have customer name, so how do i fetch records from mysql in servlet using the customer name. is it that first i need to fetch customer id based on selection and then populate the app id. Also i want to know how to tell ajax that this is the customer i have selected.
0
Comment
Question by:SunScreenCert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 19

Assisted Solution

by:Kuldeepchaturvedi
Kuldeepchaturvedi earned 60 total points
ID: 24121871
that shd be fairly easy...

put a javascript on your select box 'onSelect' event..

from this java script make an AJAX call to another jsp which will accept the Customer id ( you will pass it by appending to the url like ...yourjsp.jsp?id=custid...


in the jsp make the connection to the mysql database, get the required values from dbase and then send the details back to your calling jsp..

get the data and show it on HTML...

get some skeleton code along these lines and experts here will help you get it working.
0
 
LVL 11

Assisted Solution

by:Manish
Manish earned 120 total points
ID: 24137055
0
 
LVL 11

Assisted Solution

by:Manish
Manish earned 120 total points
ID: 24137066
If ajax is not there, how your going to send this information,
same way u can send using ajax.
0
 
LVL 12

Accepted Solution

by:
Gibu George earned 70 total points
ID: 24137556
http://www.ics.uci.edu/~cs122b/projects/project5/AJAX-JSPExample.html

This is a simple ajax jsp example go through it. Step #5 shows the serverside code, this you need to change according to your needs.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
windows explorer path to command prompt 5 59
How to position loader with CSS 3 64
jboss 7.1 start up error 1 63
jmss example java 2 33
Today I am discussing AJAX problems in IE7 and I bet this will helps many guys out here who have problems with AJAX work. Lets start with the discovery of problem and then we will talk about its different solutions. My last two projects included …
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question