This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I have a table with the fields id, name and the content(of the file saved as blob in the database). I want to retrieve them in jsp page and show just id and name in a tabular form.(which i am able to do).
Afetr displaying the values, the I should be able to see the full content when I clicks on the name that has been displayed in the table.
I am attaching the code below.
I want the file to be opened when i click on the below name.
JSP is intended for dynamic display purposes and including business logic/application logic is not in conformance with MVC specifications. You ought to move the database manipulation code to a Servlet/Action class.
1. From the Action/Servlet instance obtain the Connection, fetch the relevant data and pass it in a suitable Collection class to the JSP.
2. In the JSP iterate through the Collection obtained from above and display the data as required.
Joined: Jun 29, 2011
Thanks for the reply. i haven't followed MVC since i just want to check it. Once i get the solution, I would follow MVC.
What you told is for just displaying the values in jsp from database. What i want to do is something different. Please go thrugh my previous post once again.
I have id, name and conetent fields. I can display id and name (in table) in jsp by having a servlet(action) and DAO(java class). When i click on any of the name displayed, i want its content(i.e the file) to be shown.