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



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

Have Programming Question? Ask it here!
 
 
 


Ranvijay
I want Image Album like -orkut and Facebook Using Struts 1.2
1 Answer(s)      3 years and a month 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...


Advertisement
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 Tutorials/Questions & Answers:
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
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
Advertisements
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
facebook like button code
facebook like button code  How to create a facebook like button? can anyone share the code..?? Thanks in advance
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
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
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
Struts 1.2 and ajax example
Struts 1.2 and ajax example  Struts 1.2 and ajax example with data from database
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
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
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
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 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
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
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
album maker
album maker  How to make a simple album maker using java API
using ajax i want to insert data into oracle database
using ajax i want to insert data into oracle database  i would like to insert/update/select/delete from jsp to oracle database using ajax? please send a code for this iam using oracl database thank you
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP  is this link has right content regards that?? http://techpdf.co.cc/blog/how-to-retrieve-data-from-facebook-using-php
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP  is this link has right content regards that?? http://techpdf.co.cc/blog/how-to-retrieve-data-from-facebook-using-php
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
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
I Want to take mqsyl batabase backup using jsp
I Want to take mqsyl batabase backup using jsp   I was develop web portal using jsp and servelt. I need to take backup my MySQL database and restore another one MySQL database.   import java.util.*; import java.io.
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
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
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..   i want to convert... project.. but i cant convert Image file to its byte code format.. if anybody can plz
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
sir i want small project with of health care system with struts and hibernate plz help me
sir i want small project with of health care system with struts and hibernate plz help me  sir i want small project on health care system with struts and hibernate plz help me
how to resolve the problem like when i extract the struts-blank-1.3.10.war it shows java .io.filenotfound
how to resolve the problem like when i extract the struts-blank-1.3.10.war it shows java .io.filenotfound  Hai, To Extract war file jar -xvf struts...\madhavi>d: D:>cd sapp D:\sapp>jar -xvf struts-blank-1.3.10.jar
i want to select a multiple value of check box by using onclick or onchange event without using from submission
i want to select a multiple value of check box by using onclick or onchange event without using from submission   i have 4 check box name 1)profile... the result is ok but after getting value of first box now i want a result of second box
i want to learn Jquery
i want to learn Jquery  i want to learn jquery can u plz guide me   Yes, you can learn these technologies by yourself. Go through the following links: Ajax Tutorials JSON Tutorials JQuery Tutorials
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
i want for statement codding
i want for statement codding  what is the for condition following out put 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
I want to Do Addtion ,Substraction,Division,Multiplication in C Without using Any Arithmetic Operators - Development process
I want to Do Addtion ,Substraction,Division,Multiplication in C Without using Any Arithmetic Operators  I want to Do Addtion ,Substraction,Division,Multiplication in C Without using Any Arithmetic Operators. plz Help Me
I want to Do Addtion ,Substraction,Division,Multiplication in C Without using Any Arithmetic Operators - Development process
I want to Do Addtion ,Substraction,Division,Multiplication in C Without using Any Arithmetic Operators  I want to Do Addtion ,Substraction,Division,Multiplication in C Without using Any Arithmetic Operators. plz Help Me
i want code of signing off from a account how its done in jsp and servlet by using either cookies or session
i want code of signing off from a account how its done in jsp and servlet by using either cookies or session   sig
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
i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse
i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse  please help me i have to submit this soon
i want to copy files from one machine to other using java and the code will be running on third machine
i want to copy files from one machine to other using java and the code will be running on third machine  i want to copy some files from one machine... machine say 'c'. So , can you help me on this that how can i do this using
i want code of signing off from a account how its done in jsp and servlet by using either cookies or session
i want code of signing off from a account how its done in jsp and servlet by using either cookies or session   sig   Hi Friend, Please visit the following link: http://roseindia.net/jsp/bank.shtml Thanks
image upload - Struts
image upload  Can any one help me how to upload an image using struts
I can not share my message from the textview on Facebook in Android, but in all other Application works successfully
I can not share my message from the textview on Facebook in Android, but in all...(android.content.Intent.EXTRA_TEXT, str); startActivity(Intent.createChooser(i, "Share using... = getIntent().getExtras().getString("extra"); tv.setText(str); Intent i = new
I nedd Paypal processing source code in struts and how to develope weather reports using web-api - Struts
I nedd Paypal processing source code in struts and how to develope weather reports using web-api  I nedd Paypal processing source code in struts and how to develope weather reports using web-api
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP  as i said i want... the database using JSP. like country,state,city..please guide me
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
unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help
unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help  import...(); upb.setFolderstore("E:/College/BE/Semester II/NetBeansProjs/image_store/web
i need a school appication using struts frame work with oracle 10g using myeclipse6.0
i need a school appication using struts frame work with oracle 10g using myeclipse6.0   hi i need a school apllication using struts frame work backend 10g xe using myeclipse 6.0
i want to resize the tiff file also - WebSevices
i want to resize the tiff file also  if($objFiles['photo']['name...']); $FileName= time().$objFiles['photo']['name']; $this->resize_image...'],180,135); } function resize_image($src,$dest,$type,$new_width,$new
Advertisements
 

 

 

DMCA.com