Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

External Image is not loading into JSP using Spring McS  RSS feed

 
Arun chandu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using Spring and Hibernate project and I can able to get the inside problem images however not the out side images.

I have tried the all the ways and even adding into ResourceHandlers




Using ''uploadfiles" as reference to get the pics




Anyone can help me how to display the those pics. Thanks in Advance.

images.PNG
[Thumbnail for images.PNG]
Image not getting displayed
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65970
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page-relative URLs are almost guaranteed to cause problems. Use server-relative URLs that start with the context path. See the JspFaq for more information.
 
Arun chandu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for suggestion, Actually though images are uploaded form to FTP from the local system. How can we access those image and display to browser.

Its really argent help me out!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65970
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun chandu wrote:Thanks for suggestion, Actually though images are uploaded form to FTP from the local system. How can we access those image and display to browser.

Maybe, I'm not understanding the issue? (your sentence isn't very clear)

Where are the images? On the server system? Somewhere else? How they got there (like FTP) isn't very relevant.
 
Arun chandu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I apologize for the mistake.

I am using VM Linux system as server and Tomcat-8 as Application server. Files are uploading into Linux system using FTP on particular folder (eg: /design-doc/2016/March/25/) and Application is deployed into "/opt" folder.

root
|
|--------------Design-doc
|--------------opt
|--------------Logs

I Want to display the uploaded images in Jsp. I hope, you understood Sir!

unfortunately, Images are not displaying. How to solve the problem.

Thanks
Arun
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65970
140
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regardless of how the images got where they are, they need to be able to be served via a URL. If the image cannot be accessed via a URL, it cannot be displayed on a page.

So, either the image must be part of a web app, or you must write a servlet that reads the image data from the file, sets the appropriate headers, and sends the image data. For the latter case, the URL of the servlet is what would be used to access the image from the pages.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!