Home > Ask the SAP software/management Experts > Java/SAP development Questions & Answers > Resolving image source tags in a Web browser
Ask The SAP Expert: Questions & Answers
EMAIL THIS

Resolving image source tags in a Web browser

Austin Sincock EXPERT RESPONSE FROM: Austin Sincock

Pose a Question
Other SAP Categories
Meet all SAP Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 11 September 2002

I'm doing a project using JSP in Jbuilder6, and I want to know how to embed a picture to my JSP file? I use this tag:
<img src="E:/WINDOWS/jbproject/MailServer/defaultroot/hashiye.bmp" align="right">

When I use this tag in a simple HTML file the picture appears, but when I run the project in jbuilder I can't see the picture in the JSP file. Would you please tell me what's the correct "src" parameter for this tag in JSP?

The file Url is:
vfs://host:0/file:///E:/WINDOWS/jbproject/MailServer/defaultroot/HomePage.jsp
And when I run the project, the url is:
http://localhost:8080/HomePage.jsp


>

The tag: <img src="E:/WINDOWS/jbproject/MailServer/defaultroot/hashiye.bmp" align="right"> tells the Web browser to look for the image in a local directory rather than on a Web server. If a user requests this page over the network, the Web browser will try to find this image on the user's personal computer, instead of pulling it off the Web server. Of course, the image does not exist on the user's computer, so nothing will be displayed.

When you view the simple HTML in a Web browser on your local machine, the browser is able to use the directory path specified to retrieve the image. However, JBuilder acts as a Web server when dealing with JSPs. It will not be able to find this image, as the path specified is not a network-available URL. Try the following as your image tag:

<img src="http://localhost:8080/hashiye.bmp" align="right">

Bear in mind that a 'localhost' reference also refers strictly to your local machine. Another computer attempting to access 'localhost' across the network will end up referring to their local machine rather than your Web server. You should either use relative links or specify the unique IP address of your computer in the JSP.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Java/SAP development
How to provide an SAP R/3 4.5B application server with a Web service interface
Consuming a Web service from an SAP 4.6c R/3 application server
With Java development experience, should I go into SAP XI?
Answering basic BAPI questions
Viewing a list of SAP interfaces
Which SAP implementation phase is Java necessary for?
Interface a locally developed application with SAP
Should an ABAP professional know Java?
Storing SAP information from a JCo connector
Integrating SAP with C++, Java, and Powerbuilder on Sybase and Oracle DBs

SAP Java and J2EE
SAP CTO Sikka: SAP's innovation gets overlooked
SAP CTO expects today's SAP applications to be running in 2020
Tips on SAP ABAP
How to provide an SAP R/3 4.5B application server with a Web service interface
Consuming a Web service from an SAP 4.6c R/3 application server
SAP NetWeaver Configuration and Customization
Is C, C++ and Java knowledge required when learning SAP?
How to be a self-taught NetWeaver and ABAP expert
Getting started with a NetWeaver career
An ABAP user wants to learn XI

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SAP White Paper Topics
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts