• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Image jsp servlet controller bean and database

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sir can you please send me an example to upload an image to the server (with user defined file name and display message if name exist) at specific folder "images" and save its path to the mysql database. And again display the images uploaded on the server folder by using the path which is stored in database.
Sir i am able to upload image on server specific folder or the image directly in database in bolb datatype but i become failed to store its path in database and fetch the uploaded image using the path in database. So please guide me.
Ranjan
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does it fail?
 
RanjanKumar Raj
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then please send me a simple jsp project for uploading image on the server and its name in database and display it using jsp. Please use the MVC2 pattern. Means it should be done by the help of servlet controller file.
So please.
Ranjan
 
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Show us what have you done so far, let us know where you are stuck and we'll try to help you.

Please note that we don't hand out ready made solutions here. Read this and this.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In case you're really stuck on where to start, you should break your task into two separate parts:
  • Uploading files to your application
  • Serving images to the client

  • To manage the file upload, have a look at the FileUpload helper module available in the Apache Commons library. Have a look here: http://commons.apache.org/fileupload/using.html

    Second, to serve images to the client, you need to create a Servlet, commonly known as an Image Servlet. If you search on this, you'll find lots of examples.
     
    Mark E Hansen
    Ranch Hand
    Posts: 650
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I just added an article to the ServletsFaq titled ImageServlet (http://faq.javaranch.com/java/ImageServlet) which shows how to serve images (and other multimedia content) from your Servlet-based web application.
     
    Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic