Hi guys,
First off hello! I've been a fan of these forums for a while and I thought today I will finally join the community!
And what better introduction than to ask for your expertise!
Bit of background, I've been coding
Java as.. I would say early-intermediate and I'm doing what I can do read up further on design
patterns, structuring but I've recently moved to web development with Java on a
Tomcat 7 server and I'm a little bit out my depth.
So I've taken over a web application which is pretty big but I'm going to focus on a small segment here.
I have a
JSP page called View.jsp which is half scriptlet which gathers information about a person from a database then displays the data in table.
So we have:
Now I don't like so much Java logic being placed directly in the JSP.. It should belong in a
servlet but it's functional so fine.
My problem is: It's my task to create 4 new buttons that provide functionality (Create new subordinate, delete, etc) which, as it's been left have the link:
"
These jsp files are purely Java! So I really want to move to a servlet but they're passed JSP variables.
I thought about turning the table into a form and using these buttons to POST to the servlet but <%= %> JSP variables are filled in dynamically and I cannot post them.
I came across a method of creating input fields which are hidden in order to post that data.. But I was hoping something.. cleaner.
The trouble is I can't change too much (especially the View.jsp) because it'll snowball and before I know it i'll have to change half the application.
Can anyone guide me to a way I can create the functionality for the 4 buttons which post to a servlet rather than a JSP page?
I hope I've explained myself clearly enough.
Thanks guys,
Mike