permaculture playing cards*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes How to get body-content value in my custom tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "How to get body-content value in my custom tag?" Watch "How to get body-content value in my custom tag?" New topic
Author

How to get body-content value in my custom tag?

somjet thana
Greenhorn

Joined: May 17, 2006
Posts: 7
in jsp file


How to get body-content(name) value in MyTag.doTag(), if MyTag extends SimpleTagSupport?

Thanks
Somjet
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If you want to simply output the body :


If you want to do something with the body :


[My Blog]
All roads lead to JavaRanch
somjet thana
Greenhorn

Joined: May 17, 2006
Posts: 7
and how to get only string value of body-content in doTag()
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Call the StringWriter#toString method.
somjet thana
Greenhorn

Joined: May 17, 2006
Posts: 7
Thanks.
with jsp code


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

Joined: Nov 24, 2005
Posts: 14687
    
  16

They all sound badly written. Where did you get them from ?
somjet thana
Greenhorn

Joined: May 17, 2006
Posts: 7
it is my doubt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get body-content value in my custom tag?
 
Similar Threads
Reading the META tag in a Servlet
question about custom tag
Tile Problem
Doubt in HeadFirst question
How to Upload the Client File To The Server