Jump to content
We've recently updated our Privacy Statement, available here ×

Image location in j2ee web application?


Recommended Posts

By: Aaran Stent - aaran

Image location in j2ee web application?

2003-04-27 19:18

Hi, I am having trouble deciding how to reference an image in a report when used in a j2ee web application. I have changed the string value to a path such as "./logo.jpg". Using iReport i can compile and preview the report. When i deploy the engine reports i t cannot find "./image.jpg".

 

Where shouldI place images for Jasper when I am deploying and how do I reference them. I have a constantly changing deployment path so it would need to be context sensative.

 

Regards,

 

Aaran Stent

 

 

 

 

By: Teodor Danciu - teodord

RE: Image location in j2ee web application?

2003-05-11 14:12

 

Hi,

 

The best way to reference images or subreports

is to place them into the classpath.

They will be loaded as resources at runtime when

filling the reports.

 

If you have an image into a directory like this:

 

/imagerepository/com/mycompany/images/logo.gif

 

reference it like this:

 

<imageExpression>"com/mycompany/images/logo.gif"</imageExpression>

 

but make sure that the /imagerepository directory

is part of the classpath when you fill your reports.

 

In the "webapp" sample we used a different approach.

There we have a report parameter that points to the

base directory that contains the images.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...