I'm starting to learn
jsp and
servlet technology and I thought a good way was, apart from studying books (actually I'm using Murach and Budi Kurniawan ones), practice with some code.
This also to take some breaks from the last steps in OCPJP exam preparation which actually is giving me hard times.
Well, I decided to try to develop a web application related to some job requirements. The Company I work for has recently given the employees the possibility to work from home a couple of days per week.
My
unit is managing such planning and approvals with excel files, so I thought it could have been a good opportunity to start with something real.
Some high level features the application will have in this very first step:
1 login form
2 insert new user planning (planning requests can be submitted until wednesday on the current week and cover the next two weeks)
3 manager approval/reject of user requests (approvals/reject can be done from thursday to friday of the current week related to the planning for the upcoming two weeks)
4 overall view of all users requests
What I've achieved so far is:
1) done (with a special attention for security related aspects, not because the application manages sensitive data, but because information security is the other great field of interest for me)
2) done (still need to let the server-side validates some stuff that that for the moment I've done with javascript - i.e. cannot plan if it's past wednesday, cannot submit request if no checkboxes are checked, etc)
3) partially done: I've a working jsp which displays a dynamic table of the requests made by all users in the current week retrieving data from a servlet.
4) done
What I'm thinking of at the moment is the best/proper way to manage approvals/requests.
I attach here an image of the page displaying all users requests to the manager for his evaluation. Don't focus on the form layout as it's just a draft and a lot of stuff need to be adjusted.
How can I dispatch to different handlers based on the button? Assuming that having one servlet is the right approach...
I thought I could make something like:
But then how I could differentiate on the servlet side the processing?
I thought something like:
using a switch case statement for catching all different button names. But I'm not convinced at all with this approach.
Could you kindly give me some hints/suggestions on how to proceed?
I'm sorry if this sounds like a dumb question but as stated before I'm just starting to learn these technologies.
As a final note let me say I'll use this
thread for any further question/issue I'll encounter as the project will move forward.
Thank you very much to everyone.
Marco