This week's book giveaway is in the Spring forum.
We're giving away four copies of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 and have Marten Deinum & Iuliana Cosmina on-line!
See this thread for details.
Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Himai Minh

Allowing a user to enter an event by clicking a button

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am pretty new to using JSP. I am making a Java web app and going well so far but I am a little stuck with how to proceed.

I have a MySQL DB that contains tables for events, users and a composite table for entrants into events which contains both the eventid and userid.

I have written the code to display the event details as well as the people who are entered into the event in the evententrants table... I am struggling though with how to write the code to allow a user to enter an event. My plan was to have a button on the panel that shows the event details, its layout is as per the attached image.

I want a button underneath the info: field to say enter which the user can press (when logged in) it will then enter them into the event and update the SQL table with their userid and the eventid.

When a user logs in, their userid is saved in the User so can be accessed with a getter method. The eventid is stored when the page loads with this code,

I have used the event_id here in another sql query so that the panels only show participants in the current event.

I am now stuck though.

My plan was to make the button in a form, then when the uses presses the button it submits the form and collects their userid, and also the eventid but I am not sure how I should get the eventid.

Could anyone help with the best way to get the eventid so that when I submit the form, I can update the table with the eventid and userid.

Many thanks
[Thumbnail for panel-pic.PNG]
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic