• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to use Tiles--Little success :-(

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic