cancel
Showing results for 
Search instead for 
Did you mean: 

Loading images and pack them inside the ear file

Former Member
0 Kudos

Hello everyone:

I'm developing a WebDynpro app and I want to include some images. I learned here at SDN forums that I can put the images in the %workspace%/project/src/mimes/Components/myComponent/ so I placed them there.

Just to maintain a little order, inside that directory above I create an /images dir. I can see the images in the WebDynpro editor and they are ok, however, when I deploy the app I can't see the images.... it seems they are somehow not bundled with the ear file I deployed.. how can I deploy the whole ear with all that it needs?

I wouldn't like to ftp the images and then hardcode absolute paths to them in my WD app =(

thanks everyone

Alejandro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you create the "images" folder under the src/mimes/Components/<your_component> folder?

Armin

Former Member
0 Kudos

hello:

Yes one image is in the folder:

%workspace%/project/src/mimes/Components/myComponent/

and the remaining images are in:

%workspace%/project/src/mimes/Components/myComponent/images/

any ideas? thanks

Former Member
0 Kudos

I have no idea why the subfolder is not packaged in the EAR, perhaps you can verify this again.

So put all images directly in the src/mimes/Components/<your_component> folder. Then you can refer to these images from within this component by simply using the filename without any path prefix.

But also if you put your images into certain directories on the server, you do not need to use absolute URLs. Instead, you can use one of the (many methods of class WDURLGenerator to create these URLs.

Armin

Former Member
0 Kudos

I have now unrar the .wda file and the images are located in:

%wda file%/Components/myComp/images

I've put the "index" images in the myComp/ folder, and the dividing them in myComp/welcome, myComp/etc according to the module they belong to... I can't not even see the one at the "root" myComp folder =(

the folder is there tough..........

thanks for your replies

Alejandro

Former Member
0 Kudos

What do you mean with "I can't not even see the one at the "root" myComp folder"?

Are the images not shown in the NWDS or also not shown in the running application?

How do you reference the images from within your application/component?

Armin

Former Member
0 Kudos

I have the images in the NWDS like this:

workspace\CCSS\src\mimes\Components\myComp\

I have moved the images from the /images folder, into myComp, so that's as far as the directory tree goes.

I reference them in NWDS as:

source = /Logo.gif

And they appear correctly in the NWDS. All of them are there. After deployment, the images are there too (I know because I browsed the wda file inside the ear one) but in the running application, once it has been deployed, the images are gone.... I just see the ALT attribute. No images

Former Member
0 Kudos

Omit the leading "/".

Armin

Former Member
0 Kudos

gosh!! that was subtle... it's working now...

Thanks a lot!

Alejandro

Answers (0)