wood burning stoves 2.0*
The moose likes Struts and the fly likes Problem with Tiles and Custom Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with Tiles and Custom Tags" Watch "Problem with Tiles and Custom Tags" New topic
Author

Problem with Tiles and Custom Tags

Brian Coles
Greenhorn

Joined: Jul 25, 2002
Posts: 6
I'm having some trouble with using Struts, Tiles, and Custom Tags. I've got everything set up correctly as far as Tiles and Struts go. On one of my tiles, I'm putting a page that has two Custom Tags of my own on it. The page tries to load, and I see the custom tag working in the log, but no ouput is displayed in that tiles location. Can someone advise? Thanks!!
(Sorry for the long list of code here)
includes.jsp

template.jsp

schedule.jsp

scheduleContent.jsp

[ February 25, 2003: Message edited by: Brian Coles ]
Matthew Marquand
Ranch Hand

Joined: Dec 19, 2002
Posts: 32
When you say there is no output do you mean that the variables you expect to be set by your tag implementation have been set to the empty string?
e.g. GAME_DATE, GAME_TIME
Also, does your tag implementation use the "extra info" classes? javax.servlet.jsp.tagext.TagExtraInfo
I believe tags that emit scripting variables require this additional call. I believe the TLD must be modified to specify this class.
Brian Coles
Greenhorn

Joined: Jul 25, 2002
Posts: 6
Thanks for the reply!
I apologize, I'm getting two errors in that tile that relate to the SEASON_START and SEASON_END variables. It's saying that it cannot resolve these symbols.
I am using TEI classes for all of the tags on this page. I checked my code again, and all of the variable names are correct.
So I tried changing it to the following, and THIS is what caused nothing to show up.
scheduleContent.jsp
Matthew Marquand
Ranch Hand

Joined: Dec 19, 2002
Posts: 32

I apologize, I'm getting two errors in that tile that relate to the SEASON_START and SEASON_END variables. It's saying that it cannot resolve these symbols.

Does this mean that the other references to scripting variables later in the page are coming out okay?
Brian Coles
Greenhorn

Joined: Jul 25, 2002
Posts: 6
Well, the two custom tags that I have that reside in the template.jsp file work just fine. The tags that are in scheduleContent.jsp (a panel that ends up in template.jsp), do not produce the desired (or any) output, even though I KNOW the tags are running b/c of the logs.
Matthew Marquand
Ranch Hand

Joined: Dec 19, 2002
Posts: 32
Sorry but I have a couple more questions:
1) Can you see content when you hit the scheduleContent.jsp directly
2) What does the view source look like in both cases? Are they different in either case?
3) Do see the "Schedule for " text in the tile? It seems like you would see this text in the view source even if the tags didn't set the scripting variables (and you would see the html tags for the table and the rows but no text from the scripting variables)
Brian Coles
Greenhorn

Joined: Jul 25, 2002
Posts: 6
Totally just figured out what's going on. And (as usual) I should have known better. At the end of one of the tags, in the doAfterBody() method, I was calling bodyContent.flush(). This (of course) was causing a JspTagException to be thrown and thus, since I wasn't catching an exception on the page, nothing was getting written.
I really appreciate your help, your questions helped me look at the code with a fresh set of eyes.
Matthew Marquand
Ranch Hand

Joined: Dec 19, 2002
Posts: 32
No problem. Glad to help.
More importantly, I'm glad you figured out your problem. Good luck on the soccer site.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with Tiles and Custom Tags
 
Similar Threads
Struts2: Alternative to tiles?
Page is displayed blank for Login Application
Struts tiles help
Access resources from jsp without using "bean:message" tag
Need your help on tiles urgently ~~