File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Several questions on modules. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Several questions on modules." Watch "Several questions on modules." New topic

Several questions on modules.

kriegerd Salas

Joined: Aug 01, 2005
Posts: 8
Hi, I'm a newbie regarding modules in struts.I added a module to an app and encountered my first problem.

1. I have a lot of resources (images mostly) that are common to the whole application.Now, when I switch to my new module my tile definition gets all messed up (its looking for images in the wrong place).This gets fixed if I put the whole path in my images (E.g. /MyApp/images/img.gif).But I can't do that!.It must be something like /images/img.gif. How can this be fixed?

2. Can I have tiles that extend from definitions from other files?

3. I manage to have different tiles definition files and different strut-config files.Just by listing all my strut-config files in web.xml (coma separated).Like:

So what is the difference between this and having modules?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The only one of your questions I'll attempt to anwer is #1. If your current jsp is in a module such as /MyApp/MyModule, and your images are in /MyApp/images/, then you can reference an image in this directory by using ../images/myimage.gif. If all else fails, I use the following to avoid hard-coding the full path: <%= request.getContextPath()%>/images/myimage.gif.
[ December 07, 2005: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: Several questions on modules.
It's not a secret anymore!