This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Form for fetching data from database and displaying results on same page

Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a sport database with country, sport, team and match tables. I'm developing a web application in Spring where users could discuss about match results, view statistics and so on.
Well, I'm stuck with head2head statistics. I have two dropdown boxes with teams. User selects host and guest. When he clicks on show, controller should fetch all the matches where the selected teams have played against each other. The results should display on the same page. Unfortunately, this isn't happening.

Here is my code.

Fetch method in HibernateDAO domacin = host, gost = guest


Is this actually possible to achieve on the same page? When I submit the form I get empty table.

Please help.
Posts: 1682
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok my first suggestion is do not use HibernateTemplate this is no longer the accepted pattern. Please see the reference documentation for instructions on the correct way.

Disclaimer - I did not even look at your jsp code.

In you controller you are doing this

You are not assigning it to anything and you are not putting it on the model before returning the view. That is why after posting you most likely have an empty view. All the view is getting after your post is empty lists. Contrast what you are doing in the post to what you have in the get. In one you populate the lists and set them on the model. In the other you just return the view.

God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic