• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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: 67746
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.
     
    This tiny ad is guaranteed to be gluten free.
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic