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.