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!

Daniel Jebb

Greenhorn
+ Follow
since Apr 03, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Jebb

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
1 week ago
JSP
I am just learning how to write jsp pages to create a java web app. I have created a page that displays data from a DB in a table. One of the columns displays a number. I want to add a button next to this number which when clicked will increment the value in the DB by one.

Is there a simple way to implement this? I know I can't call a java method directly from the HTML button. I am displaying the data from the database as below,



The section for hcp reduction will have a + button and a reset button. The + button should add 1 to the value in the DB and the reset will return the value back to 0.

Many thanks
2 months ago
JSP