JSF 2.0 tag library as distributed is incomplete?

Hi all,
I've spent a good chunk of 2 days at this and i'm pulling my hair out as i speak. I've installed mojarra 2.0.3 FCS in my Netbeans 6.7.1 installation. I now tried to use the <h:head> tag but for some reason, i keep getting a "org.xml.sax.SAXException: No tag "head" defined in tag library associated with uri "http://java.sun.com/jsf/html"" meaning the tag/tag handler does not exist in the package. I've downloaded every other build of mojarra on the site with the same results. my declaration goes :
<jsp:root version="2.1" xmlns:x="http://www.w3c.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:df="http://java.sun.com/jsf/dynamicfaces" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:p="http://primefaces.prime.com.tr/ui" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
i'm using dynamic faces, primefaces and woodstock in this project. the other html jsf tags are available except h:head which i need. what am i doing wrong? please help me out here. i 've exhausted my little mind @ this.

Moderator advice: Please don't post to threads which are long dead, and don't hijack another poster's thread. When you have a question, start your own thread. Feel free to post a link to a related thread.
Moderator action: Locking this thread.
db

Similar Messages

  • Jsf-1_0-pfd-spec.pdf - 9.5 Standard HTML RenderKit Tag Library

    I am somewhat confused by section 9.5 in jsf-1_0-pfd-spec.pdf.
    It ends with
    "Each action included in the Standard HTML RenderKit Tag Library is documented
    in a subsection below, with the following outline for each action:"
    I however seem to miss these subsections.
    Am I interpreting something wrong or is there stuff missing?
    Thanks,
    Peter

    The description of Std HTML Renderkit (8.5 ) as well as the Std HTML tag library will be updated by the next release. In the mean time, please refer to the TLD. Sorry for the confusion if any.
    -Jayashri

  • How to include javascript resources in  Facelet tag library

    I've been trying out Duncans watermark behavior tag (https://blogs.oracle.com/groundside/entry/placeholder_watermarks_with_adf_11). Indeed a great article and the example work perfectly when the tag library is included within the project and when the javascript resource (common.js) file is added to the document using af:resource tag.
    I would like to create a deployable tag library, including a setWatermarkBehavior tag, for reuse in various apps. I'm able to create and deploy the tag library as a ADF library and include it for use in an application. But on runtime, the pages are not able to find the "addWatermarkBehavior" method, which I hoped automatically got loaded from the javascript file defined in the tag library jar. In the tag library file, I've added a "adf-js-features.xml" in META-INF. This file and the .js file is included in the ADF library jar. "adf-js-features.xml" looks like this:
    <adf-js-features xmlns="http://xmlns.oracle.com/adf/faces/feature">
    <features xmlns="http://xmlns.oracle.com/adf/faces/feature">
    <feature>
    <feature-name>adfExtTaglib</feature-name>
    <feature-class>com/cgi/adf/ext/taglib/js/adfExtTaglib.js</feature-class>
    </feature>
    </features>
    </adf-js-features>
    I'm not sure, what value should be used for "feature-name" - I've tried many different "meaningful" names. I presume, that the ADF framework, should automatically discover all "adf-js-features" files and automatically load js-file on pages, which are using tags from the particular tag library. But apparently I'm missing something. In the facelets page used for testing, I have these few components.
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:adfext="http://xmlns.cgi.com/adf/ext">
    <af:document title="testAdfExtTaglib" id="d1">
    <!-- af:resource type="javascript" source="/resources/js/common.js" / -->
    <af:form id="f1">
    <af:inputText label="Label 1" id="it1">
    <adfext:setWatermarkBehavior value="CHR-Nr"/>
    </af:inputText>
    </af:form>
    </af:document>
    </f:view>
    Doing some debugging, I can confirm that the "getScript" method of the setWatermarkBehavior class is called. I can also find the javascript produced by the "getScript" method in the DOM. But I cannot find anywhere in the DOM, where the javascript file from the tag library is loaded.
    Please, help me out?
    Edited by: wmjaboj on 2012-09-23 23:58

    The Javascript source URI has the value "RES_NOT_FOUND".
    If I try to access it using ".../faces/javax.faces.resource/javascript.js?ln=js" I get a blank page (contains a Html and Body only).
    If I try to access it using ".../faces/resources/js/javascript.js" I can download the javascript file from the taglib.
    If I manually copy the javascript.js file from the taglib into the enclosing project and save it in "resource/js", then the javascript source URI is resolved correctly to ".../faces/javax.faces.resource/javascript.js?ln=js" and I can downloaded it, but then it is the local copy and not the one from the taglib jar.
    Do I need some specific configuration in web.xml or other deployment descriptors, to be able to use "javax.faces.resource"?
    The only configurations whoch smells like "javax.faces.resource" is this context param: javax.faces.FACELETS_RESOURCE_RESOLVER=oracle.adfinternal.view.faces.facelets.rich.AdfFaceletsResourceResolver
    In web.xml various "resource" servlets is defined (I'm not sure whether I need them, JDeveloper has created them automatically):
    a) resources = org.apache.myfaces.trinidad.webapp.ResourceServlet, maps to: /adf/*, /afr/*, /bi/*
    b) adflibResources = oracle.adf.library.webapp.ResourceServlet, maps to: /adflib/*
    I appreciate your help.

  • Custom tag library called multiple times

    Hi ppl ,
    I have a custom tag library which i use to populate some menu components. When i do call my custom tag library though , it is called multiple times, use case is as follows.
    I have menu tabs and menu bars which thanks to Mr.Brenden is working splendidly as so:-
    <af:menuTabs>
    <af:forEach var="menuTab" items="#{bindings.menu.vwUserMenuTabRenderer.rangeSet}">
    <af:commandMenuItem text="#{menuTab.MenuLabel}"
    shortDesc="#{menuTab.MenuHint}"
    rendered="true"
    immediate="true"
    selected="#{sessionScope.selectedMenuId == menuTab.MenuId }"
    onclick="fnSetSelectedValue('#{menuTab.MenuId}')" >
    </af:commandMenuItem>
    </af:forEach>
    </af:menuTabs>
    <af:menuBar>
    <af:forEach var="menuBar" items="#{bindings.menu.vwUserMenuBarRenderer.rangeSet}">
    <af:commandMenuItem onclick="return clickreturnvalue()"
    onmouseover="dropdownmenu(this, event,#{menuBar.MenuId}, '150px')"
    onmouseout="delayhidemenu()"
    text="#{menuBar.MenuLabel}"
    action="#{menuBar.MenuUri}"
    rendered="#{menuBar.ParentId == sessionScope.selectedMenuId}"
    immediate="true" />
    </af:forEach>
    </af:menuBar>
    </afc:cache>
    now all of this code is within a subview , and just directly below the subview tag , i have the call to my custom tag library:-
    <myCustomTagLib:menuCascade />
    only issue now is that assuming i have in all 7 menu bar components, the doStartTag is called 7 times. the relevant code within my custom tag class is as follows :-
    public int doStartTag() throws JspException {
    return (EVAL_BODY_INCLUDE);
    public int doEndTag() throws JspException {
    try {
    declareVariables();
    return EVAL_PAGE;
    }catch (Exception ioe) {
    throw new JspException(ioe.getMessage());
    and within my declareVariables method i do an out of the jscript ( out.print(jscript.toString()); ) which is a simple string generated based on certain conditions...
    now it seems to be working fine on the front end , but when i view the source of the page, i notice that the declaration is called multiple times, and this happens because the doStartTag method is called multiple times, i haven't even nested the call to the custom tag within the menu components , any clue as to whats going wrong ?
    Cheers
    K

    Hi,
    if you add the following print statement
    System.out.println("rendering "+FacesContext.getCurrentInstance().getViewRoot().getViewId());
    Then the output in my case is
    07/04/24 08:14:04 rendering /BrowsePage.jsp
    07/04/24 08:14:05 rendering /otn_logo_small.gif
    The image comes from the file system, which means it is rendered by the JSF lifecycle. If you reference the image with a URL then the lifecycle doesn't render the image but only refrences it.
    To avoid your prepare render code to be executed multiple times, just check for jsp and jspx file extensions, which will guarantee that your code only executes for JSF pages, not for loaded files.
    The reason why this happens is because the JSF filter is set to /faces , which means all files that are loaded through that path
    Frank

  • No tag library

    I get the following error after I reopened my project and attempted to run it:
    "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."
    "The deferred EL expression is not allowed since deferredSyntaxAllowedAsLiteral is false."
    Any help getting this resolved would be appreciated.
    Thanks,
    Russ

    You'd better give us more information:
    What version of JDeveloper? What tag libraries are you using? Are you writing JSPs or JSFs? Using JSP format or JSPX? Using the JDeveloper built in libraries, or did you add an additional one?

  • No tag "output_text" defined in tag library imported

    Dear All,
    I have the following jsp file.
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
    <head>
    <title>Welcome to PizzaRia!!!</title>
    <link rel="stylesheet" type="text/css"
    href="<%= request.getContextPath() + "/Styles.css" %>">
    </head>
    <body>
    <f:view>
    <h:form id="myForm">
    <table border="0" cellspacing="4" cellpadding="0"
    width="<h:output_text value="#{initParam.pageWidth}"/>">
    <tr>
    <td colspan="2">
    <%-- The header --%>
    <%@ include file="header.jsp"%>
    </td>
    </tr>
    <tr>
    <td valign="top">
    <%-- The menu --%>
    <%@ include file="menu.jsp"%>
    </td>
    <td valign="top">
    <!--------------- the beginning of the Welcome page ------------->
    <br>
    <div class="NormalLarge">Welcome to PizzaRia!!!</div>
    <br>
    <div class="NormalSmall">Try our tasty pizzas today!</div>
    <!--------------------- the end of the Welcome page ------------->
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <%-- The footer --%>
    <%@ include file="footer.jsp"%>
    </td>
    </tr>
    </table>
    </h:form>
    </f:view>
    </body>
    </html>
    When it comes to deployment, tomcat gives the following error saying that the tag is not defined.
    Any suggestions. highly appreciated.
    org.apache.jasper.JasperException: /index.jsp(14,9) No tag "output_text" defined in tag library imported with prefix "h"
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Jaliya

    thnx BalusC,
    I'm new to this stuff. That was the problem.
    Thanks again,
    Jaliya

  • No tag library could be found with this URI - MyFaces with weblogic 9.2

    I am deploying an application written using MyFaces(JSF1.1) + Tiles in weblogic 9.2. I am getting the following error when I acess any page..
    Time[2009-01-28 02:02:33,039] [ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'::: ERROR javax.faces.webapp._ErrorPageWriter - - Message[-An exception occurred]
    javax.faces.FacesException
         at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.renderTilesView(JspTilesTwoViewHandlerImpl.java:126)
         at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.renderView(JspTilesTwoViewHandlerImpl.java:110)
         at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:146)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:147)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Caused by: org.apache.tiles.TilesException: Error including path '/template/template.jsp'. Failed to compile JSP /template/template.jsp
    template.jsp:1: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 uri="http://richfaces.org/rich" prefix="rich"%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
    ^----^
    template.jsp:1: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 uri="http://richfaces.org/rich" prefix="rich"%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
    ^----^
    template.jsp:2:5: 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 uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    ^----^
    template.jsp:2:5: 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 uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    ^----^
    template.jsp:3:5: 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="f" uri="http://java.sun.com/jsf/core" %>
    ^----^
    template.jsp:3:5: 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="f" uri="http://java.sun.com/jsf/core" %>
    ^----^
    template.jsp:4:5: 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="h" uri="http://java.sun.com/jsf/html" %>
    ^----^
    template.jsp:4:5: 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="h" uri="http://java.sun.com/jsf/html" %>
    ^----^
    template.jsp:5:5: 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 uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
    ^----^
    template.jsp:5:5: 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 uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
    ^----^
         at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:427)
         at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:370)
         at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.renderTilesView(JspTilesTwoViewHandlerImpl.java:124)
         ... 22 more
    Caused by: java.io.IOException: Error including path '/template/template.jsp'. Failed to compile JSP /template/template.jsp
    template.jsp:1: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 uri="http://richfaces.org/rich" prefix="rich"%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
    ^----^
    template.jsp:1: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 uri="http://richfaces.org/rich" prefix="rich"%><%@ page contentType="text/html;charset=UTF-8" language="java" %>
    ^----^
    template.jsp:2:5: 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 uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    ^----^
    template.jsp:2:5: 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 uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    ^----^
    template.jsp:3:5: 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="f" uri="http://java.sun.com/jsf/core" %>
    ^----^
    template.jsp:3:5: 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="f" uri="http://java.sun.com/jsf/core" %>
    ^----^
    template.jsp:4:5: 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="h" uri="http://java.sun.com/jsf/html" %>
    ^----^
    template.jsp:4:5: 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="h" uri="http://java.sun.com/jsf/html" %>
    ^----^
    template.jsp:5:5: 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 uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
    ^----^
    template.jsp:5:5: 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 uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
    ^----^
         at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:201)
         at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:185)
         at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:419)
         ... 24 more
    Time[2009-01-28 02:02:33,039] [ACTIVE] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'::: TRACE javax.faces.webapp.FacesServlet - - Message[-service end]
    Any idea why this error is coming? I see all the jar files in APP-INF/lib folder.

    Hi fechen,
    Could you please give your solution more detail?
    Here is my weblogic.xml. The issue still exist.
    <!DOCTYPE weblogic-web-app PUBLIC
    "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app>
    <jsp-descriptor>
    <jsp-param>
    <param-name>pageCheckSeconds</param-name>
    <param-value>-1</param-value>
    </jsp-param>
    </jsp-descriptor>
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    <implementation-version>1.2</implementation-version>
    <exact-match>false</exact-match>
    </library-ref>
    <container-descriptor>
    <servlet-reload-check-secs>-1</servlet-reload-check-secs>
    <prefer-web-inf-classes>false</prefer-web-inf-classes>
    </container-descriptor>
    <context-root>/DataServices</context-root>
    </weblogic-web-app>

  • The function "containsIgnoreCase" for prefix "fn" can not be found in the specified tag library.

    Hi All,
    I am getting this error on my jsff
    The function "containsIgnoreCase" for prefix "fn" can not be found in the specified tag library.
    jsff includes -
         <jsp:root   xmlns:f="http://java.sun.com/jsf/core"
              xmlns:fn="http://java.sun.com/jsp/jstl/functions"
              xmlns:c="http://java.sun.com/jsp/jstl/core">
    Error at this line -    <af:inputListOfValues
                                                      disabled="#{fn:containsIgnoreCase(bindings.Items.attributeValue,'XYZ')}" >
    Is it Library file issue ? I have already added JSTL1.2.

    Hi Frank,
    I have imported the same directly by code.
    I am facing this issue on one of my system, but the same code is working fine in my other systems. I have tried re-insatlling jdev and importing all the files.
    But still facing the same issue.. This might be some jdev issue in specific system ?
    Please let me know if anything i need to add .

  • BUG: Unable to add tag library to component palette on linux (Ubuntu)

    As already discussed in the thread problem with adding Sun JSF RI v1.2 as a new library in JDeveloper 10.1.3.1 i have problems adding the Apache Trinidad (faces) tag library to the component palette. Actually the adding is not the problem and initially after adding it, it works. But when closing JDeveloper and restarting the components have disappeared while they are still selected in the Edit Tag Libraries menu. This problem only occurs on Linux and not under windows.
    Kind Regards,
    Andre Jochems

    Hi,
    Thanks for reporting this issue
    Frank

  • Struts Layout-Tag Library

    Can anyone suggest a book or site for Struts Layout-Tag Library.......
    i got only www.struts.application-servers.com/
    Thanks.

    I know for Struts, there is Struts Layout tag library
    that provides treeview, calendar, table, etc. Is
    there any such tag library for JSF? Thanks.Sure. The most popular is MyFaces Tomahawk (http://myfaces.apache.org/tomahawk/index.html). JSF Central has a comprehensive list as well: http://www.jsfcentral.com/products/components.
    Kito D. Mann - Author, JavaServer Faces in Action
    http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info
    * Sign up for the JSF Central newsletter! http://oi.vresp.com/?fid=ac048d0e17 *

  • Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

    Hi, can anyone advise as to whether my tag library code (based
    on Apache Jakarta Project) will actually achieve connection
    pooling functionality across my entire JSP based application? I
    am slightly concerned that my OracleConnectionCacheImpl object
    may exist multiple times, hence rendering my conection pooling
    attempt useless.
    package com.solved.tag.dbtags.connection;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    import javax.servlet.jsp.JspTagException;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.jdbc.pool.OracleConnectionCacheImpl;
    * <p>JSP tag connection, used to get a
    * java.sql.Connection object.</p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>connection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
    agclass>
    * &lt;bodycontent>JSP&lt;/bodycontent>
    &lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
    eiclass>
    * &lt;info>Opens a connection based on a jndiName.&lt;/info>
    * &lt;attribute>
    * &lt;name>id&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    public class ConnectionTag extends TagSupport {
    static private OracleConnectionCacheImpl cache = null;
    public int doStartTag() throws JspTagException {
    try {
    Connection conn = null;
    if (cache == null) {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup
    ("jdbc/pool/OracleCache");
    cache = (OracleConnectionCacheImpl)ds;
    catch (NamingException ne) {
    throw new JspTagException(ne.toString());
    conn = cache.getConnection();
    pageContext.setAttribute(getId(),conn);
    catch (SQLException e) {
    throw new JspTagException(e.toString());
    return EVAL_BODY_INCLUDE;
    package com.solved.tag.dbtags.connection;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    * <p>JSP tag closeconnection, used to close the
    * specified java.sql.Connection.<p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>closeConnection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
    lt;/tagclass>
    * &lt;bodycontent>empty&lt;/bodycontent>
    * &lt;info>Close the specified connection. The "conn"
    attribute is the name of a
    * connection object in the page context.&lt;/info>
    * &lt;attribute>
    * &lt;name>conn&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    * @see ConnectionTag
    public class CloseConnectionTag extends TagSupport {
    private String _connId = null;
    * The "conn" attribute is the name of a
    * page context object containing a
    * java.sql.Connection.
    * @param connectionId
    * attribute name of the java.sql.Connection to
    close.
    * @see ConnectionTag
    public void setConn(String connectionId) {
    _connId = connectionId;
    public int doStartTag() {
    try {
    Connection conn = (Connection)pageContext.getAttribute
    (_connId);
    conn.close();
    } catch (SQLException e) {
    // failing to close a connection is not fatal
    e.printStackTrace();
    return EVAL_BODY_INCLUDE;
    public void release() {
    _connId = null;
    package com.solved.tag.dbtags.connection;
    import javax.servlet.jsp.tagext.TagData;
    import javax.servlet.jsp.tagext.TagExtraInfo;
    import javax.servlet.jsp.tagext.VariableInfo;
    * TagExtraInfo for the connection tag. This
    * TagExtraInfo specifies that the ConnectionTag
    * assigns a java.sql.Connection object to the
    * "id" attribute at the end tag.
    * @author Matt Shannon
    * @see ConnectionTag
    public class ConnectionTEI extends TagExtraInfo {
    public final VariableInfo[] getVariableInfo(TagData data)
    return new VariableInfo[]
    new VariableInfo(
    data.getAttributeString("id"),
    "java.sql.Connection",
    true,
    VariableInfo.AT_END
    data-sources.xml:
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-
    sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    name="jdbc/pool/OracleCache"
    location="jdbc/pool/OracleCache"
    url="jdbc:oracle:thin:@oracle1:1521:pdev"
    >
    <property name="maxLimit" value="15" />
    <property name="cacheScheme" value="2" />
    <property name="user" value="console" />
    <property name="password" value="console" />
    <description>
    This DataSource is using an Oracle-native DataSource Class so as
    to allow Oracle Specific extensions.
    A getConnection() call on this DataSource will return
    oracle.jdbc.driver.OracleConnection.
    The connection returned is a logical connection.
    The caching scheme in place is Fixed Wait. Refer below to
    possible values.
    Dynamic 1
    Fixed Wait 2
    Fixed Return Null 3
    </description>
    </data-source>
    </data-sources>
    many thanks,
    Matt.

    Hi. Show me your pool definition.
    Joe
    Ramamurthy wrote:
    I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
    I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
    When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
    "javax.servlet.jsp.JspException: Failed to write body content
    at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
    After this message, whenever I try to access the same jsp page I am getting the message
    "javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
    river
    at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
    Can you please help me the reason why this problem is happening and how to fix this ?
    This problem doexn't happen consistently. This occurs once in a while.
    I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
    Thanks for your help !!!
    Ram

  • How can i use tag library in the mvc?

    hello
    in some tag libraris such as jakarta tag library and jrun tag library,there is database
    access tag, it provide convenient function to access database from jsp page,but i wonder how can i use such a tag within MVC architecture.
    as we know,in MVC architecture,all requests from the jsp pages are submit to the controller servlet,then the controller manipulate ejb to access database,it don't allow the database access from the jsp page.
    who can tell me how can i combine the tag library with mvc architecture appropriately?
    thank you!

    You can't! If you decide to limit the JSP to be part of the View component, obviously you should not include tags that directly access the database. If the strict MVC architecture is less important to you, then the tags can save coding time. It's your choice.

  • How to use a tag library in multiple web applications?

    Morning all,
    Environment: Tomcat 5 on Apache2 using Mod_JK connector on Windows XP
    I have developed a custom tag library and tested it out and its working great.
    Now, How do I use in my other web applications? Do I need to copy the JAR file to webapps\app1\WEB-INF\lib, webapps\app2\WEB-INF\lib etc directories?
    The problem with this approach is, if I happen to change the tag library code, I will have to make sure that I remember to copy the new JAR file to the above mentioned directories. Ofcourse I can write a simple ant script that would do it for me, but I was wondering if there was an efficient and yet simple way of achieving the same.
    Thanks in advance,
    Joe

    Thanks Vidyut! You've answered my question.
    I placed the jar file in the $CATALINA_HOME/shared/lib directory. But where should I place the taglib TLD file? And how should I reference it in web.xml?
    Currently, my web.xml is as follows and it doesn't work.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <taglib>
    <taglib-uri>http://abc.com</taglib-uri>
    <taglib-location>c:\Tomcat\shared\lib\mytags-taglib.tld</taglib-location>
    </taglib>
    </web-app>
    Thanks again!
    Joe

  • How to add a new tag library into ALBPM 5.7?

    I want to use a tag library but I don't know ho to configure ALBPM to use it.
    Anyone knows how to do it?
    Thanks
    Regards

    Hello,
    I think u need to import all resources used by your TagLib as .TLD .JAR to inside process.

  • Purpose of TAG Library?

    What is the purpose of TAG library?
    I feel so hard while using Tag library in my JSP pages?

    Which taglibrary are you talking about? JSTL?
    If so, its purpose is just to control the flow of code logic and the data output in JSP. It is less or more a replacement of scriptlets, which are been discouraged since a decade. Scriptlets are considered a bad practice. Taglibs (and EL) forces you to write clean and well-MVC-formed JSP code. The JSTL core, format and functions taglibs are extremtly useful. The JSTL sql and xml taglibs are intented for quick prototyping only, in real you should be using Java classes for this to avoid tight coupling of database/business/model/view logic.

Maybe you are looking for