• Post Reply Bookmark Topic Watch Topic
  • New Topic

display fragment and evaluate?

 
Darrell Planet
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to write a tag that takes its body (or a fragment attribute) and displays BOTH the evaluation of the fragment and the fragment unevaluated.

For example:

In JSP:



Would produce (something like):



I've been struggling with this one, and I'm wondering if it is even possible.

Can anyone think how to do this? Any help appreciated...

Darrell.
 
Annie Smith
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by ddd ppp:

I've been struggling with this one, and I'm wondering if it is even possible.

Can anyone think how to do this? Any help appreciated...


It's possible IMO. You just need to search for ${ and } and have some logic to evaluate it. Displaying the results in purely a String manipulation.

It would have been better if you would have posted some of your code. That would have helped in solving the actual problem, rather than typing general replies.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You won't be able to do it with a SimpleTag. You'll need to code the tag using BodyTagSupport.

Check out the getBodyContent() method and BodyContent class.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!