File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tiles problem in rendering

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a web application that uses tiles. Following are my definitions.

In my web.xml,

<welcome-file-list>
<welcome-file>/pages/index.jsp</welcome-file>
</welcome-file-list>

<!-- START ******************** All Servlet Context Parameters ********************* -->
..... other stuff defines here....

<context-param>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/classes/config/common/tiles-common.xml, /WEB-INF/classes/config/user/tiles-user.xml</param-value>
</context-param>


My index.jsp is,

>

My tiles-common.xml is,



The struts-common.xml is defined as,


The problem is that when I start my webapp, I land in index.jsp which in turn calls the welcome action and I end up seeing the landing page with the tiles layout applied. But later when I click another link say meetup from the menu.jsp, I get the result but with no tiles layout applied??

 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I made some mistakes. Corrected my tiles definition like.



But still left with the same problem??
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Can anyone out here please help me. I'm not sure as to why my layout would not be applied to other pages. But is works only for the home screen that I have defined in my welcome file list.


The index.jsp looks like:



The action mapping looks like:



The tiles definition looks like:


 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So here are the screenshots:

ClickedHomeFromMenu.jpg
[Thumbnail for ClickedHomeFromMenu.jpg]
HomeScreen.jpg
[Thumbnail for HomeScreen.jpg]
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you can see from the above screenshots that the layout and styles are gone as soon as I clicked the home link on the left hand menu. Why should this happen? What is that I'm doing wrong here?
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. I figured this out. The problem was that for the css I should use a path like this:



But rather I was using it as:



which was wrong.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic