Problem deploying and using custom Tags in jar files

I am trying to create a custom tag library of Java classes, package them in a JAR file, and use them in another web application. Here is the JAR file structure, named mytags.jar:
META-INF
META-INF/manifest.mf
META-INF/taglib.tld
mytags/FooBar.class
mytags/Another.class
...Here is the taglib.tld file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib xmlns="http://java.sun.com/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
   <tlib-version>1.0</tlib-version>
   <short-name>foo</short-name>
   <uri>fooTags</uri>
   <info>My tags</info>
   <tag>
     <name>fooBar</name>
     <tag-class>mytags.FooBar</tag-class>
     <body-content>empty</body-content>
     <attribute>
       <name>name</name>
       <required>false</required>
       <rtexprvalue>true</rtexprvalue>
     </attribute>
  </tag>
</taglib>The FooBar class has getName(String) and setName() methods.
In the web application, I have copied mytags.jar into the WEB-INF/lib directory. I've verified that it lands in the corresponding directory for my appserver (I'm using Tomcat 6.0.10).
Here's the header for my JSP:
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="fooTags" prefix="foo" %>
<foo:fooBar name="dummy" />
...When I access my page, the browser sits there and spins, not able to do anything. I know that some of the content is executed, but it is not able to get to the fooTags. I have tried replacing fooTags with WEB-INF/lib/mytags.jar, to no effect.
According to the docs, I should not need to include anything in web.xml to reference the fooTags. The tag library classes are valid, since I used them as local tags prior to moving them into a Jar library.
Any help would be appreciated

Take the code of the jsp file :
<%@ page language="java" %>
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
<html>
   <head>
     <title> First Struts Application </title>
   </head>
     <body>
        <table width="500" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td> </td>
        </tr>
        <tr bgcolor="#36566E">
          <td height="68" width="48%">
            <div align="left">
              <img src="images/hht.gif" width="220" height="74">
            </div>
          </td>
        </tr>
        <tr>
         <td> </td>
        </tr>     
       </table>
       <html:form action="Lookup"
                  name="lookupForm"
                  type="wiley.LookupForm" >
       <table width="45%" border="0">
        <tr>
          <td>Symbol:</td>
          <td><html:text property="symbol" /> </td>
        </tr>
         <tr>       
          <td colspan="2" align="center"><html:submit/> </td>
         </tr>       
        </table>              
      </html:form>
     </body>
</html>

Similar Messages

  • Problem with JSP using bean packaged in jar file

    Hi,
              I am trying to use a java bean in a jsp file. The java bean is packaged
              into a jar file. I am getting class not found compilation error. If the
              bean remains to be a seperated class file, everything work well.
              Does anyone know how I can use bean in a jar file within jsp , i.e. to
              allow the bean to be found during compilation ?
              Thanks,
              Terence.
              [email protected]
              

    Jacek,
              Thanks for replying.
              My JSP's are just files in my document root . However, I found a solution to
              my
              problem. That is to have the jar file defined in my weblogic.class.path. I may
              have missed some files in my original jar file which causes my problem.
              Mayby I should package everything into a web application for deployment. That
              will be my next step.
              Thanks anyway.
              Terence.
              Jacek Laskowski wrote:
              > Terence Lai wrote:
              > >
              > > Hi,
              > >
              > > I am trying to use a java bean in a jsp file. The java bean is packaged
              > > into a jar file. I am getting class not found compilation error. If the
              > > bean remains to be a seperated class file, everything work well.
              >
              > How do you use the JSP file ? Is it a part of web application ? If so,
              > the bean jar package should be located in WEB-INF/lib directory. It's
              > also recommended to put the bean class into a package, so it's not in
              > 'unnamed' package, and <jsp:useBean> can find it.
              >
              > >
              > > Does anyone know how I can use bean in a jar file within jsp , i.e. to
              > > allow the bean to be found during compilation ?
              >
              > see above.
              >
              > > Terence.
              >
              > Jacek Laskowski
              > HP Consulting
              

  • Dreamweaver cs4 or mx2004 may built .war or .jar files for deployment in a jsp server (Tomcat) ? If no, and use Dreamweaver  how do these files ?

    Dreamweaver cs4 or mx2004 may built .war or .jar files for deployment in a jsp server (Tomcat) ? If no, and use Dreamweaver  how do these files ?

    if I use Eclipse IDE for compilation[make *.war & *.jar files from *.java like claimBeans.java], I must use also Eclipse for upload/deploy ? Or for upload ONLY I may use and dreamweaver ? The jsp section of dreamweaver, is for app not require compilation, like from Code from:JSP STANDARD TAG LIBRARY , only ?
    Basically whatever I may do with "JavaBeans", "Servlets" etc (*.java files) needed to get compiled, I may also do it with JSP STANDARD TAG LIBRARY etc NOT NEEDED Compilation, so if I do not understand how to compile&deploy *.war & *.jar files , I may use instead the latter way ?

  • Can i use Custom Tags for Database retrieval (as per MVC pattern)?

    In our project we are dealing with database, and i've used the Cutom Tags for database retrieval (as per the Article from Mr Faisal Khan) and it is working fine. But i have a doubt if it affects the performance in any way . I wanted to know if its recommendable to use Custom Tags for the DB retrieval as per MVC Pattern or shall i create a intermediate bean and then call the bean in custom tag.
    Thanks
    Prakash

    Putting database code in your JSPs certainly couples your view to the database. That's usually not good.
    If it's a simple app, it might be justified.
    When you start having lots of pages and complex business logic it becomes less attractive. - MOD

  • Can i make own formatted textbox using custom tag

    Hai,
    Can i create own format textbox similar to vb activex control.for example i want make own formatted textbox for enter only numeric value if entry any alpha value it's show error.Is this possible using custom tag

    Hai,
    Can i create own format textbox similar to vb
    activex control.for example i want make own
    formatted textbox for enter only numeric value if
    entry any alpha value it's show error.Is this
    possible using custom tag
    If you mean a custom text box in a web page without an applet (in other words an html component), then Java has nothing to do with it. And by mentioning activex (even only in a 'like' comparison), and custom tag, you are once again hinting that you want an html component. I think you need to place your request to a JavaScript Forum, which, once again, has absolutely nothing to do with Java.
    A "custom tag" in JSP is not an HTML Tag. It may look a little like an html or xml tag, but it is evaluated on the server side. The control you need must be executed on the client side, which, once again, tells me you need to post to a JavaScript forum.

  • How to use custome tag lib in the JSP page?

    How to use custome tag lib in the JSP page?...with JDeveloper

    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtTopicFile.working_with_jsp_pages%7Cjsp_ptagsregistering~html/

  • How to use custom tag in jsp

    sir
    plz tell me how to use custom tag in jsp.plz describe it.
    i will be thankful to u

    Do you want to use taglibs or develop custom tags? Either way take a look at these:
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
    http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
    http://jakarta.apache.org/taglibs/tutorial.html
    http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
    http://www.herongyang.com/jsp/tag.html

  • How to get and set custom tag attributes

    How do i get and set custom tag attributes from a jsp page?

    Not sure if this is what your looking for, but....
    example...
    < taglibprefix:testtag attribute1="x" attribute2="y">
    ...of course, the attributes have to be defined in your taglib (.tld) file

  • Custom certificates for JAR file signing

    Hi,
    Can anyone please let me know how to check that we have custom certificates for JAR file signing set up in our instance
    Thanks,
    Praveen

    It depends on the version of your $ADJVAPRG. See the referenced note.
    How to use,create and /or update Digital Certificates for Jinitiator in 11i Applications
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=365735.1

  • How to use Stylesheets packaged in JAR file

    Hi,
    I would like to package XSL files in a JAR. The stylesheet may import other XSL files. For example:
    <xsl:import href="demos.xsl">
    <xsl:import href="table.xsl">
    where the original stylesheet and the imported stylesheets (demos.xsl and table.xsl) are all located in this package: com.company.xsl
    Is there a way for the transformers to retrieve the files from the JAR?
    Possibly another complication is that this JAR file is loaded at runtime.
    Any suggestions would be of great help. Thanks!

    Thanks that worked.
    However, is it possible to use a relative path? Right now it only works if the absolute path is used:
    <xsl:import href="jar:file:///c:/applications/bin/myjar.jar!/com/company/xsl/table.xsl" />
    It would be nice if this worked instead:
    <xsl:import href="jar:file:///./bin/myjar.jar!/com/company/xsl/table.xsl" />

  • Using images stored in JAR files

    I've got a small program which displays an image in a frame. I packaged all my classes and the picture into a jar file and made it executable. I can get the application to run but the picture doesn't show up.
    Can i load the image whilst it is still in the jar file or do i have to extract it to use it? Please help...
    Frendy

    In your class you are loading an image correct? Here is some code to do it.
    try
    URL imageURL = getClass().getClassLoader().getResource( "image.gif" );
    if ( imageURL != null )
    Toolkit tk = Toolkit.getDefaultToolkit();
    Image image = tk.createImage( ( ImageProducer ) imageURL.getContent() );
    catch ( Exception e )

  • I recently purchased a new Macbook Air and used migration to transfer old files from my old PC to the Mac, and now there are songs that I purchased through Itunes on my phone that are not on my Mac, how do I transfer these songs from the phone to the Mac?

    I recently purchased a new Macbook Air and used migration to transfer old files from my old PC to the Mac, and now there are songs that I purchased through Itunes on my phone that are not on my Mac, how do I transfer these songs from the phone to the Mac?

    dnunn wrote:
    ... how do I transfer these songs from the phone to the Mac?
    Transfer Purchases  >  http://support.apple.com/kb/HT1848
    Download Past Purchases  >  http://support.apple.com/kb/HT2519

  • Simultaneous Client and Server Form Validation using Custom Tag Library

    I am developing a custom tag library for validator tags
    which are capable of doing client side validation (Javascript)
    and server side (Java). My problem is with the development
    of a regular expression based validator. Because of differences
    in the way Javascript and Java handle regular expressions
    i can not use the same regular expression for both types of
    validation. Is there any way to convert a valid regular
    expression from the java.util.regex format into the Javascript
    format or vice versa? My major problems are with the (or, ||)
    statements and the user of backslashes.

    If you are speaking of RE syntax flavours, they are basically the same(namely perl5 flavour). Any expression that works in JS should work in j.u.regex too.
    Though, their usage is quite different.
    So, there is no need for convertion of expressions.
    But porting the code may be not so trivial.

  • Problem using custom tag library in portlet's jsp

    Hi,
    I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
    Has anybody encountered similar problems?
    Here's the exception:
    taglib exception:
    java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

    Hi,
    I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
    Has anybody encountered similar problems?
    Here's the exception:
    taglib exception:
    java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

  • How to use Custom Tags for Theme and Base Map Definitions

    In Mapviewer documentation I've found the following new feature:
    The XML definition of a theme or base map now supports application-specific
    attribute tags. You can use the Custom Tags option in the theme definition in Map
    Builder to specify tags and their values, which can be interpreted by your application
    but are ignored by MapViewer itself.
    I'm able to define a custom tag in Mapbuilder, but how can I use it in my Application?
    Thanks.

    As he said, you have to use as Platform service to create adapter in OIM.
    tcUserOperationsIntf service = Platform.getService(Thor.API.Operations.tcUserOperationsIntf.class);
    HashMap<String,String> searchmap=new HashMap<String,String>();
    searchmap.put("Users.User ID", userID);
    tcResultSet searchset=service.findAllUsers(searchmap);

Maybe you are looking for

  • Ipod Nano Help with what is possibly wrong!

    I will try to explain what has happened in the last 2 days so you can possibly diagnose the problem. Thanks Yesterday August 10 I plugged my Ipod into an ipod charger I have never used produced by Panasonic. It was a universal attachment for both ipo

  • Where is search in the forums

    I have looked on forum pages on how to search a topic. For the life of me I can not find it. The only one I see is at the very top, which takes me out of forums.

  • Title background in 16:9

    I am trying to build a title in a NTSC 16:9 project.  I am using a JPEG as the background.  The image size is 720x480.  I have unchecked "scale to frame size" in the background clip.  The background does not fill the 16:9 Monitor window.  It is tall

  • Reading embedded file

    I included couple text files in my C# app by going to Tools | Projects, going to the Resources tab, clicking on "Add Resource" and selected "Add Existing File" and selected two existing text files.  In addition to showing in the Resources pane, the f

  • Daten aus tdm-Dateie​n extrahiere​n

    Ich habe ein kleines Script geschrieben, das die Daten aus dem *.tdm File ausliest. Ich habe aber noch ein Problem mit den deutschen Umlauten (siehe Screenshoot). Wenn ich die tdm Datei in einem Editor öffne, sind dort die Begriffe richtig geschriebe