Home Answers Viewqa Struts I want Image Album like -orkut and Facebook Using Struts 1.2

 
 


Ranvijay
I want Image Album like -orkut and Facebook Using Struts 1.2
1 Answer(s)      a year and 10 months ago
Posted in : Struts

photo gallery Iam uploading images in the serverusing uploading program, now i need to display all the images from the folder and i want to display it on JSP. like facebook and orkut did.. Please suggest me....

How to store the link of a image in a database. it is neccessary..... I am using a link "Photo Gallery" to show the image.

Pls reply ASAP...

View Answers

July 26, 2011 at 12:46 PM


1)images.jsp:

<%@ page import="java.sql.*,java.io.*,java.util.*" %> 
<HTML>
 <table border="1">

   <%
  try{      
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");
    Statement stmt=con.createStatement();
    String strQuery = "select * from image";
    ResultSet rs = stmt.executeQuery(strQuery);
    while(rs.next()){
       %>
      <tr>
       <td>
      <img src="image.jsp?imgid=<%=rs.getInt(1)%>" width="50" height="50">
</td>
      </tr>
      <%
    }
    rs.close();
    con.close();
    stmt.close();
  }
  catch(Exception e)
  {
    e.getMessage();
  }
  %>
 </table>
</HTML>

2)image.jsp:

<%@ page import="java.sql.*,java.io.*,java.util.*" %> 
<%
  int id =  Integer.parseInt(request.getParameter("imgid"));
  try{      
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","root");      
    Statement st=con.createStatement();
    String strQuery = "select images from image where id="+id;
    ResultSet rs = st.executeQuery(strQuery);

    String imgLen="";
    if(rs.next()){
      imgLen = rs.getString(1);
       }  
    rs = st.executeQuery(strQuery);
    if(rs.next()){
      int len = imgLen.length();
      byte [] rb = new byte[len];
      InputStream readImg = rs.getBinaryStream(1);
      int index=readImg.read(rb, 0, len);  
      st.close();
      response.reset();
      response.getOutputStream().write(rb,0,len); 
      response.getOutputStream().flush();        
    }
  }
  catch (Exception e){
    e.printStackTrace();
  }
%>









Related Pages:
Image Album
Image Album  hi, i want to save image on server folder. and i want to save URL of this folder and name of image in database.on click of a link... in database. how can i do this please suggest me.. I am using Struts 1.2...Thanks
i want image upload and download useing STRUTS 1.2 version example..
i want image upload and download useing STRUTS 1.2 version example..  i am fresher of the developer..i want code for above title topic(i want image upload and download useing STRUTS 1.2 version example..)..plz send me code for my
how can create album in java by using Stack ....
how can create album in java by using Stack ....  hi all , if i press push button put the image to the stack , and when i press pop button remove the image ..??? please help me please
i want to save image on server folder. and i want to save URL of this folder and name of image in database
i want to save image on server folder. and i want to save URL of this folder and name of image in database  hi i want to save image on server folder. and i want to save URL of this folder and name of image in database.on click
dynamicaly change URL in struts 1.2
dynamicaly change URL in struts 1.2  I need to change the url dynamically on particular button click. for example:-http://www.roseindia.net/answers... of sign like "=" have to show forward slash
Help me to create a sharing text just like facebook using jsp servlet and oracle
Help me to create a sharing text just like facebook using jsp servlet and oracle   I tried to use lot of methods but i couldn't get the proper method... thing is that i want to pass a value to servlet without refreshing the whole jsp
Changing from Struts 1.2 to Struts 2.0 in Application
latest version of struts 2.0. I want to know following things 1.what...Changing from Struts 1.2 to Struts 2.0 in Application  Hi All, We have a financial application which is running successfully on struts 1.2 and java
How can i use Facebook connect button
How can i use Facebook connect button  Please to meet you all guys I wonder how can i use this Connect to facebook for me to post in a particular... to facebook" feature like this site do http://www.barkadafm.net/ By the way
Doubts on Struts 1.2 - Struts
Doubts on Struts 1.2  Hi, I am working in Struts 1.2. My requirement..., I am sending you a link. I hope that, this link will help you. Please visit for more information. http://www.roseindia.net/struts/ Thanks
i want make a simple tools like turnitin using java
i want make a simple tools like turnitin using java  it just simple tools can select the file like .doc,.pdf,.txt..the tools can read inside the file and make a searching at internet and give the source the source come from where
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
facebook like button code
facebook like button code  How to create a facebook like button? can anyone share the code..?? Thanks in advance
Struts 1.2 and ajax example
Struts 1.2 and ajax example  Struts 1.2 and ajax example with data from database
highlight words in an image using java
want to highlight name in the image using java/jsp/javascript.please help me...highlight words in an image using java  Hai all,In my application left side image is there and right side an application contains textboxes like
i want to do a project using jsp and servlet....What are all the materials i need to study
i want to do a project using jsp and servlet....What are all the materials i need to study   i want to do a project using jsp and servlet....What are all the materials i need to study ?   Please visit the following
need a sample project using java technologies like jsp, servlets, struts
need a sample project using java technologies like jsp, servlets, struts  Hi everybody! I have learnt core java,jdbc,jsp,servlets & struts. Please guide me where can i find sample project like library management, CMS or any
Internationalization using struts - Struts
Internationalization using struts   Hi, I want to develop a web application in Hindi language using Struts. I have an small idea... to convert hindi characters into suitable types for struts. I struck here please
Social Media Marketing: Twitter or Facebook?
Social Media Marketing: Twitter or Facebook? The decision has to be made... networks. Now, the obvious choice would be facebook, but because of some simple aspects, we will see why twitter can be a good option as well. Facebook has
struts image uploading
struts image uploading  please let me know how to upload image in database using struts ..i have written form class and 'm hanging out in action class .... form FileUploadForm: package com.action.form; import
I want detail information about switchaction? - Struts
I want detail information about switch action?  What is switch action in Java? I want detail information about SwitchAction
struts image uploading
struts image uploading  please let me know how to upload image in database using struts ..i have written form class and 'm hanging out in action... links: http://www.roseindia.net/struts/strutsfileuploadandsave.shtml http
struts image uploading
struts image uploading  please let me know how to upload image in database using struts ..i have written form class and 'm hanging out in action... links: http://www.roseindia.net/struts/strutsfileuploadandsave.shtml http
struts image uploading
struts image uploading  please let me know how to upload image in database using struts ..i have written form class and 'm hanging out in action... links: http://www.roseindia.net/struts/strutsfileuploadandsave.shtml http
Text preview on a Image - Struts
) on a corresponding image.Suppose i want to display the text which i entered in the text field,for that i wrote onchage=textchage()in html:text tag and i wrote that function in the script.The text i entered in the text box is displayed
I want this jsp answers
I want this jsp answers    How can we declare third party classes... for particular jsp pages? If we want to develop any jsp pages using eclipse where we can... servlet? Can we print the messages by using the expressions in case of jsp
I want this jsp answers
I want this jsp answers    How can we declare third party classes... for particular jsp pages? If we want to develop any jsp pages using eclipse where we can... servlet? Can we print the messages by using the expressions in case of jsp
i want code for these programs
i want code for these programs   Advances in operating... available and suitable platform) Design, develop and execute a program using any..., and execute a program to solve a system of n linear equations using Successive Over
Java Programming: Section 1.2
Section 1.2 Asynchronous Events: Polling Loops and Interrupts... computer system might be organized like this: (This illustration is taken.... They can concentrate on the different tasks or threads that they want the computer
using captcha with Struts - Struts
using captcha with Struts  Hello everybody: I'm developping a web application using Struts framework, and i would like to use captcha  Hi friend,Java Captcha in Struts 2 Application :http://www.roseindia.net
insert image using hibernate
insert image using hibernate  Sir, Today I hadposted question regarding upload image, th answer you had given is using SQL, but I am using Hibernate to insert data in the same table where I want to insert image. Plz hlp me
how to make an image act like upload dialog box
how to make an image act like upload dialog box  dear sir: i have... he/she wants. i know that the code for this is but what i want is i want the upload dialog box to be accessed from an image, like an attachment image. i
how to make an image act like upload dialog box
how to make an image act like upload dialog box  dear sir: i have... he/she wants. i know that the code for this is but what i want is i want the upload dialog box to be accessed from an image, like an attachment image. i
How can I generate diff image using Jmagick?
How can I generate diff image using Jmagick?  Hi, I used 'compare...: 2008.67 (0.0306503) all: 1536.39 (0.0234439) I am not able to do this using Jmagick. Can anybody help me get a diff image with similar metric using Jmagick
Can i insert image into struts text field
Can i insert image into struts text field  please tell me can i insert image into text field
Struts 1.2 Vs Struts 2.0 - Struts
Struts 1.2 Vs Struts 2.0   Hi, Can u give difference between struts 1.2 and struts 2.0 . Thanks prakash  Hi Friend, Please visit the following link: http://www.roseindia.net/struts/struts2/Struts2vsStruts1
struts
struts  hi i would like to have a ready example of struts using "action class,DAO,and services" for understanding.so please guide for the same. thanks  Please visit the following link: Struts Tutorials
Struts
Struts  Am newly developed struts applipcation,I want to know how to logout the page using the strus   Please visit the following link: Struts Login Logout Application
how to re size image proportionately using java for different images like jpeg, png, gif.
how to re size image proportionately using java for different images like jpeg, png, gif.  hi, i need sample code for re size image proportionately using java for different images like jpeg, png, gif, this code for my
struts
struts  hi i would like to have a ready example of struts using"action class,DAO,and services" so please help me
Apache Solr 1.2 released
Apache Solr 1.2 released Welcome to Apache solr 1.2 ! To get started, I would like to introduce Solr to you. Solr is a standalone enterprise full text search engine. It is a high performance search server with a web-services like
using displaytag with struts2 - Struts
using displaytag with struts2   Hi, i am using struts2 framework...,exel like this. I have downloaded and run that application. I experienced... application but if we want rich UI(user interface), i personally feel
I need to develop a gui like this
I need to develop a gui like this  Hai Friends, I need to develop... please help me   sorry goes through this link I need to develop like this image..please goes through
struts
technologies like servlets, jsp,and struts. i am doing one struts application where i doing validations by using DynaVAlidatorForm in that have different fields...struts   hi Before asking question, i would like to thank you
Struts
Struts  I want to get the data from database into text box in a jsp page by using struts and javascript If I click on go button it will display all the values and from that i need to select the required value and i should store
diff b/w struts 1.0 and 1.2
diff b/w struts 1.0 and 1.2  diff b/w struts 1.0 and 1.2
create a form using struts
create a form using struts  How can I create a form for inputting text and uploading image using struts
Struts Related - Struts
Struts Related  Hi, i would like to use HashMap with tag with using HashMap's Key . I am able to display whole HashMap using tag. but what i want is i would like to display only some of the values . thanks
Uploading image using jsp
Uploading image using jsp  how to upload image using jsp. Already i tried, But that image file does not read. It returns only -1 without reading that image file ... I want know that solution using by u... Thanks, P.S.N.  
Struts - Struts
Struts  hi sir Is it necessary to learn struts 1 for struts 2.with out struts 1 cant we learn struts 2.x.presently i want to learn struts.i know little bit abt struts 1.x.presently which struts version is using in industry
Struts
Struts  I want to create tiles programme using struts1.3.8 but i got jasper exception help me out

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.