unable to display image using html tag in servlet.(image src is in a variable.....). i am using netbeans IDE. plz..........do help
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javazoom.upload.MultipartFormDataRequest;
import javazoom.upload.UploadBean;
import javazoom.upload.UploadException;
import javazoom.upload.UploadFile;
import java.util.Hashtable;
import java.util.Enumeration;
public class disp_Full extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
Hashtable ht=null;
UploadFile file=null;
try
{
MultipartFormDataRequest mfdr=new MultipartFormDataRequest(request);
UploadBean upb=new UploadBean();
upb.setFolderstore("E:/College/BE/Semester II/NetBeansProjs/image_store/web/Images");
upb.setOverwrite(false);
ht=mfdr.getFiles();
Enumeration files=ht.elements();
file=(UploadFile)files.nextElement();
String name=file.getFileName();
String FullPath="Images/"+name;
upb.store(mfdr);
out.println(FullPath);
out.println("<html>");
out.println("<body>");
out.println("<img src="+FullPath +" id=a height=50% width=50% >");
out.println("</body>");
out.println("</html>");
}
catch(UploadException e)
{
e.printStackTrace();
System.out.print(e);
}
} finally {
out.close();
}
}
}
View Answers
Ads
Related Tutorials/Questions & Answers:
Advertisements
display image using jsp
display image using jsp
display image using jsp and phonegap on emulator of eclipse
Here is a simple jsp code that displays an
image on browser.
<%@ page import="java.io.*" %>
<%@page contentType="
image/gif
JSP:select image for db and display in image tag
JSP:select
image for db and
display in
image tag Hi,
i am new to this forum.
My query is that,
i am trying to
display image in
image tag but
i am...
image, but
i am not able to use this in img
tag of
html
JSP:select image for db and display in image tag
JSP:select
image for db and
display in
image tag Hi,
i am new to this forum.
My query is that,
i am trying to
display image in
tag but
i am not getting, how to
do this by
using this code.
plz help me.
if(rs1.next
JSP:select image for db and display in image tag
JSP:select
image for db and
display in
image tag Hi,
i am new to this forum.
My query is that,
i am trying to
display image in
tag but
i am not getting, how to
do this by
using this code.
plz help me.
if(rs1.next
Crop image Using JQuery, servlet or JSP.
Crop
image Using JQuery,
servlet or JSP. Hi sir
I need the code of Cropping
image using JQuery with the
help of
servlet or JSP.
I need both the code Client side as well as of server side.
Please
Help me
Display Image using Toolkit.getImage()
Display Image using Toolkit.getImage()
This section illustrates you how to
display the specified
image using
Toolkit.getImage() method.
To
display the
image, put an
image
Exporting to excel using display tag?
Exporting to excel
using display tag? Hai ,
I am implementing pagination in struts.It has export to excel option.When
I am clicking... is in a different format.Do you want to open the file". When
I am clicking
Insert Image into Database Using Servlet
Insert
Image into Database
Using Servlet
 ...
image into database table
using
Servlet. This type of program is useful in social... the
image from database
using
Servlet. After retrieving the
image from database
Insert Image into Database Using Servlet
Insert
Image into Database
Using Servlet
 ... of inserting
image into database table
using
Servlet. This type of program is useful... to retrieve the
image from database
using
Servlet. After retrieving the
image from
HTML - Image tag.
;h1>Example of
HTML image tag.</h1>
<img
src="RI...
HTML -
Image tag.
Description :
HTML supports two type tags.
1-Singular
tag... and end
tag. The img
tags is used for embedding
image in
HTML page
Image upload in mysql database using jsp servlet
Image upload in mysql database
using jsp servlet Hello,
I need code to insert
image in mysql database,
I have seen the code which is already in your portal but it is not inserting
image into database it save in the folder
How can I generate diff image using Jmagick?
: 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...How can
I generate diff
image using Jmagick? Hi,
I used 'compare
Image using Java coding
Image using Java coding Hai,
Display image in pdf file
using Java coding through Xsl file.. Please
help me.. xsl file generate the pdf file
Display helloworld using servlet in jboss
Display helloworld
using servlet in jboss import java.io.*;
import...{
response.setContentType("text/
html");
PrintWriter pw = response.getWriter();
pw.println... World</h1>");
pw.println("</body></html>");
}
}
I wrote