File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Dynamic select without scripts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Dynamic select without scripts" Watch "Dynamic select without scripts" New topic

Dynamic select without scripts

Alfred Thomas

Joined: Apr 05, 2006
Posts: 9
Hi All

I need to write a JSP with two dynamic SELECT's. The first one is easy to populate using JSTL (This select contains a list of class names). The second select(containing method names read using reflection) must be populated when the first select changes. I am trying to move away from using scripts in my JSP's and I am trying to figure out how to do it without scripts.
I have a control servlet used to persist data posted from the JSP, and I think the solution might be to let the first select's onChange send a request to the servlet to make it update itself using maybe a redirect.
Can anyone please tell me what I should be doing, because Im in the dark...

pawank gupta
Ranch Hand

Joined: Jun 07, 2006
Posts: 34
if u send ur request to any servlet it takes too much time to execute and also complex too. u can right the same code in ur jsp too only u want to do is submit ur form to same jsp and on the basis of request parameter run the particular part of code r one more thing u can do define a method inside ur jsp and call it when u submit ur request thourgh script
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
AJAX is your best bet.
I agree. Here's the link:
subject: Dynamic select without scripts
It's not a secret anymore!