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
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
If roseindia says something, it's almost certainly wrong or at the very least highly inaccurate.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
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
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
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
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
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
Already answered in post 11 and please start using code tags and stop reposting that useless roseindia link
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902