File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Tiles winding me up. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Tiles winding me up." Watch "Tiles winding me up." New topic
Author

Tiles winding me up.

Alana Sparx
Ranch Hand

Joined: Feb 14, 2006
Posts: 121
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

Joined: Feb 14, 2006
Posts: 121
�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?
Jason Moors
Ranch Hand

Joined: Dec 04, 2001
Posts: 188
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

Joined: Feb 14, 2006
Posts: 121
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

Joined: Feb 14, 2006
Posts: 121
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?
 
GeeCON Prague 2014
 
subject: Tiles winding me up.