This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes [Struts 2] Custom Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[Struts 2] Custom Tag" Watch "[Struts 2] Custom Tag" New topic
Author

[Struts 2] Custom Tag

Fabian Angy
Ranch Hand

Joined: Oct 27, 2008
Posts: 90
Hello!

I created my own tag which I use like this



I would like for example to put a variable inside (Like this: <panelTag:description description="<s:property value="myvariable"/>).

But, <s:property>doesn't work thus I wondered if there was some ways to do something like this?

Or to use a string between the start and the end of my tag? (example: <panelTag:description> my string </panelTag:description>)

Thanks in advance!


SCJP 5
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can't nest custom tags like that; that's just the way JSP works.

You could just use JSP EL there, ${}. Struts 2's custom request wrapper allows this.
Fabian Angy
Ranch Hand

Joined: Oct 27, 2008
Posts: 90
David Newton wrote:You can't nest custom tags like that; that's just the way JSP works.

You could just use JSP EL there, ${}. Struts 2's custom request wrapper allows this.


Thanks a lot! :mrgreen:
 
Don't get me started about those stupid light bulbs.
 
subject: [Struts 2] Custom Tag