aspose file tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply 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: 14672
    
  11

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: 14672
    
  11

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: 14672
    
  11

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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to get body-content value in my custom tag?
 
Similar Threads
question about custom tag
Tile Problem
Doubt in HeadFirst question
How to Upload the Client File To The Server
Reading the META tag in a Servlet