• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Call a static method from JSP

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to populate a two level drop down list by calling a static method from my JSP. Presently i can't figure out how to get hold of the first. Here's the JSP code



The DBConnector static method:


Do i need to mention the useBean tag and do i need to import any classes in my jsp. Hope for a quick response. Thanks.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to import all classes which you are using in your jsp and if these classes don't belong to java.lang package.
 
Shridhar Raghavan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya thanks. That worked. Now wanted to populate the second drop down. Looked around and i learnt that i need AJAX for that. Can someone help me with that? As in what would go in the javascript function and what classes need to be setup on the server and does the gui need to join. Or point to an appropriate resource.



That is the present code. The list gets populated. Now i need to populate another drop down baseed on selected project. What do i need in the "getIterations" funcation
 
Shrivastava Amit
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are allowed to use javascript library then pick one of the available libraries (jquery, protoype etc). I personally prefer jquery as it has great api. You can find many example for using jquery ajax with java. Have a look at Jquery with Java web app
 
machines help you to do more, but experience less. Experience this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic