This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSP and the fly likes Custom Tag Parameters as values from other Custom Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom Tag Parameters as values from other Custom Tags" Watch "Custom Tag Parameters as values from other Custom Tags" New topic
Author

Custom Tag Parameters as values from other Custom Tags

John Brumbaugh
Greenhorn

Joined: Jan 08, 2002
Posts: 5
Is it possible to have the parameter of a custom tag be filled by another custom tag? I thought you could do it, if you set the tag's attribute that you want to be able to have the content poopulated by a custom tag retexprvalue item to true. But I get the same error when I do that as when I do not have that there.
Here is an exampl of what I am trying to do with the relevant TLD snippets below as well.


TLD File:

[ January 09, 2002: Message edited by: John Brumbaugh ]
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

First of all, which App server are you using? What is the error message you're getting?
The JSP 1.2 spec doesn't come out and say this is legal or not, the only relative line I could find was this:
JSP7.5 Validation
There are a number of reasons why the structure of a JSP page should conform to some validation rules:
* Request-time semantics: eg. a subelement may require the information from some enclosing element at request-time

So... according to that, it seems as though its possible... but of course it also seems up to the interpretation of the Application Server Developer.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
John Brumbaugh
Greenhorn

Joined: Jan 08, 2002
Posts: 5
I am using Apache Tomcat 4.0.1 and the error message that I am getting is:

I know it is possible if I use scriptlets and not custom tags, but we are trying to separate code from presentation, and we want to have no JSP Scriptlet tags in the presentation files.
[ January 09, 2002: Message edited by: John Brumbaugh ]
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

It looks like TomCat is getting confused by all the <'s in the code and isn't parsing it correctly (which is what I suspected)

Actually... now that I think about it... I don't know if it is possible... 'cause the above isn't valid XML code...
Anyone else have any ideas?
[ January 09, 2002: Message edited by: Jessica Bradley ]
Stephen Pride
Ranch Hand

Joined: Sep 14, 2000
Posts: 121
I'm relatively new with JSP custom tags, but it would seem like a nested tag would work for this situation. Something like ...

But like I said, I'm still trying to figure this out myself.


SCJP
 
 
subject: Custom Tag Parameters as values from other Custom Tags