java - jsp Custom Tag: doAfterBody method is not invoked -


the below code not working in jboss 7. have tested in tomcat 7.

the root cause constructor , doafterbody method not invoked <xml> tag. though getting invoked parent tag <xslt>.

when child tag <xml> moved outside <xslt> works. means child tag not recognised.

.tld file:

<?xml version="1.0" encoding="utf-8"?>  <taglib>   <tlib-version>1.0</tlib-version>   <jsp-version>1.2</jsp-version>   <short-name>xx</short-name>   <uri></uri>    <tag>     <name>xml</name>     <tag-class>com.mycompany.xsltxmltag</tag-class>     <body-content>tagdependent</body-content>   </tag>    <tag>     <name>xslt</name>     <tag-class>com.mycompany.xslttag</tag-class>     <body-content>tagdependent</body-content>   </tag>  </taglib> 

tag class <xml> tag:

public class xsltxmltag extends bodytagsupport {      public xsltxmltag() {         log("constructor not invoked.");     }      public int doafterbody() throws jspexception {         log("this method not invoked.");         ...     }      ... } 

jsp:

<%@ taglib uri="xmlx.tld" prefix="x"%>  ...  <x:xslt media="html">     <x:xml>         <?xml version="1.0" ?>         ...     </x:xml>      ... </x:xslt> 

it working in tomcat 7, after setting <body-content> jsp instead of tagdependent. but, in jboss 7, tld validation failing <body-content>jsp</body-content>

in jboss 7, works <body-content>scriptless</body-content>. but, have scripts such <%= contextpath%> , <jsp:expression> inside <xml> tag.

how fix it?

child tag <xml> processed after setting <body-content> scriptless. and, have replaced scripts inside <xml> tag custom tags.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -