[coldbox-4.1.0][lucee-4.5.1][Windows-8.1] [samples-helloworld] image not shown

Hi

I am trying to debug the following code in Main.cfm when in image is not displayed.

`

 

strPath=#strPath#

`

I got the value for strPath as:

`
strPath=C:\projects\coldfusion\apps\samples\applications\helloworld\layouts\

`

Assuming that path is wrong, I have tried following iterations

1.Iteration 1

`

`

2.Iteration 2
Copy “poweredby.png” to “C:\projects\coldfusion\apps\samples\applications\helloworld\layouts”
and change the image source as

`

`

or

`

`

or

`

`

Any thoughts ?

Thanks in advance
Brahmaiah Koniki

Assuming that

You’re confusing the location of a .cfm file in the ColdFusion web root and the location of the file the CLIENT (web browser) sees. The way that ColdBox works is the browser sees all requests as coming from the /index.cfm file in the root of the app mapping. The fact that the actual HTML returned by that page is aggregated from a number of places (handlers, layouts, view) in different subfolders has no bearing on how the browser resolves images.

What is your web root? (Showing us the URL should suffice) The ColdBox sample apps are structured such that there are several stand-alone applications in subfolders inside the web root. That file is contained up in the main application, however if you’ve started the site with the web root at the same level as your app root, then the …/ won’t work.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad

Thanks for quick response. The URL of the page is:

`
http://localhost:8888/samples/applications/helloworld/index.cfm

`

In Lucess, “/samples” is mapped to

`
C:/projects/coldfusion/apps/samples/

`

Thanks
Brahmaiah Koniki

The problem lies in the mapping of paths in Lucee/Tomcat. I have copied helloworld application under the document root of Lucee/Tomcat. Images are shown with following line in Main.cfm

`

`

with following url:

`
http://localhost:8888/helloworld/

`

Next I created a mapping in Lucee/Tomcat as:

/x =C:/lucee/tomcat/webapps/ROOT/helloworld/

Now , no images will be shown with following url:

`
http://localhost:8888/x/

`

On the face of it, it appears Coldbox shows images and other assets as long as application is hosted directly under the web root and no other mapping of the path is involved.

Cheers
Brahmaiah

I’m not sure I’m following you. ColdBox does not show images. Your browser does. The powered by image in that sample app will only display if the app is nested under the main application like it comes in the download. If you move the app elsewhere, the relative path will break. Regardless, this has nothing to do with ColdBox. It is your browser that resolves images and displays them.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com