JWSDP Custom Tags (finding tag handler class)

Hi,
ive been using the Java Web Services Development Pack
ive tried several examples of creating custom tags all seem to have different directory structures and none seem to work. Heres my setup...
rootdir -> index.jsp
rootdir -> WEB-INF -> web.xml
rootdir -> WEB-INF -> tlds -> demo.tld (the tag library descriptor)
rootdir -> WEB-INF -> classes -> demo -> tags -> Greeter.java (the tag handler class)
there are some other folders created by deploytool but they are empty.
heres demo.tld...
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<short-name>demo</short-name>
<uri>DemoTags</uri>
<tag>
<name>greeter</name>
<tag-class>demo.tags.Greeter</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
here is the tag handler class Greeter.java...
package demo.tags;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
public class Greeter extends SimpleTagSupport {
public void doTag() throws JspException {
PageContext pageContext = (PageContext) getJspContext();
JspWriter out = pageContext.getOut();
try {
out.println("Hello World");
} catch (Exception e) {
// Ignore.
and heres the code in index.jsp...
<%@taglib prefix="t" uri="DemoTags" %>
<t:greeter />
Id love to know if these directory structures are fixed and where they are specified - its confusing the way so many examples show differences.
this is the exception i get when trying to run index.jsp through the admin page (localhost:4848)
org.apache.jasper.JasperException: /index.jsp(11,0) Unable to load tag handler class "demo.tags.Greeter" for tag "t:greeter"
----

Sincere Apologies - It might be a good idea to compile my java files so i actually have classes in my classes directory !!
i think a build.xml file is needed for ant to compile everything that is needed now.
and the beat goes on !

Similar Messages

  • Java Bean access in a JSP Tag handler class

    Hello Everybody,
    I am trying to access my java bean(ErrorBean.java) in th doEndTag() method of the tag handler class(MyTagHandler.java) and iam getting an "CLASSCAST EXCEPTION"
    I am doing it like this in the tag handler class.
    MyBeans.ErrorBean errorBean = (MyBeans.ErrorBean)pageContext.getSession().getAttribute("ErrorBean");
    Where MyBeans is the package in which my Error Bean is and iam placing the ErrorBean object in the session object before it comes to the jsp page where i have the jsp Custom tag:
    <%@ taglib uri="/WEB-INF/taglib.tld" prefix="errors" %>
    <errors:message/>
    <%@ include file="footer.jsp"%>
    I was of the opinion that i was casting it right...can anyone help me to find ...where iam doing it wrong...its really URGENT ..PLEASE

    Friend that did not work either ...
    u know what...the ErrorTagHandler class is comiling fine with out errors but in the jsp page when the custom tag is hit..this error is showing up when i see the server log.
    can you throw some light on this..
    thanks..
    Firasath

  • About the  Tag handler class

    hi,
    i created a tag handler source file.
    the following exception is thrown as given below
    C:\Tomcat 5.0\webapps\jsp-examples\WEB-INF\classes\Custom>javac ExampleTag.java
    ExampleTag.java:3: package javax.servlet.jsp does not exist
    import javax.servlet.jsp.*;
    ^
    ExampleTag.java:4: package javax.servlet.jsp.tagext does not exist
    import javax.servlet.jsp.tagext.*;
    ^
    ExampleTag.java:7: cannot find symbol
    symbol: class TagSupport
    public class ExampleTag extends TagSupport
    ^
    ExampleTag.java:13: cannot find symbol
    symbol : class JspWriter
    location: class Custom.ExampleTag
    JspWriter out = pageContext.getOut();
    ^
    ExampleTag.java:13: cannot find symbol
    symbol : variable pageContext
    location: class Custom.ExampleTag
    JspWriter out = pageContext.getOut();
    ^
    ExampleTag.java:20: cannot find symbol
    symbol : variable SKIP_BODY
    location: class Custom.ExampleTag
    return(SKIP_BODY);
    ^
    ExampleTag.java:20: illegal start of type
    return(SKIP_BODY);
    ^
    7 errors
    can anyone help me with the problem????????

    hi
    i compiled my tag handler class and stored the Source and class files in the WEB-INF\classes directory.
    i created a descriptor file and saved it in WEB-INF\jsp directory.
    i placed my jsp file in the jsp-examples folder.
    then i started the server and executed the jsp file.
    that time i was encountered with the following error.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/Custom/csajsp-taglib.tld" not found
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
         org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:202)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:458)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:523)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
         org.apache.jasper.compiler.Parser.parse(Parser.java:171)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:258)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    note The full stack trace of the root cause is available in the Tomcat logs.
    can you help me???????????????????

  • Tag Handler Class classpath

              Hi.
              I have some problems with Tag Handler Classes in custom tags. When tag handler
              class store in package all is OK - I place it's class-file in /WEB-INF/classes/%package-path%/%class-name%.class
              and in tld-file in <tagclass> write: %package-path%.%class-name%.
              When tag handler class don't store in package I place class-file in /WEB-INF/classes/%class-name%.class
              and in tld-file in <tagclass> write: %class-name%, but it's doen't work. When
              jsp starts I recieve:
              D:\bea\wlserver\config\mydomain\applications\.wl_temp_do_not_delete\WEB-INF\_tmp_war_myserver_myserver_CustomTag\jsp_servlet\_simpleexample.java:81:
              cannot resolve symbol
              symbol : class ExampleTag
              location: class jsp_servlet._simpleexample
              ExampleTag csajspexample0 = null;
              ^
              Why? Plese, help me.
              Igor
              

    You probably should not use unnamed packages at all.
              Language spec specifically says that "Unnamed packages are provided by the
              Java platform principally for convenience when developing small or temporary
              applications or when just beginning development."
              Igor Vinnikov <[email protected]> wrote:
              > Hi.
              > I have some problems with Tag Handler Classes in custom tags. When tag handler
              > class store in package all is OK - I place it's class-file in /WEB-INF/classes/%package-path%/%class-name%.class
              > and in tld-file in <tagclass> write: %package-path%.%class-name%.
              > When tag handler class don't store in package I place class-file in /WEB-INF/classes/%class-name%.class
              > and in tld-file in <tagclass> write: %class-name%, but it's doen't work. When
              > jsp starts I recieve:
              > D:\bea\wlserver\config\mydomain\applications\.wl_temp_do_not_delete\WEB-INF\_tmp_war_myserver_myserver_CustomTag\jsp_servlet\_simpleexample.java:81:
              > cannot resolve symbol
              > symbol : class ExampleTag
              > location: class jsp_servlet._simpleexample
              > ExampleTag csajspexample0 = null;
              > ^
              > Why? Plese, help me.
              > Igor
              Dimitri
              

  • How to submit a form in jsp from tag handler class

    I have a form in jsp.I created some more links in the tag handler class.Based on the link we click form action will take place.Now how can i submit the form in tag handler class for the links i created in that class.

    I have a form in jsp.I created some more links in the tag handler class.Based on the link we click form action will take place.Now how can i submit the form in tag handler class for the links i created in that class.

  • JSF 1.2 tag handler classes in JSF 1.1 environment

    Hi,
    I’m developing a JSF 1.2 application with RSA 7.5.1. When I run it in the WAS 6.1 I get the following exception:
    javax.servlet.ServletException:
    Unable to convert string '#{onebean.onestring}' to class
    javax.el.ValueExpression for attribute title:
    java.lang.IllegalArgumentException:
    Property Editor not registered with the PropertyEditorManager
    at org.apache.jasper.runtime.PageContextImpl.handlePageException
    (PageContextImpl.java:660)etc...
    I think my WAS 6.1 running environment doesn’t admit Tag Handler classes in JSF 1.2 style (you know: Extending UIComponentELTag, with all attributes in the tag class of type valueExpression along with setter methods...).
    In case this suspect is true, is there any tricky way to run this JSF 1.2 components in a JSF 1.1 environment?
    Do you have any ideas to solve this problem without downgrading my JSF tag handler classes from 1.2 to 1.1?
    Thanks a lot!

    Hi BalusC,
    This is the full history:
    I started coding the tag handler classes of my JSF components in the JSF 1.2 way.
    But know, I’am being forced to run the web app that uses those JSF 1.2 components in a WAS 6.1 (servlet 2.4 & jsp 2.0, I suppose).
    Not very elegant solution, I put a ‘servlet2.5-jsp2.1-api.jar’ file in my ‘WebContent\WEB-INF\lib’ directory, and configured a ‘PARENT-LAST’ class loader policy in the server configuration.
    This is my web.xml:
    <?xml version="1.0"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
            http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
       <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.faces</url-pattern>
       </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>
    </web-app>When I launch the JSF example page, I get no logs, no messages, ONLY a blank page (¿?)
    Thank you very much for your skilled help!

  • Tool to downgrade Tag handler classes from JSF 1.2 to JSF 1.1

    Is there any tool to downgrade Tag handler classes from JSF 1.2 to JSF 1.1?
    thanks!

    I am not sure if I understand you, but what's wrong with just replacing the JAR files?

  • Tag handler class was not found "org.apache.struts.taglib.tiles.InsertTag"

    Hi All,
    I have a proble deploying my app with struts 1.3.10, when I run under tomcat 6 on my eclipse, it´s fine, but when I deploy on weblogic send next exception:
    ####<Apr 2, 2013 4:24:19 PM CDT> <Info> <ServletContext-/slagentes> <DSWLC01K> <svr-slisto> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1364937859494> <BEA-000000> <layout.jsp:142:14: The tag handler class was not found "org.apache.struts.taglib.tiles.InsertTag".
    <tiles:insert attribute="content"/>
    ^----------^
    layout.jsp:142:14: The tag handler class was not found "org.apache.struts.taglib.tiles.InsertTag".
    <tiles:insert attribute="content"/>
    ^----------^
    >
    ####<Apr 2, 2013 4:24:19 PM CDT> <Error> <HTTP> <DSWLC01K> <svr-slisto> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1364937859499> <BEA-101017> <[ServletContext@159254910[app:slagentes module:/slagentes path:null spec-version:3.0], request: weblogic.servlet.internal.ServletRequestImpl@5ebf5ebf[
    POST /slagentes/login.do HTTP/1.1
    Connection: keep-alive
    Content-Length: 37
    Cache-Control: max-age=0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Origin: http://172.17.12.129:7004
    User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31
    Content-Type: application/x-www-form-urlencoded
    Referer: http://172.17.12.129:7004/slagentes/
    Accept-Encoding: gzip,deflate,sdch
    Accept-Language: es-ES,es;q=0.8
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
    ]] Root cause of ServletException.
    weblogic.servlet.jsp.CompilationException: Failed to compile JSP /jsp/template/layout.jsp
    layout.jsp:142:14: The tag handler class was not found "org.apache.struts.taglib.tiles.InsertTag".
    <tiles:insert attribute="content"/>
    ^----------^
    layout.jsp:142:14: The tag handler class was not found "org.apache.struts.taglib.tiles.InsertTag".
    <tiles:insert attribute="content"/>
    ^----------^
    at weblogic.servlet.jsp.JavelinxJSPStub.reportCompilationErrorIfNeccessary(JavelinxJSPStub.java:225)
    at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:161)
    at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:237)
    at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:190)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:281)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:453)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:364)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:221)
    at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:567)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:263)
    at org.apache.struts.tiles.commands.TilesPreProcessor.doForward(TilesPreProcessor.java:260)
    at org.apache.struts.tiles.commands.TilesPreProcessor.execute(TilesPreProcessor.java:217)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
    at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
    at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:751)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:242)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:216)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:132)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:338)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:221)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3284)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3254)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2163)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2089)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2074)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1513)
    at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    >
    My weblogic.xml is
    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app
         xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
         <wls:container-descriptor>
              <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>
         </wls:container-descriptor>     
    </wls:weblogic-web-app>     
    and my weblogic-application.xml is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd"
         xmlns="http://www.bea.com/ns/weblogic/weblogic-application">
         <application-param>
              <param-name>webapp.encoding.default</param-name>
              <param-value>UTF-8</param-value>
         </application-param>
         <prefer-application-packages>
              <package-name>antlr.*</package-name>          
              <package-name>org.apache.*</package-name>          
              <package-name>javax.xml.rpc.*</package-name>
              <package-name>javax.xml.namespace.*</package-name>
              <package-name>javax.xml.messaging.*</package-name>
              <package-name>javax.xml.soap.*</package-name>
              <package-name>javax.servlet.jsp.jstl.*</package-name>
         </prefer-application-packages>
    </weblogic-application>
    please help me

    The struts-template tld has been deprecated in favour of the tiles taglib.
    If you are using anything above struts 1.0, then you should be using tiles.
    Most probably the support files for the struts-template taglib are not in your distribution.
    Cheers,
    evnafets

  • How to represent XML inline tags in a Java class

    Dear all,
    I am currently dealing with the issue of how to transform an XML document into a Java representation. As far as the strucural elements are concerned, I'd represent them each one of them as a Java class. However, the XML structure also allows for inline tags, i.e. elements which specify formatting information for the text. I am looking for good ideas for how to best represent these in my Java class(es).
    Let's use an example. Suppose I have something like this:
    <root>
       <structure>A piece of text</structure>
       <moreStructure>A piece of <b>bold</b> text</moreStructure>
       <finalStructure>A piece of <inlineTag att="value"> more text!</inlineTag>   </finalStructure>
    </root>I this case I would build four classes for the strucural elements. But how do I represent <b> and <inlineTag>? In my XML documents I have several such inline tags, each of which may also have a bunch of attributes. I am sure this has been solved cleverly before. Any help greatly appreciated.
    Best regards,
    N.

    The XML term for "containing tags and text" is "mixed content". And XML designers generally don't care much for mixed content. You're finding out one of the reasons for that right now. They aren't elegant or clever, just inconvenient.
    However sometimes you have to deal with ugly structures. This is one of them. I would represent mixed content as a list, just as you already thought of. The elements in this list would be either text or elements. So in this example:<moreStructure>A piece of <b>bold</b> text</moreStructure>you would have three entries:
    1. Text "A piece of "
    2. A <b> element
    3. Text " text"
    And when retrieving from that list you would have to use "instanceof" to see if you had a String or an element of some kind.
    And if "standalone tags" versus "paired tags" is a complication, then you're looking at it wrong. XML doesn't care much about tags. Tags only exist to delimit an element, and you should be looking at elements.
    I'm guessing at your non-standard terminology here: a "standalone tag" is an empty element like
    , right? And "paired tags" means a non-empty element like <this>that</this>? They're all elements. The first is a "br" element and the second is a "this" element.

  • Custom for loop tag

    Hi all,
    I am trying to implement a custom "for loop tag". But it seems to me that there is a type conversion problem. I've tried many ways to fixed it but I still cannot get it to work. I've dug through my books, searched the internet and this forum but I can't found anythig useful. I am really lost now! Can anyone help me with this? Many many many thanks!!
    loopTag.jsp
    <%@ taglib prefix="myTag" uri="/WEB-INF/myTag.tld" %>
    <% int num=5; %>
    <myTag:loop index="i" count="<%=num%>">
         body1here: i expr: <%=i%> i property: <jsp:getProperty name="i" property="value"/> <br>
    </myTag:loop>
    myTag.tld
    <?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>simple</shortname>
      <tag>
        <name>loop</name>
        <tagclass>myTag.LoopTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>for loop</info>
        <attribute>
            <name>index</name>
            <required>true</required>
        </attribute>
        <attribute>
            <name>count</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
    </taglib>
    LoopTag.java
    package myTag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.Hashtable;
    import java.io.Writer;
    import java.io.IOException;
    public class LoopTag extends BodyTagSupport {   
        String index;
        int count;
        int i=0;
        public void setIndex(String index){
          this.index=index;
        public void setCount(String count){
          this.count=Integer.parseInt(count);
        public int doStartTag() throws JspException {
            return EVAL_BODY_TAG;
        public void doInitBody() throws JspException {
            pageContext.setAttribute(index, i);
            i++;
        public int doAfterBody() throws JspException {
            try {
                if (i >= count) {
                   bodyContent.writeOut(bodyContent.getEnclosingWriter());
                    return SKIP_BODY;
                                  else{
                                       pageContext.setAttribute(index, i);
                                  i++;
                return EVAL_BODY_TAG;
                        catch (IOException ex) {
                throw new JspTagException(ex.toString());
    Error message:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 4 in the jsp file: /loopTag.jsp
    Generated servlet error:
    The method setCount(String) in the type LoopTag is not applicable for the arguments (int)
    An error occurred at line: 5 in the jsp file: /loopTag.jsp
    Generated servlet error:
    i cannot be resolved
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         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)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.11 logs.

    I took the custom for-loop one step further and now it can be nested with in other for-loop.
    Hope this is the last time I have to reinvent the wheel. Now I REALLY apprecate JSTL!!
    loopTag.jsp
    <%@ taglib prefix="myTag" uri="/WEB-INF/myTag.tld" %>
    <% int row = 5; %>
    <% int col = 5; %>
    <table border=0>
         <myTag:loop index="i" count="<%= row %>">
              <tr>
                   <myTag:loop index="j" count="<%= col %>">
                        <td>index: i=<myTag:printIndex parentLevel="2" /> j=<myTag:printIndex parentLevel="1" />, <br></td>
                   </myTag:loop>
              </tr>
         </myTag:loop>
    </table>
    myTag.tld
    <?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>simple</shortname>
      <tag>
        <name>loop</name>
        <tagclass>myTag.LoopTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>for loop</info>
        <attribute>
            <name>index</name>
            <required>true</required>
                        <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>count</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
      <tag>
        <name>printIndex</name>
        <tagclass>myTag.LoopPrintTag</tagclass>
        <bodycontent>JSP</bodycontent>
        <info>for loop print</info>
              <attribute>
            <name>parentLevel</name>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
      </tag>
    </taglib>
    LoopTag.java
    package myTag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.util.Hashtable;
    import java.io.Writer;
    import java.io.IOException;
    public class LoopTag extends BodyTagSupport {   
        String index;
        int count;
        int i=0;
        public void setIndex(String index){
          this.index=index;
        public String getIndex(){
          return String.valueOf(pageContext.getAttribute(index));
        public void setCount(int count){
          this.count=count;
        public int doStartTag() throws JspException {
                         i = 0;
            return EVAL_BODY_TAG;
        public void doInitBody() throws JspException {
            pageContext.setAttribute(index, i);
            i++;
        public int doAfterBody() throws JspException {
            try {
                if (i >= count) {
                   bodyContent.writeOut(bodyContent.getEnclosingWriter());
                    return SKIP_BODY;
                                  else{
                                       pageContext.setAttribute(index, i);
                                  i++;
                return EVAL_BODY_TAG;
                        catch (IOException ex) {
                throw new JspTagException(ex.toString());
    LoopPrintTag.java
    package myTag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.io.*;
    import javax.servlet.*;
    public class LoopPrintTag extends BodyTagSupport {
         private int parentLevel = 1;
      public int doStartTag() throws JspTagException {
              LoopTag parent = (LoopTag)findAncestorWithClass(this, LoopTag.class);
              for(int i=1; i<parentLevel; i++){
                   parent = (LoopTag)findAncestorWithClass(parent, LoopTag.class);
        if (parent == null) {
          throw new JspTagException("print not inside loop");
              else{
                   try {
                             JspWriter out = pageContext.getOut();
                             out.print(parent.getIndex());
                   } catch(IOException ioe) {
                             System.out.println("Error in printTag: " + ioe);
        return(SKIP_BODY);
         public void setParentLevel(int _parentLevel){
              if(_parentLevel > 0){
                   parentLevel = _parentLevel;
    Output:
    index: i=0 j=0, index: i=0 j=1, index: i=0 j=2, index: i=0 j=3, index: i=0 j=4,
    index: i=1 j=0, index: i=1 j=1, index: i=1 j=2, index: i=1 j=3, index: i=1 j=4,
    index: i=2 j=0, index: i=2 j=1, index: i=2 j=2, index: i=2 j=3, index: i=2 j=4,
    index: i=3 j=0, index: i=3 j=1, index: i=3 j=2, index: i=3 j=3, index: i=3 j=4,
    index: i=4 j=0, index: i=4 j=1, index: i=4 j=2, index: i=4 j=3, index: i=4 j=4,

  • Group Custom Name keyword tag - Mac PSE10

    Under the preferences tab for camera or card reader I see a checkbox which i have selected for Make "Group Custom Name" keyword tag.  How is this feature accessed to modify this and use this tag?  I cannot find the specific field. Will it show up in the Organizer on the right side with the keyword tags?  What do the users find this feature most useful for?  Thanks in advance.

    99jon wrote:
    I prefer to write my own tags and tag categories.
    right there with you on that...
    by a search, it doesn't appear many people have mentioned this feature either.

  • My finder tags won't work

    Hello, i run osx 10.9.3 on my macbook retina and have been using the finder tags happily for the past few months. recently though they started not working. when i tag a file under red for example, i see the file itself getting colored red, but it won't show up in the red folder. and when i try to untag a red file in the red folder , it won't do it. it's very frustreating.
    also i never used the colors other than red, but i just checked the other color tags and there are a bunch of random files tagged under different colors in those folders and i did not do them.
    so, anyone have an idea?

    Let's start with your wireless router. I would recommend that you do the following as a minimum:
    Power-down the modem, AirPort base station, and computer(s).
    While all of the devices are powered-down, perform a "factory default" reset on the base station. This will get it back to its "out-of-the-box" configuration and make setting it up much easier, especially if you use the "Assist me" process within the AirPort Utility. (ref: Resetting an AirPort Base Station or Time Capsule)
    After the base station resets, go ahead and power it back down.
    Power-up the modem; wait at least 10-15 minutes.
    Power-up the base station; wait at least 5-10 minutes.
    Power-up your computer(s).
    In this basic configuration, computers connected to the base station, either by wire or wireless (as appropriate for the base station type), should now be able to access the Internet through the ISP's modem. Once Internet connectivity has been verified, you can use the AirPort Utility to configure the base station for wireless security and any other desired options.

  • Finder Tags In Time Capsule?

    I have some files on my Time Capsule (purchased in 2014) that I would like to use the coloured Finder Tags on. I can tag the files so they have the coloured dot next to them but when I search for the files via the tags they don't appear, only the files on my iMac do. Am I potentially doing something wrong? Is it not actually possible to tag files on a Time Capsule? Is this going to be different in OS X Yosemite?

    i am connecting my windows pc to the time capsule ethernet prots but those pcs are not shown in my macbook or those windows pc also can not see my macbook pro. i am facing the problem...

  • Mavericks' finder "tag" vs. Lion's "label"

    Hey all. Can I make Mavericks finder tags look like Lion's finder labels?
    In Lion's finder, when you apply a "label" to a file (or whatever), in list view, it makes the entire row the color that you've chosen, which is really great for highlighting a particular file when you have a slew of them and you're only working with one or two.
    In Mavericks' finder, you apply a "tag" in the same way (select file with contextual menu), but it puts a little colored dot at the right margin of the file name column. Not nearly as easy to see.
    Lion:
    vs. Mavericks
    No contest in my book. Any advice will be appreciated, thanks.

    There's a free 3rd party option called XtraFinder that adds the full color label back to files and folders.
    OT

  • Error in custom error handler class

    Hiii...
    i got some error s when i create error handler class
    i use the following code for creating that class
    package view.controller.fwkext;
    import java.util.ArrayList;
    import java.util.List;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCErrorHandlerImpl;
    import oracle.jbo.CSMessageBundle;
    import oracle.jbo.DMLConstraintException;
    import oracle.jbo.JboException;
    public class CustomErrorHandler extends DCErrorHandlerImpl {
    List<ExceptionMapper> exceptionMapperList = new
    ArrayList<ExceptionMapper>();
    public CustomErrorHandler() {
    this(true);
    public CustomErrorHandler(boolean setToThrow) {
    super(setToThrow);
    exceptionMapperList.add(new DisableJboExceptionCodesMapper());
    public void reportException(DCBindingContainer bc, Exception ex) {
    for (ExceptionMapper mapper : exceptionMapperList) {
    if (mapper.canMapException(ex)) {
    ex = mapper.mapException(ex);
    super.reportException(bc, ex);
    I got errors
    DisableJboExceptionCodesMapper not fount
    canMapException not fount
    mapException not fount

    Abhilashs01,
    Yes, that example from the docs appears to be missing a few things, to-wit: the ExceptionMapper class and the DisableJboExceptionCodesMapper class. Without the ExceptionMapper class, JDeveloper's import assistance is finding one in com.sun.jndi somewhere, which is obviously the wrong one. So, yes, the docs are good, but they appear to be missing some key things, making it kind of hard...
    Another place to find an example error handler class is in the Fusion Order Demo: http://www.oracle.com/technology/products/jdev/samples/fod/index.html
    John

Maybe you are looking for

  • NEED TO DISPLAY A COLUMN as HYPERLINK IN discoverer viewer 10g

    Hi Guys, We have a requirement from the customer and the requirement goes like this :: We have a table in database which has a column which stores the link as VARCHAR.. For example, it has a value https://www.google.com as varchar in database. We are

  • Rework for process order

    Dear all, Could you plz tell me how to do a rework for process order. Kindly help

  • Clone Stamp Tool in CS6 Will Not Work on Tiff Files

    All of a sudden the Clone Stamp Tool does not work when working on a tif file. Yes I get the Circle with + sign when I press the ALT Key but tool will not clone.

  • ACE Reconciliation issue

    Hi, ACE Reconciliation Task scheduler is not creating events on OIM and we could see that Users are being pulled in from ACE Servers (through RM logs) also the task status remains as Running forever. Can some one please suggest or recommend a way to

  • Export as .swf missing in Photoshop Issue

    I'm from Chicago, At my home computer I have both Photoshop CS4 & CS5 (Both Extended Editions) for work, while at my home computer I was able to make animations in Photoshop, and simply create a .swf file by file >> Export as .swf I'm currently in Ne