This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trying to use Tiles--Little success :-(

 
Russell Ray
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am learning while I am developing a Struts application. What I have tried to accomplish is to use the templates within the tiles tag library. It is a very simple design--title, header, menu, body, footer scenario.

However, I continue to get a NPE when I go to the home jsp.

I am using JDK 1.5, JBoss4.0.3SP1.

This is my template for the home page:



This is my struts-config.xml




This is my tiles-def.xml file:





This is my web.xml file:




This is the error code I am getting:



Any help at this moment would be greatly appreciated as all I am trying to do is get he app up and running.

As always, thanks for taking the time to read my post.

Russ
 
yin jiang
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<title><tiles:insert attribute="title" flush="true"/></title>

<tiles:insert> Tag is a Tag to insert a page at the place of this tag. But your title is not a page, but a string. So chage this line to :

<title><tiles:getAsString name="title" /></title>
 
Russell Ray
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yin:

Thank you for responding!

Okay I tried what you spoke of in your last post and got the following error:



I am wondering if I don't have something configured correctly because it is NOT seeing the element.

Thanks again for your assistance.

Russ
 
Mohammad Ibrahim
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Russell,
I think you have missed somthing in your web.xml. Add the following and let me know:

In web.xml:

Add an entry for the TLD in your application's Web deployment descriptor file (web.xml), and register the Tiles TLD.
 
Russell Ray
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohammad:

Thanks for your help! It did not change my situation. I had to swap from using the schema to using the dtd to make that work. Otherwise, the IDE could complain about not recognizing the <taglib> tag.

This is the updated web.xml


I am still getting the exception:



Anyone help would be appreciated. Thanks for reading my post.

Russ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic