wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Struts 2] Custom Tag
 
Similar Threads
How to merge 2 columns in display tag
how to use java.util.Calendar in S2
struts 2.0 iterator
Equivalent of logic iterate in Struts 2
<s:property> tag rendered as HTML