doubt in jsp

hai , iam new to jsp . I Encounterd a problem

My problem is i have one form,where i retrive the values in to one combox box from database.User can select from the combobox,based on his selection, i have to retrieve data from database and has to display in the textbox in the same form.The previous values in the form should be retained

[348 byte] By [arunkumarsimhadria] at [2007-9-24]
# 1
Eww. Good luck dealing with a JavaScript/database bridge and whatnot. Whether it's a JSP or not doesn't matter at all in this case, it could as well be static HTML.
# 2
A framework like Struts or JSF makes code like that cleaner to write.
DrLaszloJamfa at 2007-7-15 > top of java,Java Essentials,Java Programming...
# 3
You might want to have a look at [url= http://java.sun.com/developer/technicalArticles/J2EE/AJAX/index.html]AJAX[/url]...
yawmarka at 2007-7-15 > top of java,Java Essentials,Java Programming...
# 4
You could use JavaScript without updating the DOM or you could use AJAX or you could redisplay the page.Why not try some stuff out to see which works best for you.
filestreama at 2007-7-15 > top of java,Java Essentials,Java Programming...
# 5
Or that guy could actually use an applet.
# 6

Use Struts and JSP to do that.

Send the value of the combo box inside the struts. Do your work with the database (use EJB's or direct connection) then remeber to send as attributes or parameters back the value of the text field and of the combo box. With a little bit of JSP you should be able to set the selected element in the combo box, and the text inside the text field.

sim085a at 2007-7-15 > top of java,Java Essentials,Java Programming...
# 7

> Use Struts and JSP to do that.

>

> Send the value of the combo box inside the struts.

> Do your work with the database (use EJB's or direct

> t connection) then remeber to send as attributes or

> parameters back the value of the text field and of

> the combo box. With a little bit of JSP you should

> be able to set the selected element in the combo box,

> and the text inside the text field.

Am I mistaken, or wouldn't that require a page refresh? Which I thought the OP didn't want. Sorry, I don't know Struts, but so far it sounds to me like something a mere servlet/JSP combo could do as well.

# 8

Yes in how I said it you would definitly need a page refresh! (Sorry I did not get that point from the OP ... tought he just wanted to keep the combo box value :$

Once i read about doing callbacks if that is what the user wants. However I only did them in ASP.net and not JSP. So I don't know much else about the subject!

sim085a at 2007-7-15 > top of java,Java Essentials,Java Programming...