aspose file tools*
The moose likes Servlets and the fly likes Example for working this out. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Example for working this out." Watch "Example for working this out." New topic
Author

Example for working this out.

Cathy Latte
Greenhorn

Joined: Jul 24, 2009
Posts: 3
Hey guys do you have any link that like

for example: The user enter number 1 in the textfield and when onclick right, it will show the number 1 image on another jsp page. And if the user enter number 2, it will show the number 2 image. I placed the images in database.

Is it something to do with like for loop that is embedded inside the jsp or is it using swich case?

Thanks
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
well, since you only want to show one single picture according to what the user entered as a number, there is no need for a for loop ...

you would want sth like that


JDBCSupport - An easy to use, light-weight JDBC framework -
Cathy Latte
Greenhorn

Joined: Jul 24, 2009
Posts: 3


Is this from the datbase?

Thanks!
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
oh, sorry i missed that part ...

in this case, direct the action of the form to a servlet, read the parameter using request.getParameter("number") and lookup your image in the database using JDBC ...

alternatively, you can use the JSTL SQL tag libraries in your jsps, however, usually database calls are considered business logic and hence does not belong in a jsp file.
Cathy Latte
Greenhorn

Joined: Jul 24, 2009
Posts: 3
Is it we have to generate getter and setter and in the servlet page we have to use the getter method to get the image like for example request.getParameter("number") and the user type in 2 the number2 image from database wil display out.


Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Example for working this out.