aspose file tools*
The moose likes Struts and the fly likes Tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles" Watch "Tiles" New topic
Author

Tiles

Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Hi,

Is it possible to have a tile load a page from another deployed WAR file?

I have two WAR files deployed. I want to load the header and footer from one WAR file, and the body from another WAR file. Is this possible?

thanks and regards,
sim085
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
To the best of my knowledge, no, it isn't possible. The reason for this is that tiles uses the ServletContext's RequestDispatcher and Java EE spec does not allow it to cross Web application borders.
[ May 14, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Thanks for your reply Merrill

I felt it in my guts that it was imposible ... however I did want to give a one last attempt here.

Do you, or anyone else know how what I explained above could be possible?
(even without tiles if needed). I also tried jsp:include .. but this does not work either since it searches the page inside the WAR file as well.

thanks and regards,
sim085
[ May 15, 2006: Message edited by: Simon Joseph Aquilina ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The JSTL tag <c:import> does allow you to include a page from another context. This link gives more details.
Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Merrill ... Thanks

I read the article you sugested in your post, and the <c:import ...> tag does what I need (now I also know what it is called 'Absolute Path'

I am now in the process of implementing this in my application, have already some implementation toughts in mind.

I still have some reservations on this. However first I want to check it out, and then ask more questions

However thanks again for your help

regards,
sim085
Simon Joseph Aquilina
Ranch Hand

Joined: Feb 14, 2006
Posts: 102
Hi,

the <c:import ...> worked exactly as you sugested However there is a problem using this tag..

Just as an example, I loaded the header and footer from my war file, and the body element I loaded the google site. However when I clicked the submit button (naturally) it no longer loaded the default page of my WAR file... and therefore the page was not found

I do not know if what I am trying to achieve is imposible However it really feels like it!

My plan was to have my website in a WAR file, and then develop something like a Forum in another WAR file. The reason for this division is because a forum contains a lot of logic, and also a website. Thus instead of having them all in one WAR file I wanted to spereate them, but at the same time keep the same layout of the first WAR file.

What I can do is having the header and footer imported from the forum! ... mmm .. but that is just a current tought

however thanks again.

regards,
sim085
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tiles