File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes custom tag using SimpleTagSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "custom tag using SimpleTagSupport" Watch "custom tag using SimpleTagSupport" New topic
Author

custom tag using SimpleTagSupport

subathra sangameswaran
Greenhorn

Joined: Nov 19, 2005
Posts: 27
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


suba
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Jan 10, 2002
Posts: 61218
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

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.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: custom tag using SimpleTagSupport