• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

getting data from mysql without clicking on search button

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

in this we got the mid from allmeters.jsp,when clicking on hyperlink in allmeters.java that value is displayed in demo.jsp,in this we have a search button and with out clicking on button it is retrieving data from mysql database and displaying,so i want to retreive data from mysql after clicking on search button please explain me in detail
 
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keep your mid in your search form (the one with search button) using <input type="hidden" >
In your Demo.jsp, add a condition to see if request is come from Demo.jsp itself. (maybe check for the search button?). If request is not from search button, then do not connection to db. Instead, display a blank page with search form.

In Demo.jsp again, you have to set action of search form to itself. maybe <form action="" I'm not sure


By the way, MVC concept is highly recommended for web application development
Putting both logic, view , even connection to DB in jsp is quite unsophisticated.


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic