Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > nested custom tags in JSP

Reply
Thread Tools

nested custom tags in JSP

 
 
Saurabh Singhania
Guest
Posts: n/a
 
      08-21-2003
Hi All,

Is it possible to pass attributes to a JSP custom tag using another custom
tag? I.e.:

<mytag:something parm1="value1" parm2="<mytagther/>"/>

Works as expected if I pass a string or a JSP expression, but embedded
custom tags are not evaluated. They are simply passed as plain text to my
code, which is of course not very useful.

Any help would be appreciated!

Saurabh
 
Reply With Quote
 
 
 
 
Steve Claflin
Guest
Posts: n/a
 
      08-24-2003
Saurabh Singhania wrote:
>
> Hi All,
>
> Is it possible to pass attributes to a JSP custom tag using another custom
> tag? I.e.:
>
> <mytag:something parm1="value1" parm2="<mytagther/>"/>
>
> Works as expected if I pass a string or a JSP expression, but embedded
> custom tags are not evaluated. They are simply passed as plain text to my
> code, which is of course not very useful.
>
> Any help would be appreciated!
>
> Saurabh


JSP obeys XML rules, which don't allow for a tag within another tag (by
which I mean a tag within the < > for an opening tag).

But, a tag can be contained by another tag (which would actually fit the
definition of nesting), such as:

<mytag:something parm1="value1">
<mytagther />
</mytag:something>

Or maybe:

<mytag:something parm1="value1">
<param>
<name>parm2</name>
<value><mytagther /></value>
</param>
</mytag:something>


Then your logic for mytagther can set values that the
mytag:something.doCloseTag can work with.


--
Steve
--
http://www.steveclaflin.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP Custom Tags as attribute values for other custom tags Dave Java 0 08-14-2006 02:21 PM
JSF tags enclosed in custom JSP tags? koslows Java 0 05-12-2005 08:09 PM
how to write jsp custom tag that can have all kind of jsp elements(not only other tags but also srciplets) in his body Lukasz Indyk Java 1 09-22-2004 12:43 PM
Custom tags and <jsp:plugin> / <jsp:param> Raymond DeCampo Java 0 02-18-2004 01:29 AM
JSP newbie - use include, custom tags, standard tags - or what? Mike Java 3 01-09-2004 09:30 AM



Advertisments