• 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

Problem with Tiles and Custom Tags

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No problem. Glad to help.
More importantly, I'm glad you figured out your problem. Good luck on the soccer site.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic