Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does SimpleTag Nesting allowed( yes. resolved)

 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am testing SimpleTags for the first time.
I am unable to do SimpleTag nesting.
Is it supported ?
Please let me know.

[ August 12, 2007: Message edited by: Srinivasan thoyyeti ]
[ August 13, 2007: Message edited by: Srinivasan thoyyeti ]
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini,

I think, we can do as we have "Tag getParent()" method that comes from the Tag
interface (also from the SimpleTag interface that returns JspTag).


Let me also give it a try!!!
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandra,

1.SimpleTags nesting not working !!!
(resolsved now)

2.But just now executed Classic Tag nesting. Its working nice.

3. Classic Parent and SimpleTag child combination also works

Anybody who have worked on SimpleTags, please let me know whats the reason?
I have tried with like this



[ August 12, 2007: Message edited by: Srinivasan thoyyeti ]
[ August 13, 2007: Message edited by: Srinivasan thoyyeti ]
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini,


I have tried the following and it works well for me:

TestNested.jsp


MyTld.tld


Parent.java



Child.java


Output:

[one, two, three]

Does this help you?

Thanks,
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srinivasan, can you post the code that is not working? You should be able to nest Simple tags...
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini,



This returns 3




Thanks,
[ August 12, 2007: Message edited by: Chandra Bhatt ]
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chandra, I am just curious. Would the code execute the same if you used

if(fr != null) fr.invoke(null);

instead of

if(fr != null) fr.invoke(getJspContext().getOut());
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah Michael!

The same I did in my first example.
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I had noticed that you used null in you first example but not in the second. Since the second example had the same tag inside of itself (and therefore you have a tag that has an instance of itself as part of its body) and you did not use null, I was curious if there was a reason for not using null (perhaps some kind of strange recursion problem). I did not think so.

Thanks for the confirmation
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Micheal and Chandra,

I did a silly mistake you never believe that I did it that way....

take a deep breath before seeing my silly mistake


*

*

*

*


*


I did not invoke the body in Parent.

[ August 13, 2007: Message edited by: Srinivasan thoyyeti ]
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it happens to us all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic