Recursive calls by JSP tag files fail to compile

We're hitting an issue with recursive calls in JSP tag files. I found one unanswered post in the General forum - [Tag Files used recursivily throws exception|https://forums.oracle.com/forums/thread.jspa?threadID=853300] - and was wondering if anyone else has hit this or knows of any work-arounds/patches or knows how to raise suspected bugs with Oracle (when you don't have an official support relationship for WebLogic)?
Example tag file - /WEB-INF/tags/recurse/hello.tag:
<%@ tag body-content="empty" %>
<%@ attribute name="name" required="true" type="java.lang.String"%>
<%@ attribute name="depth" required="true" type="java.lang.Number"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="r" uri="/WEB-INF/tags/recurse/recurse.tld" %>
<table border="1" cellpadding="3" cellspacing="3">
<tr>
<td>
Hello ${name} [${depth}]
</td>
<c:if test="${depth > 1}">
<td>
<r:hello name="${name}" depth="${depth-1}"/>
</td>
</c:if>
</tr>
</table>
Example tld file - /WEB-INF/tags/recurse/recurse.tld:
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
version="2.1">
<description>Library with Recursive tag</description>
<tlib-version>1.0</tlib-version>
<shortname>r</shortname>
<tag-file>
<name>hello</name>
<path>/WEB-INF/tags/recurse/hello.tag</path>
</tag-file>
</taglib>
Example jsp file - /recurse/test.jsp:
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="r" uri="/WEB-INF/tags/recurse/recurse.tld" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Recursive Tag-file Test</title>
</head>
<body>
<c:set var="name" value="${pageContext.request.remoteUser}"/>
<c:set var="depth" value="${5}"/>
<p>Welcome ${name}, here are ${depth} greetings</p>
<r:hello name="${name}" depth="${depth}"/>
</body>
</html>
The expected result from this example would be to get nested 5 HTML tables.
The current behaviour, is the following is shown on screen when loading the test.jsp:
Compilation of JSP File '/recurse/test.jsp' failed:
hello.tag:15:6: Current file's JSP version conflicts with current tag "r:hello"'s.
                    <r:hello name="${name}" depth="${depth-1}"/>
^-----^
hello.tag:15:6: Current file's JSP version conflicts with current tag "r:hello"'s.
                    <r:hello name="${name}" depth="${depth-1}"/>
^-----^
I believe the "JSP version conflicts with current tag" message is misleading (you also get the same error referring to the tag file's folder via a tagdir reference from the JSP and defining an 'implicit.tld' which declares version="2.1"). If you take the recursive <r:hello .../> call out of hello.tag the JSP and tag file compile and function fine. I tried the work around mentioned in the forum post mentioned above, taking the recursive call out, deploying, then putting the recursive tag call back in and just updating the tag file doesn't seem to work for me.
Using "weblogic.appc" you get a few more messages, though the issue is the same - tag file doesn't compile:
test.jsp:15:6: The tag handler class was not found "jsp_servlet._tags._recurse.__hello_tag".
<r:hello name="${name}" depth="${depth}"/>
^-----^
test.jsp:15:14: This attribute is not recognized.
<r:hello name="${name}" depth="${depth}"/>
^--^
test.jsp:15:29: This attribute is not recognized.
<r:hello name="${name}" depth="${depth}"/>
^---^
hello.tag:15:6: The tag handler class was not found "jsp_servlet._tags._recurse.__hello_tag".
<r:hello name="${name}" depth="${depth-1}"/>
^-----^
hello.tag:15:6: Current file's JSP version conflicts with current tag "r:hello"'s.
<r:hello name="${name}" depth="${depth-1}"/>
^-----^
Happy to send this example as an ear/war for anyone that's interested.
At this stage, WebLogic seems to be the only servlet container with this limitation.
This has been tested with WebLogic 10.3.3.0 and 12.1.1.0.
The context for this is that the issue is present in a (larger) enterprise application. The above simple example with recursive tags is what we have isolated as the problem.
Although I/we may not have a support relationship for WebLogic, our clients will, so if the solution is apply an already existing patch that solution would be acceptable.

Somethings definitely wrong with your gcc installation.
Which gcc are you using. What output do you get from "which gcc".
Solaris 10 ships with a gcc in /usr/sfw/bin.
If your using a 3rd party gcc try changing your path to put /usr/sfw/bin before whereever the 3rd party gcc lives. Or just uninstall it.

Similar Messages

  • Calling JSP Tag Files from Coldfusion

    I am trying to call a JSP Tag file from Coldfusion. I am
    getting "Unknown Tag" error.
    Here is the code I have.
    <CFIMPORT TAGLIB="/WEB-INF/lib/mtgTags.jar"
    PREFIX="mtg">
    <mtg:chooseDate appId="1" />
    mtgTags.jar contains a chooseDate.tag file.
    I know CFIMPORT statement above is working fine. Can anyone
    please tell why am I getting "Unknown Tag: chooseDate" error.
    Thanks

    Hi,
    You get the custom tag output into a hidden variable (say 'key') and use the request.getParameter("key")
    Hope u got the answer...
    Regards
    ravi

  • Error in jsp tag files with jdev 101310 and oc4j standalone10130

    Hello,
    I'm creating a simple jsp tag file that show "it´s test" and a jsp with the jsp tag file,
    the problem is:
    java.lang.NoSuchMethodError: oracle.jsp.runtime.OracleJspRuntime.releaseTagHandlers(Ljavax/servlet/jsp/PageContext;)V     at oracle.jsp._tag._tagMeta_tag.doTag(_tagMeta_tag.java:71)     at admin.applicationproperties._jspService(_applicationproperties.java:56)     [SRC:/admin/applicationproperties.jsp:10]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:270)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:204)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)     at com.gtsCol.bonPen.servlets.ApplicationPropertiesServlet.doGet(ApplicationPropertiesServlet.java:51)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    my mail is [email protected]
    thansk for your help.

    Hola a todos,
    Estoy creando un jsp tag file que solo muestra un mensaje "Esto es una prueba" y la incluyo en una jsp normal, el problema es que no parece soportar este tipo de tags.
    El error que muestra es el siguiente.
    java.lang.NoSuchMethodError: oracle.jsp.runtime.OracleJspRuntime.releaseTagHandlers(Ljavax/servlet/jsp/PageContext;)V     at oracle.jsp._tag._tagMeta_tag.doTag(_tagMeta_tag.java:71)     at admin.applicationproperties._jspService(_applicationproperties.java:56)     [SRC:/admin/applicationproperties.jsp:10]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:270)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:204)     at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)     at com.gtsCol.bonPen.servlets.ApplicationPropertiesServlet.doGet(ApplicationPropertiesServlet.java:51)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)     at java.lang.Thread.run(Thread.java:595)
    mi correo electronico es [email protected]
    De antemano gracias por la ayuda que me puedan brindar.

  • How do I pass a local variable as a parameter to a JSP Tag File?

    I wrote a custom JSP tag file, and I want to pass a local variable to it through a parameter, like this:
    <% Integer someValue = new Integer(-5); %>
    <my:TestTag value="someValue"/>
    This doesn't work though - the result is the string someValue. Trying to do this doesn't work either:
    <% Integer someValue = new Integer(-5); %>
    <my:TestTag value="someValue"/>
    the value attribute ends up being null.
    I know I can work arount by putting the local variable in the request attributes then using ${}, but that seems like a lot of unecessary work. Does anyone know I can just pass a local variable to the custom tag through the custom tags parameter list?

    I'm far from beeing an expert, but this may be a clue (?)
    Basically, the rule is: everything you want to be considerred as Java must be in a
    JSP tag.
    As an example, think of how you would do to pass the litteral string "someValue" otherwise. Then you may imagine other related issues...

  • Cobol files fail to compile

    Hi,
    I'm applying the latest MP(cumulative) to FSCM9.0. Cobol files fail to compile with the below error and also some of the cobol files compiled successfully.
    Please find the below error and helps are highly appreciated:
    cob64: error(s) in compilation: CPPIPRDN.cbl
    cp: cannot stat `CPPIPRDN.gnt': No such file or directory
    cp: cannot stat `CPPIPRDN.int': No such file or directory
    ./pscbl_mf.mak : Error : The list of file(s) failed to compile.
    CPPIPRDN fail to compile
    Thank You!
    Best Regards
    Soundappan

    See if CPPIPRDN.lst exists in $PS_HOME/src/cbl/lst and check it for error messages. (might be in a different directory depending on your platform).
    Also, make sure you follow the manual instructions for the MP to copy cobols to the correct directory on UNIX. There is typically a note that says:
    For non Windows-based servers, you must manually copy COBOL files included in this Change Package from %ps_home%\src\cbl\base into %ps_home%\src\cbl before compiling the COBOL programs.
    Regards,
    Bob
    Edited by: BobLilly on May 7, 2012 1:14 PM

  • Search strategy for JSP tag files

    Hello everyone,
    I've been trying to find a solution to this for some time, but couldn't find a clean one. Maybe somewhere here has any ideas for a solution...
    Consider a JSP taglib which is composed of hundreds of .tag files. The library is referenced in JSP using the "*tagdir*" option of the taglib directive, which simply points to /WEB-INF/tags/ (where the .tag files are located).
    Our standard server software distribution includes that tag library, as well as JSP pages that make up the server's web user interface. Those JSP pages use the taglib extensively.
    Now, we want to be able to distribute upgrades to the JSP pages and the tablib, but allow customers to easily customize some tag files without worring about loosing their changes if they apply a future upgrade.
    If it were possible for JSP pages to declare two overlapping taglib directives (same prefix) pointing to two different tagdirs, it would allow us to place our hundreds of .tag files in one "standard" directory, and allow customers to place customized .tag files in another "customized" directory. That way JSP files would always use the same prefix for our tags, but the actual .tag file inserted would be coming either from the customers's "customized" tagdir or from our "standard" tagdir (depending if they chose to override a tag with a customized version or not).
    Is this possible? How do people deal with taglib customization and maintenance issues?
    Thank you!

    Thanks for the reply!
    We use the ClickOnce smart client deployment to the user's machine and we would not want to touch/change anything on the user's machine. So, we can't rely on an environment variable being set.
    It almost seems that the DB Support Team has to not only talk to the Tech Support team and arrange for deploying the right version of the tnsnames.ora file on their users machines, but also talk to the App Deployment Team and provide the most recent version of this file to be used for deployment. So I guess if this file is checked in a code repository, the DB Support team can notify the Tech Support Team and the App Deployment Team to refresh respectively all user machines and application deployment configuration files.
    Alternatively, as one of the app deployment instructions of App Deployment team can be: "check out the most recent version of tnsnames.ora from the repository before deploying the application".
    Any thoughts?
    Thanks.
    Regards,
    gkk1969

  • Class as an attribute name in JSP tag file

    I just ran into an issue where I was writing a custom tag to generate a specific set of HTML elements, and wanted to be able to use CSS the same way I had before refactoring it into a tag. So, I included 'class' as an attribute in the custom tag file and deployed.
    On Glassfish v3, this generated a bunch of JasperExceptions in the Javac compilation, complaining about <identifier> expected and reaching the end of file while parsing. I tracked it down, of course, to the use of 'class' as an attribute name, which was reduced to a servlet class defining:
    public String getClass() {
       return this.class;
    public void setClass(String class) {
       this.class = class;
    }I'm curious -- which part of the process messed up here? Is "class" a valid identifier under the Java EE spec, and the translation should have used something like setClass_(String class_)? Or is it invalid, and Netbeans didn't know to mark it as an error before it tried to deploy? (And, of course, that I missed that in the spec, making it my fault.) I couldn't find anything specifically saying that reserved words couldn't be used as JSTL identifiers, so my gut is that the parser messed up. Also, I found a bug report about it for an alternate web container, but no mention of it in the bug trackers for Glassfish, Tomcat or Jasper.
    Where's the blame?

    stdunbar wrote:
    I think that Netbeans messed up. getClass() is, of course, defined on Object and class is a Java keyword.What's to stop the compiler from recognizing that "class" would be a problem and mapping it to an alternate name behind the scenes?
    This is the only documentation I turned up. Maybe this says it's invalid:
    Java EE SpecThe unique name of the attribute being declared. A translation error results if more than one attribute directive appears in the same translation unit with the same name.A translation error results if the value of a name attribute of an attribute directive is equal to the value of the dynamic-attributes attribute of a tag directive or the value of a name-given attribute of a variable directive.

  • Hyperlink to a zip file fails during compile

    RoboHTML v.5.0.3
    Windows XP, Office 2007
    In my help file I create a hyperlink to a *.zip file (128MB) that is located on my C drive.
    The Zip appears in my baggage files.
    The Zip file contains an .exe and .msi file.
    Everything compiles when creating the chm except the zip file.
    Media Manager Demo 3.0.0.5.zip
    HHC5001: Error:
    Media Manager Demo 3.0.0.5.zip :
    An error occurred while reading "c:\Program Files\RoboHelp Office\RoboHTML\ESI Demo Kit\!SSL!\Microsoft_HTML_Help\!chm_tmp_folder_0\Media Manager Demo 3.0.0.5.zip".
    HHC5003: Error:
    Media Manager Demo 3.0.0.5.zip :
    Compilation failed while compiling Media Manager Demo 3.0.0.5.zip.
    The following files were not compiled:
    Media Manager Demo 3.0.0.5.zip
    I've searched for info on this topic but can't find any. Is it possible to create a hyperlink to a Zip file?
    Any help is appreciated.

    Hi there
    Colum may be spot on, but in case that isn't quite it, you may wish to change the file name so that instead of this:
    Media Manager Demo 3.0.0.5.zip
    It's something like this:
    Media_Manager_Demo_3_0_0_5.zip
    Note that each space now has an underscore as well as each of the dots having underscores.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Recursive jsp tags

    Hi
    I have run into interesting issue which i would like to share. I created simple tag file which code shown below:
    <%@ tag isELIgnored="false" %>
    <jsp:useBean type="view.LeftMenuItem"
    id="currentLeftMenuItem" scope="request"></jsp:useBean>
    <%@ taglib tagdir="/WEB-INF/tags" prefix="fd" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ attribute name="cssClass" required="false"%>
    <%@ attribute name="prefix" %>
    <%@ attribute name="oneClass"%>
    <c:set var="falseVar" value="false" scope="page"/>
    <c:if test="${oneClass eq falseVar}">
    <c:if test="${currentLeftMenuItem.expanded}">
    <c:set var="finalStyle" scope="page" value="${cssClass}_level${currentLeftMenuItem.level}_collapsed"/>
    </c:if>
    <c:if test="${!currentLeftMenuItem.expanded}">
    <c:set var="finalStyle" scope="page" value="${cssClass}_level${currentLeftMenuItem.level}_expanded"/>
    </c:if>
    </c:if>
    <c:if test="${!(oneClass eq falseVar)}">
    <c:set var="finalStyle" scope="page" value="${cssClass}"/>
    </c:if>
    <div>
    ${prefix}
    <fd:linkSubmit action="${currentLeftMenuItem.action}"
    cssClass="${finalStyle}" text="${currentLeftMenuItem.name}">
    </fd:linkSubmit>
    <c:if test="${(currentLeftMenuItem.numberOfSubItems > 0) && (currentLeftMenuItem.expanded )}">
    <div id="${currentLeftMenuItem.hash}">
    <c:forEach items="${currentLeftMenuItem.subItems}"
    var="item">
    <c:set var="item1" scope="request" value="${item}"/>
    <%request.setAttribute("currentLeftMenuItem", request.getAttribute("item1")); %>
    <fd:leftMenuItem cssClass="${cssClass}" prefix="${prefix} " oneClass="${oneClass}"/>
    </c:forEach>
    </div>
    </c:if>
    </div>
    Only last part of this code may be interesting to you. What's strange is that it gives stack overflow exception on compiling. But on another refresh in the browser it works fine. What you can see in bold it's recursive call to the tag itself. From it working I assume, that what I do is allowed (i mean recursive tags), but why does it give stack overflow exc...? Any ideas?

    That's not adequate. JSP re-evaluation is what we're looking for. Consider a simple example where I have a JSP tag that reads a JSP file and outputs it. I want the JSP in the file to be reinterpreted. I want <%=3+3 %> to be spat out as 6, not the string <%=3+3 %>.
    I'd also like:
    <pre>
    <% for(int x=0; x<5 x++){%>
    hello world
    <%}%>
    </pre>
    To print hello world 5 times, etc.
    [email protected] suggested that the ability to "call" other custom tags can be easily be achieved by simply calling their implementation in the same way the JSP container does.
    <pre>
    public int doStartTag() throws JspException{
    try {
    JspWriter out = pageContext.getOut();
    Action1Tag action1 = new Action1Tag();
    action1.setPageContext( pageContext);
    action1.setParent( this);
    action1.setAttribute1(...); // if any attributes..
    action1.doStartTag();
    action1.doEndTag();
    action1.release();
    // follow with action2 & action 3...
    } catch(IOException e) {
    throw new JspException(e.getMessage());
    } return SKIP_BODY;}
    </pre>
    Couldn't we somehow subclass the caller for this functionality and make it re-interpret the page somehow instead of spitting the HTML back to the page directly?
    The web container does it somehow, so obviously it can be done some way.

  • Multiple function signatures in JSP custom tag file

    I'm writing a jsp .tag file and I've encountered the following problem. I have those two functions :
    private void iterateThroughChildElements(Element element)
         for (Iterator i = question.getElements().iterator(); i.hasNext(); )
              this.parseAndDisplay( (Element) i.next() );
    private void parseAndDisplay(Question question)
    private void parseAndDisplay(Answer question)
    (......)Both Answer and Question objects are elements but I get an error from the compiler which says that no correct signature was found for the parseAndDisplay function.
    What could be the problem ? Do I have to cast the objects according to a instanceof comparaison ??

    There was an error in my code, it is as follows :
    private void iterateThroughChildElements(Set elements)
         for (Iterator i = elements.iterator(); i.hasNext(); )
              this.parseAndDisplay( (Element) i.next() );
    }

  • JSP Tag -- Including a JSP fragment in a Java Tag file

    Hi all,
    I have a query regarding JSP Tag file authoring by extending the TagSupport class. I would like to know if it is possible to include a JSP file fragment inside a Java file somehow.
    Specifically, I have created a simple template tag, which adds a header and footer template to the resulting HTML page.
    <bc:template>
    Hello World!
    </bc:template>produces for example
    <html><body>
    Hello World!
    </body></html>Now I have two JSP fragment files (head.jspf and foot.jspf), and I want to do do something like
    public class HtmlTemplateTag extends TagSupport implements TryCatchFinally {
      public int doStartTag() {
        // somehow include head.jspf
        return EVAL_BODY_INCLUDE;
      public void doFinally() {
        // somehow include foot.jspf
    }Which means, I want to execute had.jspf and foot.jspf from the Java class file. I am not sure if it is even possible. If anyone can help me with this, it would be greatly appreciated.
    thanks
    nilesh

    Your intention is to put a header/footer on pages in your web application?
    There is another way to do it - specify prelude/coda jsp fragments in web.xml
    Something like the following:
    <jsp-config>
      <jsp-property-group>
        <url-pattern>*.jsp</url-pattern>
        <include-prelude>/WEB-INF/jspf/head.jspf</include-prelude>
        <include-coda>/WEB-INF/jspf/foot.jspf</include-coda>
      </jsp-property-group>
    <jsp-config>

  • WLS does not handle reusable jar with tag-files?

    I want to encapsulate some tag-files in a re-usable jar that can be included in multiple applications. According to all the documentation that I've found what I need to do is create a jar file containing:
    META-INF/taglib.tld
    META-INF/tags/myTag.tag
    where the taglib.tld contains (among other things):
    <uri>myTag</uri>
    <tag-file>
    <name>someName</name>
    <path>META-INF/tags/myTag.tag</path>
    </tag-file>
    Then I am supposed to take that jar file and put it in my web application under WEB-INF/lib,
    and in my index.jsp I can refer to <%@taglib prefix="myt" uri="myTag">
    However when I do this (on wls 12c) the application seems to deploy ok but when I try to access index.jsp I get:
    weblogic.servlet.jsp.CompilationException: Failed to compile JSP /index.jsp
    index.jsp:14:4: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.
    <%@taglib prefix="tags" uri="myt" %>
    Related facts:
    1. When I deploy these projects in Glassfish it works . as I expected based on the documentation with no errors.
    2. If I copy the tag files and tld with no modification directly into the web application as:
    <my web app>/WEB-INF/taglib.tld
    and <my web app>/META-INF/tags/myTag.tag
    then it does work. However, that prevents me from packaging the tag-files as a re-usable jar.
    (Facts 1 & 2 seem to imply that the files are correct and that WebLogic is not handling the jar correctly?)
    3. I've seen suggestions that there needs to be a <taglib> entry in web.xml. I have tried this and...
    - the text I've seen on the web generates an error. It seems to need to be within a <jsp-config> entry in web.xml.
    - even with this I still get the same error.
    Does anyone have a suggestion for how to get Weblogic to handle tag-files inside a re-usable jar?
    Do you have an example jar you can point me to just to see that it works on my system?
    Is there some special configuration needed by Weblogic to tell it to handle this construct?
    And finally, the error message is saying that one of two things is wrong:
    Either:
    A) it cannot find the referenced taglib file, or
    B) the tld file failed to compile.
    Is there any way for me to find out which of these is happening? The error messages in WLS do not seem to give any more info, so I cannot easily distinguish between these possibilities.
    Thanks for your assistance.

    After 3 days of seeing this error, immediately after posting this request the problem disappeared. Sigh.
    So for now this problem is closed. If it comes back I'll re-post.

  • Ojspc (with JDeveloper 10.1.3.2.0) keeps recompiling .tag files.

    I find it takes an extremely long time to compile my web application with 75 .jsp files (14188 non-blank lines) and 24 .tag files (438 non-blank lines). About 24 minutes, in fact. I attribute this to the utility insisting on recompiling each and every .tag file for every .jsp that uses them.
    During translation, I see the javac process start up several times, and I inspected the javacXXX temporary file that gets created (it stores the VM arguments for each compilation) whenever Oracle needs to compile a page. Now compilation is supposed to happen after translation, but it still happens repeatedly for the same .tag file. If the .tag file is used in each of the 75 .jsp files, then it gets compiled 75 times! I even tried adding the temporary directory where Oracle outputs its .class files for these .tag files to the compilation classpath, and it didn't have any effect.
    I also can't precompile the .tag files in an attempt to force it to use already compiled .tag files, as ojspc doesn't seem to want to translate/compile them on its own (but only as a result of a .jsp that needs them).
    Here are the options in my build.xml:
      <target name="ojspc">
        <path id="ojspc.classpath">
          <fileset dir="${source.web.path}/WEB-INF/lib">
            <include name="*.jar" />
          </fileset>
          <!-- The following is where the .tag files end up after being automatically translated,
               then compiled (even though the compiled versions are .class files and should go in
               oracle/generatedClass, below) -->
          <pathelement path="${build.root}/oracle/generatedJava" />
        </path>
        <property name="ojspc.classpath" refid="ojspc.classpath" />
        <mkdir dir="${build.root}/oracle" />
        <mkdir dir="${build.root}/oracle/generatedClass" />
        <mkdir dir="${build.root}/oracle/generatedJava" />
        <oracle:compileJsp verbose="true"
          appRoot="${build.webapp.path}"
          dir="${build.root}/oracle/generatedClass"
          srcDir="${build.root}/oracle/generatedJava"
          addClassPath="${ojspc.classpath}">
          <fileset dir="${build.webapp.path}">
            <include name="**/*.jsp" />
          </fileset>
        </oracle:compileJsp>
      </target>There's nothing particularly memorable about the ant output. Everything succeeds. But 24 minutes for 15k lines of JSP sounds pretty ridiculous... this whole endeavor was an attempt to reduce initial page hit lags after deployment, but ..... 24 minutes??? :)
    Thanks,
    Scott

    Marco,
    the bug is published and visible in Metalink.
    - Select "Document Id" in "Quick find"
    - enter the bug number: 4556035
    - click "Go"
    Bug 4556035 is fixed in JDeveloper 10.1.3.3
    It's also included in http://www.oracle.com/technology/products/jdev/htdocs/10.1.3.3/fixlist.htm
    Regards,
    Didier.

  • Precompiling tag files

    It is a fairly common approach to precompile all the jsp pages in your web application, and have it generate servlet and servlet-mapping entries for your web.xml file.
    Is there a similar approach for tag files?
    Something that would take a bunch of tag files, translate them, compile them, generate a tld and then bundle it all into a jar file for distribution.
    The best solution I have come up with so far is to have a "compile-time" jar file which bundles the tag files, and a tld referencing them with <tag-file> entries.
    When pre-compiling the jsps, I can include this in the path, and it will translate/compile the tag files on demand along with the jsp pages.
    I'm just trying to go the next step further.
    Has anybody tried (or even wanted to) do something like this?

    It turns out I misunderstood the problem a little.
    The tag files are only needed when you run the jsp compiler.
    It never DOES generate a tld file.
    The .tag files are not required at runtime - exactly like the jsps are not required at runtime.
    With Tomcat at least, the compiled JSP includes the required generated classes from the .tag files.
    So in effect there is no change from previous. You pre-compile your JSPs as usual, and it worries about picking up the tag files at that time.
    In effect the .tag files are just an extra resource needed to precompile your page, and don't need to be passed further down the process.
    At least thats what I remember of it.
    hope this helps,
    evnafets

  • Multiple function signatures in .tag file

    I'm writing a jsp .tag file and I've encountered the following problem. I have those two functions :
    private void iterateThroughChildElements(Element element)
         for (Iterator i = question.getElements().iterator(); i.hasNext(); )
              this.parseAndDisplay( (Element) i.next() );
    private void parseAndDisplay(Question question)
    private void parseAndDisplay(Answer question)
    (......)Both Answer and Question objects are elements but I get an error from the compiler which says that no correct signature was found for the parseAndDisplay function.
    What could be the problem ? Do I have to cast the objects according to a instanceof comparaison ??

    Both Answer and Question objects are elements but I
    get an error from the compiler which says that no
    correct signature was found for the parseAndDisplay
    function.The compiler is borking with the following line this.parseAndDisplay( (Element) i.next() ); You are telling it you are passing an (Element) but you have only implemented the specific function for (Question) and (Answer).
    What could be the problem ? Do I have to cast the
    objects according to a instanceof comparaison ??Use polymorphism and add the function
    private void parseAndDisplay((Element) element) {
    element.parseAndDisplay() ;
    }Then move the parse and display functionality from this class into the similar named functions in the Question and Answer classes.

Maybe you are looking for

  • No Wi-Fi Option in Windows 8

    Hi, I've created a dual boot system on my Dell Inspiron 15R (5520) in which the laptop came with pre-installed windows 7 OS. I later installed windows 8 OS along with Windows 7 for my work. But I cannot see any Wi-Fi option in my settings charms bar.

  • Entry during GR of a batch

    Dear Experts, During GR of raw material from vendor we want to enter the next inpection date in the batch itself .But the fields for the characteristics appears grey and is not allowing to enter the next inspection date in the batch . Please suggest

  • Transport after changes

    i have made a changes in a Multiprovider recently. I alreday had transfered the same MP using transport connection in BI 7.0 Do i need to use transport connection again to transfer the new chnages and go through collecting the MP and the process of i

  • Default application for maps...

    Is there a way to switch the default map application from "Maps" to the TomTom Navigation? For example, if I use either Urbanspoon to find a restaurant, or the Starbucks application to find a nearby location, when getting directions, the iPhone uses

  • Can't prevent Firefox from blocking a https site whose certificate has not been identified

    I am trying to connect to an https URL that has issued a certificate that is not valid, for the issuer is unknown: https://www.sede.fnmt.gob.es/certificados/persona-fisica/obtener-certificado-software/solicitar-certificado I am aware of this and I ac