This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Tiles winding me up.

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm having issues with Tiles, namely null pointer exception (tried deploying in both WebShpere & Tomcat).


To begin with, the following code snippet


is located in a file called /pages/Hello.jsp. Do I need to crate each one of the above JSPs in a �/tiles/� folder (which would make sense). I�ve tried this, but still get the npe.

The TilesTemplate.jsp looks like


The Hello.jsp is accessed by a forward from Welcome.jsp, which looks like


This is not making a great deal of sense, and while Husted's book on struts has been brilliant so far, this section isn't. Which is probably more to do with me than him.

Any pointers would be most welcome.

ta
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
�and if I alter TilesTemplate so the <TITLE> contains a Tiles tag as opposed to static content, ie:

to


I get a different exception:

Any further ideas?
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are missing the tiles definition.

You either need to create a tiles-def.xml file which contains the definition or a JSP definition.



There are two ways to use the definition ;

1) In Jsp file


2) In struts-config.xml
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tips, unfortunately, things still going squint, but at least with a different exception!


[28/02/06 09:32:05:131 GMT] 51e68fa2 WebGroup I SRVE0180I: [Struts Blank Application] [/simplesignon] [Servlet.LOG]: /layouts/TilesTemplate.jsp: init
[28/02/06 09:32:05:600 GMT] 51e68fa2 WebGroup E SRVE0026E: [Servlet Error]-[Error - tag.getAsString : component context is not defined. Check tag syntax]: javax.servlet.jsp.JspException: Error - tag.getAsString : component context is not defined. Check tag syntax
at org.apache.struts.taglib.tiles.GetAttributeTag.doEndTag(GetAttributeTag.java:198)
at org.apache.jsp._TilesTemplate._jspService(_TilesTemplate.java:92)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)


Any other tips?
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm such a dumbass.

in my Hello.jsp file , if i cahnge the last line from

to

it all works swimmingly.

Could not WebSphere / Tomcat proactively report on my ineptness by generating MEANINGFUL parser errors?
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!