Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


ben mbarek afef
Gallery Photo
2 Answer(s)      a year and 3 months ago
Posted in : Design concepts & design patterns


I need to display a photo gallery with the path stored in oracle with the possibility of their supprission (photo management) (with jsf or with jsp)


Advertisement
View Answers

May 23, 2013 at 7:16 PM


hi friend,

Do not do such task using JSP, Better option is to use Servlet. It will be better than the JSP.

Thanks



May 24, 2013 at 6:55 PM


hi fried,

Try the following code, may this will be helpful for you

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*, java.awt.image.*, javax.imageio.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Display Data</title>
</head>
<body>
<form action="#">
<table>
<tr>
<td>Enter Image ID </td>
<td><input type="text" name="id"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Register"/></td>
</tr>
</table>
</form>
<%! String driverName = "com.mysql.jdbc.Driver";%>
<%! String url = "jdbc:mysql://localhost:3306/record";%>
<%! String user = "root";%>
<%! String psw = "root";%>
<%
String imgID = request.getParameter("id");
if(imgID != null)
{
    int i = Integer.parseInt(imgID);
Connection con = null;
PreparedStatement ps = null;
File file = null;
InputStream in = null;

try
{
    Class.forName(driverName);
    con = DriverManager.getConnection(url,user,psw);
    String sql = "SELECT * FROM image where img_id="+i;
    ps = con.prepareStatement(sql);
    ResultSet rs = ps.executeQuery();
    while(rs.next())
    {
        byte[] img = rs.getBytes("img_data");
        String location = rs.getString("img_location");
        String name = rs.getString("img_name");     
        /*in = new ByteArrayInputStream(img);
        BufferedImage bImageFromConvert = ImageIO.read(in);
        System.out.println("bImageFromConvert : "+bImageFromConvert);
        */
        file = new File(location+"/"+name);
        response.setContentType("image");
        response.getOutputStream().write(img);
        response.getOutputStream().flush();
        response.getOutputStream().close();
        %>
        <IMG SRC="<%=file %>" WIDTH="200" HEIGHT="50" 
   BORDER="0">
        <%
    }
}   
catch(SQLException sqe)
{   
    out.println(sqe);
}
}
%>
</body>
</html>


Related Tutorials/Questions & Answers:
Gallery Photo
Gallery Photo  I need to display a photo gallery with the path stored in oracle with the possibility of their supprission (photo management) (with jsf or with jsp)   hi friend, Do not do such task using JSP, Better
photo gallery - Java Beginners
photo gallery  Iam uploading images in the serverusing uploading program, now i need to display all the images from the folder and i dont want give the image path.uploading is the continues process and i need to display
Advertisements
Image Gallery
and am having an issue with the image gallery. The goal is to create multiple categories with an image gallery for each. For example,the wedding gallery...="padd-2">our GALLERY </h2> </div> <div class
Image Gallery
and need your guidance. The specific piece of the site is an image gallery... class="padd-2">our GALLERY </h2> </div> <div...="" width="280" height="262"></a> <a href="BIG PHOTO LINK" rel
photo album
photo album  while syncing photos to my photo album in my iphone, the photo albumj ust got crashed i guess. Under photos option i just have the camera roll option now!! What should i do to get the photo album back
photo uploading
photo uploading  i want the code upload the image in oracle database
photo viwer
photo viwer  i need coding for photo viewer using jsp mysql   Please visit the following link: http://www.roseindia.net/jsp/downloadimage.shtml
create dynamic image gallery jquery
create dynamic image gallery jquery  How to create a dynamic image gallery in Jquery
Adding photo to iPhone simulator
Adding photo to iPhone simulator  Hi, there is no photo in my iPhone simulator.. how can i add one? Please suggest. Thanks
upload photo in xcode
upload photo in xcode  how can i upload a photo in a view in xcode? i am a beginner in xcode please help me
save uiimage to photo library
save uiimage to photo library  How to saved the clicked picture on camera roll in iPhone. I always want to write the file into photo library.   Save UIImage to photo library Creating a camera application in iPhone need
Photo upload, Download
Photo upload, Download  Hi I am using NetBeans IDE for developing... am loading photo. BufferedImage image=null; JFileChooser chooser = new...()); } } Here I'll get path of the photo in local machine in variable "path" (I
Upload Photo to Server
Upload Photo to Server  Hi I am using NetBeans IDE for developing... i am loading photo. BufferedImage image=null; JFileChooser chooser...()); } } Here I'll get path of the photo in local machine in variable "path
PHOTO UPLOAD AND DISPLAY - Struts
PHOTO UPLOAD AND DISPLAY  Hi, This is chandra Mohan. I want some help urgently from your side. My problem is I want to upload the photos and display photos usin Struts technology. Please give me some suggestion to me
Upload photo - Java Beginners
Upload photo  Morning, Can you tell me coding how to upload photo. First, i want to browse the photo from my direktory(*.jpg, *.bmp *.gif), then i click this photo and view in my JFrameForm then i have a button to save
Photo Upload - JSP-Servlet
Photo Upload  Dear Sir, I want some help you i.e code for image upload and download using Servle/jsp. Thanks&Regards, VijayaBabu.M  Hi <% //to get the content type information from JSP Request
Slider Gallery plug-in
Slider Gallery plug-in In this section, you will learn to use Slider Gallery plug-in for developing image gallery slider. This shows a demonstration of a slider widget from the jQuery UI library .In this example a image gallery inside
problen in displaying the text and image in gallery using Android
problen in displaying the text and image in gallery using Android   public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); gallery = (Gallery
The National Gallery of Modern Art Delhi
The National Gallery of Modern Art in Delhi One of the top museums for art to visit when in Delhi is the National Gallery of Modern Art. This is a museum.... It is a beautiful museum for people to visit when in Delhi. The National Gallery of Modern
how to upload photo - Java Beginners
have jlabel. i want to view data like photo/picture to jlabel. then i have a button... into database } }); JPanel panel = new JPanel(); JLabel photo...); panel.add(photo); panel.add(browse); panel.add(button); frame.add
View Photo From Db MySql
View Photo From Db MySql  Good Morning Sir, Please help me, I make a small code but i have a error. I want to make viewer photo from database MySql into my project in netbeans. this is my code : try
Image Slide Show using 'Space gallery' plug-in
Image Slide Show using  'Space gallery' plug-in In this tutorial , we will create a slide show using 'Space gallery' plug-in .In this example , two tabs are given. in one tab 'Space gallery' slide show
History of National Gallery of Modern Art Delhi
National Gallery of Modern Art, Delhi India is a country which brings forth... movement, one of them was 'National gallery of Modern Art'. The National gallery of Modern Art was first set up in Delhi, which has collection
How to create and use Facebook Shared Photo Albums?
Video Tutorial - How to create and use Facebook Shared Photo Albums? Facebook Shared Photo Albums is the feature added to the Facebook. It is very user... to use Facebook Shared Photo Albums?. We have also included a video tutorial
iPhone Pick images from Photo Library
iPhone Pick images from Photo Library In this example application we are going to show you how to pick an image from photo library. To choose the photo from the photo library we required to call three different delegates
Flex Image Gallery Slide Show
a versatile photo album, you will have to create your own image gallery... and mesmerizing dynamic photo gallery that will enthrall the viewers...Flex Image Gallery Slide Show Earlier, most of us were fond of storing
YUI Based Lightbox
YUI Based Lightbox       a YUI based image gallery script Read full Description
photoshop : how to make an older photo
How to make an older picture.       In this tutorial we are going to convert a photograph into a old photo, it is not tough now because you have a golden
dewspot
dewspot       The dewspot.com is rich mashup with impressive user interface. It allows to work with video, map, photo and weather forecast. Developers periodicaly add new features. Wishes
php generate link - PHP
php generate link  How can i generate links in PHP for my photo gallery app
How to give tint color effect
How to give tint color effect Give the tint effect to your photo by this example. This effect will apply on the tree picture so follow this tutorial to learn complete. Take a Picture: Take any picture
Open Source Hardware
. It is a freely distributed piece of software for such tasks as photo retouching, image... a photo please consider supporting this site by linking back and giving me attribution for my photos. Feel free to contact me at linux dot photo dot geek at gmail
How to copy an jpeg image from one folder to other folder using jsp
How to copy an jpeg image from one folder to other folder using jsp  hello, i am creating photo gallery where from admin side i allow admin to browse and can select photos for upload..so when admin select photo that photo should
Photoshop - Photoshop Tutorials
; Design Photo Retouch Text effect Animation... the methods to convert blank and white photograph in a color photo... the tint effect to your photo by this example. This effect will apply
java (jquery) - Java Beginners
java (jquery)  i want to combine to things to create a photo gallery.../gallery-light.html and http://finnrudolph.de/ImageFlow/Download eg: http://imageflow.finnrudolph.de/ the thing i want is.... in gallery view( the first
I want Image Album like -orkut and Facebook Using Struts 1.2
in a database. it is neccessary..... I am using a link "Photo Gallery" to show...I want Image Album like -orkut and Facebook Using Struts 1.2  photo gallery Iam uploading images in the serverusing uploading program, now i need
History about National Railway Museum Delhi
of the Indian Railways. The presence of a photo gallery in the air-conditioned indoor... gallery. A toy train is run around the campus for the visitors on a regular... in the vicinity of the museum. Indoor Gallery of National Rail Museum Delhi
Joomla Development India
, Comments and reviews, Picture/photo gallery, Events calendar, Help desk / support
What is Joomla
communities. Some of these are: Form Builder, Document Management services, Photo and streaming video gallery, E-Commerce facility and Shopping cart (webstore
Best Social Media Tools
, Tiny Pics, SnapFish, Photo Bucket and Kodakk Gallery etc. Video Sharing..., Friendster, MySpace, Netlog, and Zoopa etc. Photo Sharing Websites: Photo... is on photo uploading, downloading and sharing, nothing else. Some of the most
JavaScript navigate method
by using the method navigate like the photo gallery and many more which
GimpTutorials
it to a gallery, with your name and web address or without, if you want. ...; How to Use Gimp for Photo and Image Cropping and scaling (resizing... the most basic elements of photo editing. In this hands-on tutorial, you will learn
Open Source PHP
ready .     Open-source photo gallery PHP Script Plogger is the next generation in open-source photo gallery systems. A web application... with the world. Plogger is your photos integrated into your website, a fully featured photo
web designing - Design concepts & design patterns
web designing  Hello sir, I want to make a Photo rotetor in my website project. Sony.com and Dell.com , these are the websites that have the photo rotetor in their main web page. please see these webs and send me the code
Accessing Web-cam
Accessing Web-cam  I am giving options to upload a photo to the user.. options are: 1st) upload a photo from ur hard drive. 2nd) upload a photo from web-cam. Then how to implement 2nd option using jsp ....can any one
How display a image on servlet from file upload - JSP-Servlet
on submit button. It download on desktop when I open this file through windows Photo Gallery.A message show Photo Gallery can't display the picture because
how to upload and download images in java?
how to upload and download images in java?  what is the code for uploading and downloading images in java? how do I make a photo gallery through JSP? I want to create a photo gallery for each user which can be viewed by all users
 

 

 

DMCA.com