Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Trying to use Tiles--Little success :-( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Trying to use Tiles--Little success :-(" Watch "Trying to use Tiles--Little success :-(" New topic
Author

Trying to use Tiles--Little success :-(

Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
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

Joined: Mar 28, 2006
Posts: 7
<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>


My English is poor. Sigh!!!
Russell Ray
Ranch Hand

Joined: Apr 25, 2005
Posts: 116
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

Joined: Nov 28, 2004
Posts: 51
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

Joined: Apr 25, 2005
Posts: 116
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to use Tiles--Little success :-(