• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom tag using SimpleTagSupport

 
subathra sangameswaran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have an attribute simpleAtt in my custom tag. When I invoke the tag, i give a value which gets manipulated inside the doTag() method. Then I do
getJspBody().invoke(null); in this method.
In the body of my tag, i try to display the value of this tag using the code
<x:testtgh simpleAtt="xyz">
my simpleatt ${pageScope.simpleAtt}
</x:testtgh>
But I do not get the value of the simpleAtt value printed.
Is not the attribute set in the pageSope?
Where does the problem lie?
Thanks
Subha
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tag questions get better answers in the JSP forum. I'll move your thread over there for you.

Dave
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is not the attribute set in the pageSope?


Not automatically. If you want the value placed into page scope, you need to set it there in your tag handler.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Not automatically. If you want the value placed into page scope, you need to set it there in your tag handler.


This looks quite different from <c:set> tag of JSTL. Where when we don't specify the scope the attribute is placed in PageScope by default. Does this mean the tag handler of <c:set> does the work of setting the default scope to PageScope.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The behavior of the <c:set> tag has little to do with this question. The <c:set> tag handler has code that applies the semantics of the tag. This has nothing to do with the behavior of the tag handling support classes.
[ November 24, 2005: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic