JSP Passing Class to another JSP
Posted on 2005-04-11
Example 2 jsp programs.
JSP1.jsp contains information about Products. All data is stored in the Products Object.
My html screen looks like below:. I have the Products in a ArrayList and I display it on screen as follows:
I have this listed in a table with an Edit button. I want to call another jsp program to display the detail information
about each product. How do I pass the Product object to the other JSP? I am able to pass individual fields and I also can
pass the address of the Product Object. The problem is
request.getParameter("edtButton") returns a string and not an object. HELP. Also the Input TYpe="Submit"
how do i change the label of the button from using the VALUE. Value is used as a paramter, so I not sure how to change the label.
Program making the call
out.println("<TD VALIGN=" + '"' + "TOP" + '"' + "><h5><INPUT TYPE=" + '"' + "submit" + '"' + " name=" + '"' + "edtButton" + '"' + " VALUE=" + '"' + Product + '"' + "</h5></td>");
Program being called
Product Description Price
Edit Tire Auto Tire 50.00
Edit Mirror Rear View Mirror 25.00
Edit Muffler Exhaust 125.00