Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[Struts 2] Custom Tag

 
Fabian Angy
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic