Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJWCD
Search Coderanch
Advance search
Google search
Register / Login
Help coderanch get a
new server
by contributing to the
fundraiser
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
Ron McLeod
Paul Clapham
Devaka Cooray
Liutauras Vilda
Sheriffs:
Jeanne Boyarsky
paul wheaton
Henry Wong
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Tim Moores
Carey Brown
Mikalai Zaikin
Bartenders:
Lou Hamers
Piet Souris
Frits Walraven
Forum:
Web Component Certification (OCEJWCD)
How to get body-content value in my custom tag?
somjet thana
Greenhorn
Posts: 7
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
in
jsp
file
<% request.setAttribute("name", "tom"); %> <myTag:greeting>${name}</myTag:greeting>
How to get body-content(name) value in MyTag.doTag(), if MyTag extends SimpleTagSupport?
Thanks
Somjet
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you want to simply output the body :
getJspBody().invoke(null);
If you want to do something with the body :
StringWriter sw = new StringWriter(); getJspBody().invoke(sw);
[My Blog]
All roads lead to JavaRanch
somjet thana
Greenhorn
Posts: 7
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
and how to get only
string
value of body-content in doTag()
String bodyContentValue = ???
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Call the StringWriter#toString method.
[My Blog]
All roads lead to JavaRanch
somjet thana
Greenhorn
Posts: 7
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks.
with jsp code
<myTag:xxx>${name}</myTag:xxx>
Which is the correct use of EL(${name})?
1.use ${name} to input name param to doTag()
2.use ${name} to display name when we use getJspContext().setAttribute("name", "tom")
3.all correct
thanks
somjet
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
They all sound badly written. Where did you get them from ?
[My Blog]
All roads lead to JavaRanch
somjet thana
Greenhorn
Posts: 7
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
it is my doubt.
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Doubt in HeadFirst question
Reading the META tag in a Servlet
How to Upload the Client File To The Server
question about custom tag
Tile Problem
More...