Refreshing page/data values on data change in a JSP.

Posted on 2006-05-15
Last Modified: 2010-04-01

I've got a JSP that retrieves data using JDBC.  I want the options presented in select boxes to change depending what has previously been selected.  I.e. the selections for the 2nd input are generated by a sql query containing the 1st input.   Is this possible?    Some sample code would be great.

I tried a web search, is it anthing to do with AJAX?  Sounds a bit complicated to me.


Question by:IanWood
    LVL 11

    Accepted Solution


    following are the options for you

    1) use plain javascript and populate the js arrays with the dependent dropdown entries

    2) use server side roundtrip, following linke may help (without struts)

    3) use server side roundtrip, following linke may help (with struts)
    have action class handle the server round trip based on parameter and provide the content of dependent drop down boxes to view

    4) if u wish to use AJAX and with struts

    Author Comment

    The server side round trip has done the trick.  Cheers.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now