• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help : Can Custom Tag output another tag?  RSS feed

 
HanMing Low
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm facing a problem which I greatly appreciate some advice.
I'm suppose to write a webapp that can be deployed to a normal web container and Weblogic Portal.
The problem is Weblogic portal handle <a href="./nextjsp.jsp"> differently.
i.e.
<a href="<portlet:createWebflowURL event="event1"/>">
Thus, I'm thinking of using
<a href="<mytag:url ="./nextjsp.jsp/>>"
where mytag is a CustomTag I have created
In mytag,

Line 1 is successful.
But, Line 2 does not produce the output in the portal action as desired. In fact, nothing is printed, not even a string "("<formatter ortal />".
Thus, my guess is the action is called but the output is send to somewhere else.
Can anyone suggest how do I go about correctly creating a Tag that will return another tag.
Thanks in advance.
Cheers.

Han Ming
 
Paul Lester
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tags cannot return data and therefore cannot be an expression. You could use nested tags and use the getParent method in the tag to get information about the parent tag.

The parent tag would, of course, need to be able support a body.
Also, if you can put your url inside of a JavaBean then you could use it as part of an expression, but not with a tag.
Here is a link that might help you.
Regards,
Paul
[ May 19, 2003: Message edited by: Paul Lester
[ May 19, 2003: Message edited by: Paul Lester ]
[ May 19, 2003: Message edited by: Paul Lester ]
 
HanMing Low
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
Thanks for your reply.
I'm reading through the link and still trying out some examples.
However, for the moment, I settle with the following workaround.
i.e.
in my tag, I actually create a formatter tag object and call the doStartTag of Weblogic Portal portlet tag.
At least it works fine for me.
And, from the JSP point of view, it's neater to include a nested tag.
But from the, tag class point of view, it's untidy.
Any violation of rules if I do it this way?
Advice welcome.
Cheers.

Han Ming
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!