954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

display image and text both on the same jsp page

Hi
I want to display text and image both on the same jsp page.
but the code display only image, which is retrieve from database.
can i display both on same jsp page.

all data retrieve from database with image as blob.

please help me..

Lalit Chattar
Newbie Poster
9 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

Easy. But not the way you think it's done.
You can not mix text and binary output in a single http stream, it has to be 2 requests.
The JSP displays the text, includes a link to a servlet that serves the image.
Of course the JSP doesn't do anything at all with Java code, it just parses the data generated by another servlet.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

i am developing website using jsp and html n database of mysql
i want the code written in html n jsp to upload files on my web page
files should include all types i.e. image,video,ppt,word doc etc.

syali
Newbie Poster
4 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

hi i give you code which will help you. But i am not sure about video. check it and reply me.

http://www.roseindia.net/jsp/file_upload/employee_upload_profile_image.shtml

in this link servelet code upload all type of stream.

Lalit Chattar
Newbie Poster
9 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

thank u very much
i will try this code n reply u soon
............
i really don't hav words to thank u....
see u later............

syali
Newbie Poster
4 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

If roseindia says something, it's almost certainly wrong or at the very least highly inaccurate.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

Hi Have you try roseindia?. There are a big helpful site for Java technology.
when i was new in java i learned many concept related to web or java technology by this site. and also at this time Ok....
try it then do comment..
thanks for advice.

Lalit Chattar
Newbie Poster
9 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

Off topic - I agree with jwenting roseindia is worst place to try and learn something.
1) There is not structural organization of topics
2) Many of examples are out of date, plenty of them are done with poor organization of even basic MVC in mind
3) there are plenty of tutorials stolen from books, online tutorials without acknowledging rightful author

So please in the future do not suggest this website as it shunned upon as example of what everything can be done wrongly.

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

And pretty much everything they tell you is fundamentally flawed.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
   <%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
   <%@ page import="org.apache.commons.fileupload.*"%>


i got an error tht these packages does not exist
in netbins 5.0
i will try once again...
but can u suggest me better compilar thn netbins 2 run my jsp codes
n frm where do i can get it??

syali
Newbie Poster
4 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

1) Please use code tags when posting any code
2) Did you actually downloaded the Commons FileUpload package and included in your project?
3) Every forum member is asked to used full sentence English. Chat/SMS type of writing is not welcome.
4) NetBeans is not compiler but IDE. If you do not like it you can use IntelliJ IDEA, Eclipse or command line
5) The tutorial that you are trying to follow is about getting data from client to server, where from your description of problem you want from server do client you are wasting your time with it...

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
   <%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
   <%@ page import="org.apache.commons.fileupload.*"%>

i got an error tht these packages does not exist in netbins 5.0 i will try once again... but can u suggest me better compilar thn netbins 2 run my jsp codes n frm where do i can get it??


hi you must download apache common file upload and i/o library from apache .org. then put all jar file in your class path directory.

i have been use this code it upload all type of document. doc,image,pdf,txt but i am not sure about video.

Lalit Chattar
Newbie Poster
9 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

i am building a website in jsp+html using mysql database.
i want to allow user to uplod files of all type i.e. ppt,word doc,image,audio,video files on web page...
i tried the codes written in roseindia ...// in netbins5.0
but it do not hav certain packages used in those codes.......
it gives error like those packages do not exits... they are

<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@ page import="org.apache.commons.fileupload.*"%>


plz help me

syali
Newbie Poster
4 posts since Feb 2010
Reputation Points: 10
Solved Threads: 1
 

Already answered in post 11 and please start using code tags and stop reposting that useless roseindia link

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

u can display both text and image in the same jsp page by using tag
u can write like this in your jsp page

priya paruchuri
Newbie Poster
1 post since Oct 2011
Reputation Points: 10
Solved Threads: 1
 

thnnks priya but i dont suppose it will be useful for me now. I asked this question a long time ago and i think i have resolved this problem. but ok no problem good job... keep it up....... :)

Lalit Chattar
Newbie Poster
9 posts since Feb 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You