• 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

Access a resource (for example, Image) in Appserver

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to using Sun ONE application server. My requirement is to capture a remote image file through EJB and save it on the hard disk rather than saving to databse and should be used by webserver (Tomcat in Sun ONE) to display the preview of created image to the user. In order to fulfill my requirement, which location the image file should be created on the box (where Appserver was installed) and how to refer to this image file from webserver using http protocol to display the preview? I would really appreciate if somebody could help me ASAP.


Thanks in advance.
 
Ranch Hand
Posts: 120
IntelliJ IDE Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as I know EJB container does not allow to access local file system. But
web container (were all your servlets are run) has direct access to the file system. So I advice you use the following pattern.
- Create some directory in the application server workstation.
- Create reference to this directory in the application deployment descriptor
- Use reference to get actual directory from the servlet that actually load and store image.
It probably make deployment a little bit more complex. But I resolved the similar problem (image preview) using this pattern.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic