Alberto Moreno López wrote:
Hello:
I have a web application that use struts, displaytag, struts-menu-taglib,
ajaxtags. One of the problems that I have encounter is the use of taglibs
that returs "<a href>", "<img>",....
IFor example: I'm using struts bridge and I have a problem with a taglib that I have
designed. My tag returns a Html code like this:
<div id="horMenu"> <ul> <li><a href="#"><img border="0" width="12" height="12"
src="modules/common/themes/default/resources/images/q1.gif"
align="absmiddle"/>General</a> <ul> <li><a href="modules.common.Initiation.do">Index</a></li> <li><a href="#">Configuration</a></li> <li><a href="#">Preferences</a></li> </ul>
   </li>
   <li><a href="#"><img border="0" width="12" height="12"
src="modules/common/themes/default/resources/images/q2.gif"
align="absmiddle"/>Tools
</a> <ul> <li><a href="modules.repository.Repository.do">Repository</a></li> </ul> </li> </ul> </div> I have tried to sustitute the anchor by "<html:link>" but the JSP don´t
evaluate the generated code and in the page I have this code:
<div id="horMenu"> <ul> <li><html:link href="#"><html:img border="0" width="12" height="12"
src="modules/common/themes/default/resources/images/q1.gif"
align="absmiddle"/>General</html:link> <ul> <li><html:link href="modules.common.Initiation.do">Index</html:link></li> <li><html:link href="#">Configuration</html:link ></li> <li><html:link href="#">Preferences</html:link ></li> </ul>
   </li>
.........
.........
The problem is that the generated code returns "<a href>" and the
struts-bridge work bad with this sentence.
I don't understand what you mean by work "bad".
<a href=""> itself won't be a problem, the value of the href attribute might 
though.

There are two solutions to get existing taglibs working with the Struts Bridge:
1) Pass in a fully qualified url for action and render links or resource 
(image) source refs
   using the <html:rewrite> Struts tag directly or through a set JSP page 
context attribute.
   Your taglib should specify <rtexprvalue>true</rtexprvalue> for the attribute 
in question
   so it will evaluate it.
2) modify your taglib implementation to use the StrutsPortletURL directly 
yourself to generate
   a valid PortletURL (note: for resource urls, you need to prefix the url with 
the contextPath
   to get it qualified).

What can I do to solve these problems to migrate my web application to a portlet using many taglibs???? Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to