Custom Taglib

I wrote tag class like this
public int doStartTag() throws JspException
          try {
               System.out.println("Hello doStartTag");
               StringBuffer question = new StringBuffer();
               question.append("<tr><td>");
               question.append("Service Text");
               question.append("</td><td>");
               question.append("<html:text name=\"servicesDetailsForm\"
property=\"test\"/>");
               question.append("</td></tr>");
               question.append("<tr><td>");
               question.append("<input type=text name=s>");
               question.append("</td></tr>");
               question.append("\r\n");
               pageContext.getOut().print(question.toString());
          catch(Exception e)
          return 1;
in jsp i am calling tag librery. But when i saw the view source <html:text name="servicesDetailsForm"
property="test"/>") is displaying as it is not converting to html tag
But if i write <html:text name="servicesDetailsForm" property="test"/>" directly in jsp page it will converting correctly.
Please let me know why it is not converting to html tag.

I doubt you will be able to do this. I don't know much about Struts (I assume that is the <html:text ... > tag you are talking about) but I would guess the order of operations comes into play. for instance, I don't think the output of a Custom Tag will be treated as a Custom Tag on the JSP server (remember, the output HTML you use is translated on the client, whereas Custom Tags are translated on the server, so the text put out from a Custom Tag probably is passed streight as if HTML, and not tested for being a Custom Tag...)
Anyway, I would look on how to write custom tags that interact with their body. Perhaps, instead of printing directly to the HTML page, you could define your tag to have a body-content of JSP, and write the output to the tag's body in the doStart method...
Look at this page, perhaps: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags7.html#wp90575 and see if you can get it to work that way.
If you describe your problem more thoroughly, perhaps there is an easier solution.

Similar Messages

  • Runtime exceptions in custom taglib

    I am getting errors of the type:
              javax.servlet.ServletException: runtime failure in custom tag
              The problem is the error is happening in a taglib, but Weblogic is hiding the
              original stack trace, and substituting it's own, which is useless in this case. Is
              there any way to get the original stack trace?
              -Jeff
              

    With custom tags, each interface method needs to be entirely in a try..catch
              to support debugging. WL hides the exact exception information. For
              example:
              public int doEndTag() throws JspException
              try
              catch (Throwable e)
              throw e instanceof JspException ? (JspException) e : new
              JspTagException(e.getMessage());
              Cameron Purdy
              [email protected]
              http://www.tangosol.com
              WebLogic Consulting Available
              "Brian Homrich" <[email protected]> wrote in message
              news:[email protected]...
              > I'm getting the same type of error in the situation where an error has
              occured
              > in a page, my client uses "Back" on the browser, then tries another page
              > (which uses a custom taglib).
              >
              > If I stop, then restart WL, all is ok. The page where the runtime
              failure
              > occured is ok now.
              >
              > Have you made any progress getting a stack trace, and have you found
              anything
              > interesting?
              >
              > Does anyone know why a failure on one page would cause the custom tags
              > on another to fail like this? (Both pages use the same tag, but aren't
              calls
              > to a tag done independently?)
              >
              > Brian
              >
              > Jeff Nowakowski wrote:
              >
              > > I am getting errors of the type:
              > >
              > > javax.servlet.ServletException: runtime failure in custom tag
              > >
              > > The problem is the error is happening in a taglib, but Weblogic is
              hiding the
              > > original stack trace, and substituting it's own, which is useless in
              this case. Is
              > > there any way to get the original stack trace?
              > >
              > > -Jeff
              >
              

  • Custom taglib with nested tag not working

    Hi everybody,
    I have a question concerning a custom taglib. I want to create a tag with nested child tags. The parent tag is some kind of iterator, the child elements shall do something with each iterated object. The parent tag extends BodyTagSupport, i have overriden the methods doInitBody and doAfterBody. doInitBody initializes the iterator and puts the first object in the pageContext to be used by the child tag. doAfterBody gets the next iterator object and puts that in the pageContext, if possible. It returns with BodyTag.EVAL_BODY_AGAIN when another object is available, otherwise BodyTag.SKIP_BODY.
    The child tag extends SimpleTagSupport and does something with the given object, if it's there.
    In the tld-file I have configured both tags with name, class and body-content (tagdependent for the parent, empty for the child).
    The parent tag is being executed as I expected. But unfortunately the nested child tag does not get executed. If I define that one outside of its parent, it works fine (without object, of course).
    Can somebody tell me what I might have missed? Do I have to do something special with a nested tag inside a custom tag?
    Any help is greatly appreciated!
    Thanks a lot in advance!
    Greetings,
    Peter

    Hi again,
    unfortunately this didn't work.
    I prepared a simple example to show what isn't working. Perhaps it's easier then to show what my problem is:
    I have the following two tag classes:
    public class TestIterator extends BodyTagSupport {
        private Iterator testIteratorChild;
        @Override
        public void doInitBody() throws JspException {
            super.doInitBody();
            System.out.println("TestIterator: doInitBody");
            List list = Arrays.asList(new String[] { "one", "two", "three" });
            testIteratorChild = list.iterator();
        @Override
        public int doAfterBody() throws JspException {
            int result = BodyTag.SKIP_BODY;
            System.out.println("TestIterator: doAfterBody");
            if (testIteratorChild.hasNext()) {
                pageContext.setAttribute("child", testIteratorChild.next());
                result = BodyTag.EVAL_BODY_AGAIN;
            return result;
    public class TestIteratorChild extends SimpleTagSupport {
        @Override
        public void doTag() throws JspException, IOException {
            super.doTag();
            System.out.println(getJspContext().getAttribute("child"));
            System.out.println("TestIteratorChild: doTag");
    }The Iterator is the parent tag, the Child shall be shown in each iteration. My taglib.tld looks like the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <taglib
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
         <tlib-version>1.0</tlib-version>
         <short-name>cms-taglib</short-name>
         <uri>http://www.pgoetz.de/taglibs/cms</uri>
         <tag>
              <name>test-iterator</name>
              <tag-class>de.pgoetz.cms.taglib.TestIterator</tag-class>
              <body-content>tagdependent</body-content>
         </tag>
         <tag>
              <name>test-iterator-child</name>
              <tag-class>de.pgoetz.cms.taglib.TestIteratorChild</tag-class>
              <body-content>empty</body-content>
         </tag>
    </taglib>And the snippet of my jsp is as follows:
         <!-- TestIterator -->
         <cms:test-iterator>
              <cms:test-iterator-child />
         </cms:test-iterator>The result is that on my console I get the following output:
    09:28:01,656 INFO [STDOUT] TestIterator: doInitBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    09:28:01,656 INFO [STDOUT] TestIterator: doAfterBody
    So the child is never executed.
    It would be a great help if anybody could tell me what's going wrong here.
    Thanks and greetings from germany!
    Peter
    Message was edited by:
    Peter_Goetz

  • How to include custom taglib in javascript on a given jsp page

    Hi,
    How to include custom taglib in javascript on a given jsp page?
    i have a jsp page on which i am adding selectboxes using javascript.
    But now i have created my own custom select box and want to add it on a given jsp page.
    is the code to create the box box.
    <sample:pickListOptions employeeId="abcs123"/>
    but how should i embed it in javascript, so that i will be able to add it on the give jsp page.
    Thanks,
    Javaqueue

    when the jsp page is loaded for the first time it contains a select box containg names created by a taglib.but there is a feature i want to add wherein though javascript the name selectebox will keep on coming on each row i want to add. and this is row addition and deletion is being handled by the javascript. there i encounter the bug how to interact the javascript with taglib so tha with each row addition i will have populated taglib created select box on each row.
    Thanks,
    Javaqueue

  • Simple Question - How do I deploy custom taglibs to Oracle 9iAS r2?

    Simple question.
    There are lots of simple examples on JSP custom tags that have
    a .tld file, a .java file with the handler class, and a .jsp
    file that calls the custom tag to test it.
    My question is, lets say I have a .tld file, a .java file and
    a .jsp file for a tag example. How do I deploy them to
    Oracle 9iAS r2? I'd like to code an example and deploy it,
    but I'm stuck. I'm using Jdeveloper 9i, and have compiled the
    .java file and included it and the .tld in a Custom Taglib JAR.
    How is this JAR deployed to Oracle 9iAS, considering that the
    Enterprise Manager only deploys WAR and EAR files? How do
    a configure a web app to use the custom tags...
    This should be simple -- maybe its too simple so I'm stuck!

    check out ojspdemos which comes with the product.
    Also see
    http://otn.oracle.com/tech/java/oc4j/doc_library/902/jsp/taglibs.htm#1004903
    -Prasad

  • Custom taglib problem

    Hi I wrote some custom taglibs, but I get the
    following error:
    org.apache.jasper.JasperException: File "/dodo" not
    found
    I have the following configuration in my web.xml
    <taglib>
    <taglib-uri>/dodo</taglib-uri>
    <taglib-location>/WEB-INF/jsp/csajsp.tld</taglib-location>
    </taglib>
    and I call it in my jsp file in the following way:
    <%@ taglib uri="/dodo" prefix="c" %>
    And still doesn't work
    I'm using jdk 1.4.2 and tomcat 4.1.24.
    Any clues, thanks.

    That is right. The thing is that the custom tag example from tomcat works, and mine doesn't. Someone told me that it could be a jdk 1.4.2 issue, but thanks anyway.

  • JSP custom taglib

    Hi, I've a big problem:
    I tried to realize my first custom taglib for converting a .jasper file (a precompilated formatted meta-document) into a PDF file but I poorly failed... :(
    Unfortunatly, although the code run correctly into a main class into a stand alone sample application, the same code (opportunely adapted) doesen't work correctly if used by a JSP with its relative custom tag library.
    The error message is:
    javax.servlet.ServletException: Error loading expression class : report_semplice
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:872)
         org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.java:114)
         org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:792)
         java.security.AccessController.doPrivileged(Native Method)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:790)
         org.apache.jsp.reportPDF_jsp._jspService(reportPDF_jsp.java:82)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         sun.reflect.GeneratedMethodAccessor178.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:324)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
    root cause
    javax.servlet.jsp.JspTagException: Error loading expression class : report_semplice
         com.tag.GeneratePDF.doEndTag(GeneratePDF.java:72)
         org.apache.jsp.reportPDF_jsp._jspx_meth_JR_GeneratePDF_0(reportPDF_jsp.java:99)
         org.apache.jsp.reportPDF_jsp._jspService(reportPDF_jsp.java:71)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         sun.reflect.GeneratedMethodAccessor178.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:324)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
    The code of the taglib class is:
    package com.tag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import net.sf.jasperreports.engine.*;
    import net.sf.jasperreports.engine.export.*;
    import net.sf.jasperreports.engine.util.*;
    import net.sf.jasperreports.view.*;
    import java.sql.*;
    import org.apache.commons.logging.*;
    import java.io.*;
    import java.util.*;
    public class GeneratePDF extends TagSupport
      private String sourceFileName = "C:\\default.jasper";
      private String destinationFileName = "C:\\default.pdf";
      public void setSourceFileName(String sourceFileName)
        this.sourceFileName = sourceFileName;
      public void setDestinationFileName(String destinationFileName)
        this.destinationFileName = destinationFileName;
      public int doStartTag()
          return SKIP_BODY;
      public int doEndTag() throws JspTagException
        try
            //Passaggio parametri da passare al jasper.
            Map parameters = new HashMap();
            parameters.put("param1", new Integer(1));
            //Preparazione del file da stampare (in questa fase si esegue la query e si inseriscono
            //i valori estratti dalla query)
            JasperPrint jasperPrint=JasperFillManager.fillReport(sourceFileName, parameters, getConnection());
            // a schermo
            // JasperViewer.viewReport(jasperPrint);
           // test
           //pageContext.getOut().println("Destination File:" + destinationFileName);       
        //Creazione del PDF
            JasperExportManager.exportReportToPdfFile(jasperPrint, destinationFileName);
        //    System.exit(0);
           catch(Exception e)
                { throw new JspTagException(e.getMessage());
        return EVAL_PAGE;
    /**Metodo per creare la connessione al DB*/
    private static Connection getConnection() throws ClassNotFoundException, SQLException {
    //Change these settings according to your local configuration
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String connectString = "jdbc:odbc:gecoware";
    String user = "admin";
    String password = "password";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(connectString, user, password);
    return conn;
    The .TLD file is:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
        <tlibversion>1.0</tlibversion>
        <jspversion>1.1</jspversion>
        <shortname>JR</shortname>
        <uri>ReportTags</uri>
        <info>Tag library per la generazione di report a partire da files .jasper</info>
        <tag>
            <name>GeneratePDF</name>
            <tagclass>com.tag.GeneratePDF</tagclass>
            <bodycontent>empty</bodycontent>
            <info>Tag per la generazione di PDF</info>
            <attribute>
              <name>sourceFileName</name>
            </attribute>
            <attribute>
              <name>destinationFileName</name>
            </attribute>
        </tag>
    </taglib>
    And the JSP code is:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="ReportTags" prefix="JR" %>
    <html>
    <head>
    <title>GeneratePDF</title>
    </head>
    <body>
    <JR:GeneratePDF sourceFileName="c:\\report_semplice.jasper" destinationFileName="c:\\report1.pdf"/>
    </body>
    </html>
    I hope that someone could help me...
    Thank you,
    AleX

    Hi,
              I think that the container can not identify the tag's ,what you are trying to use.
              As per the j2ee specification , we need to follow the procedure to use the taglib as given below
              Procedure for using a Tag Lib :
              â€¢ Copy tag lib jar files under WEB-INF/lib ( if tag handler supplied as classes without package a jar file then we need to copy the classes under WEB_INF/classes.
              â€¢ Copy the tld files files under WEB-INF or create a directory under WEB-INF and copy tld files under this directory.
              â€¢ We need to give the information about the tag libraries in web.xml by adding the following lines to it as,
              <taglib>
              <taglib-uri>http://www.inet.com/taglibs/bodytags</taglib-uri>
              <taglib-location>/WEB-INF/tlib/tlib1.tld </taglib-location>
              </taglib>
              To use tags in jsp file we need to add taglib directive as ,
              <%@ taglib uri="http://www.inet.com/taglibs/samptags" prefix=“abc"%>
              Every tag can support zero or more number of attributes and a tag may or may not support body content.
              weblogic server try to parse the .tld file whenever the tags are encountered in jsp files.
              As per the .tld file the container identify the attributes of the tags which were defined in .tld file.
              ------ Anilkumar kari

  • Custom taglibs w/ JSP features

    Hello Together,
    I am currently facing a little problem:
    I use custom taglibs for rendering certain web elements (lets say widgets etc.). The reason is greater reusability and full integration into the runtime. However, what do you recommend on how to render such components?
    As far as i know, there are only two solutions:
    - embedding markup (e.g. XHTML, XML...) into the tag class (not so good, especially when large chunks of markup)
    - reading from markup templates located on the file system and populating them w/ data (slow?).
    What do you use for custom taglibs that are to render markup contents (thus, no flow taglibs)?
    I know that i can fallback to pure JSPs, but there is no elegant way calling them with parameters. The reason is that i have "abstract control classes" with some properties. According to these properties, my taglib renders the control. When doing this with a JSP fragment, there is no "cool" way:
    the class proto: an GUI class with properties
    - id
    - caption
    - state
    - etc.
    -- taglib example --
    <some:guiElement obj="${controls.current}" method="xml" />
    This taglib can query all properties by the obj reference and render.
    -- JSP equivalent w/ JSTL call --
    <c:import url="/base/guiElement.jsp?id=${controls.current.id}&caption=${controls.current.caption}[...]" />
    This is bad design, and all params have to be passed seperately (or not?).
    You see, Taglibs are quite more handy to use, as you know. But i am missing JSP features in taglibs, such as how to do an <c:import /> from within an taglib etc.
    Another thing in mind is themeability. One can use a copy of the JSP fragment and modify its visual appearance, but w/ taglibs, that is more harder (except when using markup templates).
    Does anyone knoe how to marry JSP featires into custom taglibs?
    Sorry for that long posting :-)
    Greetings, Timo

    Hello,
    Just an answer to myself and anyone who is interested:
    The solution to my problem is migrating to JSP 2.0 where you can use tag template files.
    Thus, if possible, upgrading to JSP 2.0 + Servlet 2.4 does the job.
    Greetings, Timo

  • Extending functionality from existing custom taglib

    Hi!
    I'm trying to extend the functionality of an already existing custom taglib. To test this possibility I�ve so far created a small taglib containing two tags. QbeTag.java and QbeSumTag.java.
    The QbeTag class handles a database connection and constructs a table showing the result of a query passed in as an attribute in the tag. (The database contains a �dummy table� holding information about persons.)
    Now let�s pretend that I don�t have the source code for the QbeTag but need to/ want to extend its functionality. For instance:
    In the QbeSumTag I want to summarize all the persons ages and present it in a new text field somewhere else on the page.
    To do this I probably need to access the QbeTag class from the QbeSumTag class, or is there any other way to achieve this wanted functionality?
    Up to this point:
    What I�ve tried is to implement the QbeSumTag so that It extends the QbeTag class. This means that I now can access the doStartTag, doEndTag, and so on methods from the QbeSumTag by typing super.doStartTag().
    The problem with this approach is that this way only gives me the possibility to run the methods not altering the process it self and I can�t alter the out stream. A syntax like:
    public int doStartTag() throws JspException
    return super.doStartTag();
    Will only result in a call for the QbeTag�s doStartTag() method to run and do it�s stuff.
    Is there any way I can solve this or am I stuck? Maybe one approach would be to nest the QbeSumTag with the QbeTag wich would mean that there will be a dependency between the tow tags.
    I believe that this question is quite difficult to answer but it could be the starting point for an interesting discussion. Hasn�t anyone tried to extend the functionality of the Jakarta taglib, say the DB tags or Mail tag.
    All thoughts and replies will great fully received.
    /Daniel

    Well, the answer to this is the same as the answer to extending any third party classes... it depends on how the original class was created.
    If the original class was designed with extension in mind, then (hopefully) its realy functionality will be isolated to a series of protected methods (that you would have access to) and private methods (you would not have access to).
    You would use the public and protected methods to retrieve the data you need to do your work, or override those ones whose work you want to replace (for instance, if it has a protected displayOutput(Map dataMap) method, you are in luck!).
    If everything is done giving you know access to the pieces, then you may be stuck providing a tag that has the original tag nested inside it. Buffer the output from the original tag and parse it, retrieving the info you need, then output your own stuff...

  • Run-Time expression evaluation does not work with custom TagLib

              Hi,
              Using "WebLogic EJB to JSP Integration Tool", we have created a custom TagLib.
              We can properly deploy/start our Web application (a WAR file), but whenever we
              go to the JSP page that is using the custom Tag, we get the following exception:
              java.lang.ClassCastException: java.lang.Object
              at javax.servlet.jsp.tagext.TagData.getAttributeString(TagData.java:165)
              Here is what we have in our JSP page:
              <%@ taglib uri="Students-tags" prefix="students" %>
              <%
              String studentID = (String)session.getAttribute("studentID");
              %>
              <students:Register studentID="<%=studentID%>" />
              <%
              And the TLD file looks like this:
              <?xml version="1.0" encoding="ISO-8859-1" ?>
              <!DOCTYPE taglib
              PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
              <taglib>
              <tlibversion>1.0</tlibversion>
              <shortname>ejb2jsp generated tag library</shortname>
              <tag>
              <name>Register</name>
              <tagclass>EJBs.Students.jsp_tags._Students_RegisterTag</tagclass>
              <teiclass>EJBs.Students.jsp_tags._Students_RegisterTagTEI</teiclass>
              <info>
              attribute 'studentID' expects java type 'java.lang.String'
              </info>
              <attribute>
              <name>studentID</name>
              <required>true</required>
              <rtexprvalue>true</rtexprvalue>
              </attribute>
              </tag>
              </taglib>
              and Web.xml file does have the following entry:
              <taglib>
              <taglib-uri>
              Students-tags
              </taglib-uri>
              <taglib-location>
              /WEB-INF/Students-tags.tld
              </taglib-location>
              </taglib>
              Does anybody knows whay Do I get such an exception ?
              

    You might want to ask this in a servlet/jsp interest group.

  • Q:Custom Taglibs in jDeveloper 9i RC

    I'm making a project with jsp's and custom taglibs. I created the taglib with the wizard and it is saved in ..\src\META-INF\xxx.tld. But when I need to it into the JSP it searches for a tld file from the public_html directory.
    Should I copy this file manually in the public_html directory ? Or should I change a setup somewhere ? I also did a deployment of the taglib into a .jar file. Is there a way to include and use it directly ?
    Thanks !

    Hi Mike, thanks for your help, it works.
    But now, the problem moved to another point: EL Expressions.
    My custom taglib needs to receive BPMObjects attributes (by EL assignment), so:
    If i keep the <install_dir>\webapps\workspace\WEB-INF\web.xml file as standard my ${object.attribute} is passed by as a string, not a EL, even if my custom tld accepts EL.
    If I change the web.xml above, turning off the <el-ignored> configuration it works
    <jsp-config>
            <jsp-property-group>
                <url-pattern>*.jsf</url-pattern>
                <is-xml>false</is-xml>
            </jsp-property-group>
            <jsp-property-group>
                <url-pattern>*.jsp</url-pattern>
                <url-pattern>*.jspf</url-pattern>
                <el-ignored>false</el-ignored>
            </jsp-property-group>
        </jsp-config>but then i get a problem with core jstl "c" using this URI
    *<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>*
    According to TLD or attribute directive in tag file, attribute value does not accept any expressions
    even if a change it URI to
    *<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>*
    i have
    The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
    So, have you faced this issue before? There is an way to change the core tld file within obpm jars?
    thanks again

  • Import custom taglib??/

    I'm a newbee with UIX, sorry if this question seems stupid. How do you go about importing a custom taglib into UIX application?
    Thanks!

    Hi,
    You cannot use jsp tags inside a uix page.
    However, you can import the content of another JSP from within a UIX file.
    see:
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&linkHelp=false&file=jar%3Afile%3A/u01/app/oracle/product/IAS904/j2ee/OC4J_ohw/applications/jdeveloper/jdeveloper/helpsets/jdeveloper/uixref.jar!/ui/servletInclude.html

  • JSP Custom Taglib Help

    Dear All,
    I am developing a simple calender system where I want to be able to add entries for a specific time and date similar to Outlook. I have a customer Taglib to create an Outlook style calendar. I can hard code entries such as below in the JSP but am not sure how I could generate these dynamically by filling in a booking form. Any guidance would be much appreciated as I have spent hours reading JSP books and websites without a resolution.
    <CAL:outlook width="220px" end="21" onClick="setEvent">
    <CAL:event start="10:00" end="11:00" eventMark="#00FF33">Meeting 1</CAL:event>
    <CAL:event start="11:30" end="13:00">Meeting 1</CAL:event>
    <CAL:event start="13:30" end="14:00">Meeting 2</CAL:event>
    </CAL:outlook>
    Thanks in advance
    Message was edited by:
    MikeS27
    Message was edited by:
    MikeS27

    Apologies, I have posted this in the wrong forum. Relocating.

  • Custom Taglibs

    Hi all
    Can any one tell me y Custom Taglibs came innto field what use to be there before and how they are used. what are the advantages and disadvantages of Custom Taglibs
    And also about struts tags
    Thanx in
    advance

    Tag libs keep scriptlets out of JSPs.
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html

  • Custom TagLib & JSP Helpers

    I've written a custom tag library for some advanced UI components (tabbedpane, toolbar, tree, etc.) that I've been distributing for free as a .jar file with the associated .tld file. So far, so good.
    Now I want to write some more advanced tags (i.e. a DateSelection and Calculator tag) that will require some helper JSP files (and possibly images) to render the actual calendar and calculator.
    My plan is to have the tag generate a textfield with a hyerplink image to it's right. When clicked the image would load the helper JSP file in a new window. The user would do his thing and when done, the JSP would reload the parent window so the textfield could grab the result from the request and display it.
    My question is how to package this. I would like to keep this thing as a single self contained .jar file that could be easily placed in the WEB-INF directory of a user's webapp and VIOLA, it's done.
    Can I reference a .JSP (& | images) stored in this jar file or will the user have to be responsible for placing the JSP(s) (and the hyperlink images) within their context path? This would add some possible support issues (you know what I mean) and being a freeware package I'd like to avoid that at all costs.
    You guys have been tremendous help so far. Thanks.

    how will mailing the jar help ?
    I dont think you can include it all in the jarfile. Best thing is to make an entire war file with the developed taglib and jsp's.
    The user then should deploy the war file and ervything should work.

  • How to install custom taglibs?

    This is driving me crazy. I'm building a JSP application and I'm trying to use the custom tag libraries jstl.jar and standard.jar. I've installed Tomcat vesrion 4 vesrion 27. I can make a reference to the sql.tld, but whenever I add something like <sql:query...etc />, I get the error "Unabled to load class" or "java.lang.NoClassDefFoundError: javax/servlet/jsp/JspContext
    When I put jstl.jar and standard.jar in the WEB-INF\lib directory, Tomcat starts up with a lot of errors("Document is invalid no grammar found").
    I've tried everything, read documentation but I still cannot figure it out.
    +++++The taglib directive in my jsp looks like this:
    <%@taglib prefix="sql" uri="http://java.sun.com/jstl/sql"%>
    ++++The header in my taglib looks like this:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>sql</short-name>
    <uri>http://java.sun.com/jstl/sql</uri>
    <display-name>JSTL sql</display-name>
    <description>JSTL 1.0 sql library</description>
    +++++and my web.xml:
    <?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/j2ee/dtds/web-app_2_3.dtd">
    <web-app>
    <taglib>
    <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
    <taglib-location>/WEB-INF/sql.tld</taglib-location>
    </taglib>
    </web-app>
    Do I explicitly have to set the classpath? Where do I have to put the standard.jar and the jstl.jar?
    Thanx for your help.
    Frits

    The JSTL JARs should go in your app's WEB-INF/lib. The JARs in that directory are added to the CLASSPATH by Tomcat. That's the proper place for them. No need to edit any CLASSPATH settings. Tomcat ignores any system CLASSPATH that you might have. (I recommend that people delete that environment variable altogether. It does nothing useful that I know of.)
    You should not need to put any <taglib> in your web.xml. The URI that you should use to refer to the taglib is the one inside the .tld file packed in standard.jar. So your JSPs should have lines like this at the top:
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>The URI must match the value inside the c.tld:
      <uri>http://java.sun.com/jstl/core</uri>If you do this, Tomcat should be able to find your taglib classes. - MOD

Maybe you are looking for

  • How do I use my credit card to buy apps at home

    I just want to buy some brains on zombie farm but all I have is my credit card and I can't figure out how to get the money on my ipad account from home, all I have is like five dollars also.

  • Status SYSFAIL in SMQ1

    Hi All, We are getting an error message with status "SYSFAIL" in SMQ1 while replicating the BP from CRM to ECC and the message goes like "The current application triggered a termination wi th a short dump." The BDoc status is in YELLOW status. Please

  • Pages constantly go missing

    I am using DE for a school text book. Every time I use it, while scrolling through pages, large numbers of pages go missing. For example, hitting next page from page 55 will go to page 66. No matter how many times I flip pages back and forth, I canno

  • 8.1 update for iPad Mini, worth it?

    Haven't downloaded it yet because the 8 update slowed everything to a crawl and I was told the only way to get it back in shape was to wipe to factory and then install apps one at a time......how many hours a day do they think I have (I went to the g

  • Anyone else having trouble with overly sensitive voice control upon upgrading to 5.01?

    Today I upgraded my iPhone 4 to iOS 5.01. Then I went running, as I do 3 times a week. Every 50 feet the music would stop and Voice Control would come up.  This is extremely frustrating!  I've never had this issue before -- same phone, same headset t