Error using Datalist Custom tag HELP!

Where can I obtain information for the following error: (IDE is JDeveloper): I have been researching this for 3 weeks without success.
ERROR: Attribute "source" of tag "DataList" cannot be set with a constant, an expression must be specified.
CODE WITH PROBLEM
<!--- *** BEGIN DB CONNECTION --->
<sql:openConnection driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" url="jdbc:microsoft:sqlserver://SPLSERVER:1433" user="MY_WEB_USERS" password="PASSWORD" id="conn"/>
<sql:setQuery id="conn" query="select * from schemes order by name" res="colorSchemes"/>
</sql:setQuery>
<sql:ifError id="conn">
<table align="center" width="60%" border="0">
<tr> <td>
<br><br> A Connection to the DataBase could not be made!
</td>
</tr>
<tr> <td>
<br><br> Error Generated: <sql:getError id="conn" />
</td>
</tr>
</table>
</sql:ifError>
<sql:ifFound res="colorSchemes">
<% String Found="OK"; %>
</sql:ifFound res="colorSchemes">
<!--- *** END DB CONNECTION --->
<!--- *** BEGIN TABLE LISTING --->
<list:DataList source="<%=\"colorSchemes\"%>" type="com.cj.datalist.dbtag">
<!--- *** DATALIST HEADER SECTION --->
<list:headerTemplate>
<TABLE CLASS="TableDouble" border="0" align="center"width="50%">
     <TR>
          <TD BACKGROUND="STYLES/<%= session.getAttribute("MyBkg") %>" ALIGN="center" colspan="5">
     <FONT ALIGN="center" CLASS="<%= session.getAttribute("MyFon") %>16">
<sql:getCount res="colorSchemes"/>  Available Color Schemes!</FONT>
</TD>
</TR>
<TR>
               <TD ALIGN="center" WIDTH="25%"     STYLE="border-bottom:solid;border-bottom-width : thin;"
BACKGROUND="STYLES/<%= session.getAttribute("MyBkg") %>">
     <FONT CLASS="<%= session.getAttribute("MyFon") %>12">Scheme Name</FONT>
               </TD>
               <TD ALIGN="center" WIDTH="8%" STYLE="border-bottom:solid;border-bottom-width : thin;"
BACKGROUND="STYLES/<%= session.getAttribute("MyBkg") %>">
     <FONT CLASS="<%= session.getAttribute("MyFon") %>12">Dark</FONT>
               </TD>
               <TD ALIGN="center" WIDTH="8%"     STYLE="border-bottom:solid;border-bottom-width : thin;"
BACKGROUND="STYLES/<%= session.getAttribute("MyBkg") %>">
     <FONT CLASS="<%= session.getAttribute("MyFon") %>12">Light</FONT>
               </TD>
               <TD ALIGN="center" WIDTH="8%" colspan="2"     STYLE="border-bottom:solid;border-bottom-width : thin;"
BACKGROUND="STYLES/<%= session.getAttribute("MyBkg") %>">
     <FONT CLASS="<%= session.getAttribute("MyFon") %>12">Select </FONT>
               </TD>
</TR>
<FORM ACTION="colors.jsp" METHOD="post" NAME="changecolor">
</list:headerTemplate>
<!--- *** DATALIST ITEM SECTION --->
<list:itemTemplate>
<TR>
               <TD CLASS="NoEedge" STYLE="border-bottom:solid;border-bottom-width : thin;">
     <FONT CLASS="F10">
               <%=CURRENT_OBJECT.getColumn(2)%>
               </FONT>
     </TD>
               <TD CLASS="LeftEdge" STYLE="border-bottom:solid;border-bottom-width : thin;"
bgcolor="<%=CURRENT_OBJECT.getColumn(4)%>">
     <FONT class="F10"> </FONT>
</TD>
               <TD CLASS="LeftEdge" STYLE="border-bottom:solid;border-bottom-width : thin;"
bgcolor="<%=CURRENT_OBJECT.getColumn(5)%>">
     <FONT class="F10"> </FONT>
</TD>
               <TD CLASS="LeftEdge" STYLE="border-bottom:solid;border-bottom-width : thin;">
     <input TYPE="Button" NAME="DarkButton" VALUE="Dark" ONCLICK="SetBkg('Dark');">
</TD>
               <TD CLASS="LeftEdge" STYLE="border-bottom:solid;border-bottom-width : thin;">
     <input TYPE="Button" NAME="Light" VALUE="Light" ONCLICK="SetBkg('Light');">
</TD>
<input TYPE="Hidden" NAME="ccsfile" VALUE="<%=CURRENT_OBJECT.getColumn(3)%>">
<input TYPE="Hidden" NAME="dark_d" VALUE="<%=CURRENT_OBJECT.getColumn(6)%>">
<input TYPE="Hidden" NAME="dark_l" VALUE="<%=CURRENT_OBJECT.getColumn(7)%>">
<input TYPE="Hidden" NAME="DarkValue" VALUE="">
<input TYPE="Hidden" NAME="LightValue" VALUE="">
<input TYPE="Hidden" NAME="update" VALUE="1">
</TR>
</list:itemTemplate>
</FORM>
<!--- *** DATALIST FOOTER SECTION --->
<list:footerTemplate>
</TABLE>
</list:footerTemplate>
</list:DataList>

I had the same problem. In your .tld change tagclass to tag-class and bodycontent to body-content and that should do the trick. The names slightly changed for JSP spec 1.2.
          

Similar Messages

  • How to use JSP custom tag lib in PAR file?

    Hi All,
    I am trying to customize mastheaderpar file. For that I have downloaded relevant par file and making the changes accordingly.
    As part of the changes I would require to use JSP custom tag library in my par file.
    I have the TLD file and relevant classes in the jar file. I would like to know where and what kind of modifications have to be done to use the jsp custom tag library.
    I tried modifying some things in portalapp.xml but was not successful.
    Please help me on how to proceed with this? It would be great if you can provide the xml entry to use this tag library
    Thanks
    Santhosh

    Hi Johny,
    Thanks for the reply. Actually I am able to change colors etc. with out any problem.
    My requirement is to use XMLTaglib in mastheader par file. This tag lib is from apache tomcat. I have the relevant TLD and class files. I copied TLD file into taglib dir of portal-inf and class file in src api.
    And I have added the following line in portalapp.xml under component-profile section of default
    <property name="tlxtag" value="/SERVICE/Newmastheader/taglib/taglibs-xtags.tld">
    Is this the right way to use tag lib? Actually before adding this line I used to get the error saying "Error parsing taglib", but now the error does not occur and I am getting new error. This is an exception in one of the taglib classes.
    Could any one provide me some inputs on how to check this error?
    Thanks
    Santhosh

  • Re: Using ScopeCache custom tag

    Hi, I am quite new to ColdFusion and I have a calendar that
    is quite slow due to the cfloops it uses to build the calendar. As
    the page does not change very often I wanted to use Raymond
    Camden's ScopeCache custom tag. However, for some reason the custom
    tag was not getting picked up from the custom tag folder on the
    server. I have successfully used components so have tried to
    convert the custom tag to a component but get the following error
    message:
    Routines cannot be declared more than once.
    The routine scope_Cache has been declared twice in the same
    file.
    This is the component:
    <!---
    Name : scopeCache
    Author : Raymond Camden ([email protected])
    Created : December 12, 2002
    Last Updated : November 6, 2003
    History : Allow for clearAll (rkc 11/6/03)
    : Added dependancies, timeout, other misc changes (rkc
    1/8/04)
    Purpose : Allows you to cache content in various scopes.
    Documentation:
    This tag allows you to cache content and data in various RAM
    based scopes.
    The tag takes the following attributes:
    name/cachename: The name of the data. (required)
    scope: The scope where cached data will reside. Must be
    either session,
    application, or server. (required)
    timeout: When the cache will timeout. By default, the year
    3999 (i.e., never).
    Value must be either a date/time stamp or a number
    representing the
    number of seconds until the timeout is reached. (optional)
    dependancies: This allows you to mark other cache items as
    dependant on this item.
    When this item is cleared or timesout, any child will also
    be cleared.
    Also, any children of those children will also be cleared.
    (optional)
    clear: If passed and if true, will clear out the cached
    item. Note that
    this option will NOT recreate the cache. In other words, the
    rest of
    the tag isn't run (well, mostly, but don't worry).
    clearAll: Removes all data from this scope. Exits the tag
    immidiately.
    disabled: Allows for a quick exit out of the tag. How would
    this be used? You can
    imagine using disabled="#request.disabled#" to allow for a
    quick way to
    turn on/off caching for the entire site. Of course, all
    calls to the tag
    would have to use the same value.
    License : Use this as you will. If you enjoy it and it helps
    your application,
    consider sending me something from my Amazon wish list:
    http://www.amazon.com/o/registry/2TCL1D08EZEYE
    --->
    <cfcomponent>
    <cffunction name="scope_Cache" access="public"
    returntype="string">
    <cfargument name="cachename" type="string"
    required="yes">
    <cfargument name="scope" type="string" required="yes">
    <cfargument name="timeout" type="string"
    required="yes">
    <cfprocessingdirective pageencoding="utf-8">
    <!--- allow for quick exit
    <cfif isDefined("arguments.disabled") and
    arguments.disabled>
    <cfexit method="exitTemplate">
    </cfif>
    <!--- Allow for cachename in case we use cfmodule --->
    <cfif isDefined("arguments.cachename")>
    <cfset arguments.name = arguments.cachename>
    </cfif>--->
    <!--- Attribute validation --->
    <cfif (not isDefined("arguments.name") or not
    isSimpleValue(arguments.name)) and not
    isDefined("arguments.clearall")>
    <cfthrow message="scopeCache: The name attribute must be
    passed as a string.">
    </cfif>
    <cfif not isDefined("arguments.scope") or not
    isSimpleValue(arguments.scope) or not
    listFindNoCase("application,session,server",arguments.scope)>
    <cfthrow message="scopeCache: The scope attribute must be
    passed as one of: application, session, or server.">
    </cfif>
    <!--- The default timeout is no timeout, so we use the
    year 3999. --->
    <cfparam name="arguments.timeout"
    default="#createDate(3999,1,1)#">
    <!--- Default dependancy list --->
    <cfparam name="arguments.dependancies" default=""
    type="string">
    <cfif not isDate(arguments.timeout) and (not
    isNumeric(arguments.timeout) or arguments.timeout lte 0)>
    <cfthrow message="scopeCache: The timeout attribute must
    be either a date/time or a number greather zero.">
    <cfelseif isNumeric(arguments.timeout)>
    <!--- convert seconds to a time --->
    <cfset arguments.timeout =
    dateAdd("s",arguments.timeout,now())>
    </cfif>
    <!--- create pointer to scope --->
    <cfset ptr = structGet(arguments.scope)>
    <!--- init cache root --->
    <cfif not structKeyExists(ptr,"scopeCache")>
    <cfset ptr["scopeCache"] = structNew()>
    </cfif>
    <cfif isDefined("arguments.clearAll")>
    <cfset structClear(ptr["scopeCache"])>
    <cfexit method="exitTag">
    </cfif>
    <!--- This variable will store all the guys we need to
    update --->
    <cfset cleanup = "">
    <!--- This variable determines if we run the caching.
    This is used when we clear a cache --->
    <cfset dontRun = false>
    <cfif isDefined("arguments.clear") and arguments.clear
    and structKeyExists(ptr.scopeCache,arguments.name) and
    thisTag.executionMode is "start">
    <cfif
    structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
    <cfset cleanup =
    ptr.scopeCache[arguments.name].dependancies>
    </cfif>
    <cfset structDelete(ptr.scopeCache,arguments.name)>
    <cfset dontRun = true>
    </cfif>
    <cfif not dontRun>
    <cfif thisTag.executionMode is "start">
    <!--- determine if we have the info in cache already
    --->
    <cfif structKeyExists(ptr.scopeCache,arguments.name)>
    <cfif
    dateCompare(now(),ptr.scopeCache[arguments.name].timeout) is -1>
    <cfif not isDefined("arguments.r_Data")>
    <cfoutput>#ptr.scopeCache[arguments.name].value#</cfoutput>
    <cfelse>
    <cfset caller[arguments.r_Data] =
    ptr.scopeCache[arguments.name].value>
    </cfif>
    <cfexit>
    </cfif>
    </cfif>
    <cfelse>
    <!--- It is possible I'm here because I'm refreshing. If
    so, check my dependancies --->
    <cfif structKeyExists(ptr.scopeCache,arguments.name) and
    structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
    <cfif
    structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
    <cfset cleanup = listAppend(cleanup,
    ptr.scopeCache[arguments.name].dependancies)>
    </cfif>
    </cfif>
    <cfset ptr.scopeCache[arguments.name] = structNew()>
    <cfif not isDefined("arguments.data")>
    <cfset ptr.scopeCache[arguments.name].value =
    thistag.generatedcontent>
    <cfelse>
    <cfset ptr.scopeCache[arguments.name].value =
    arguments.data>
    </cfif>
    <cfset ptr.scopeCache[arguments.name].timeout =
    arguments.timeout>
    <cfset ptr.scopeCache[arguments.name].dependancies =
    arguments.dependancies>
    <cfif isDefined("arguments.r_Data")>
    <cfset caller[arguments.r_Data] =
    ptr.scopeCache[arguments.name].value>
    </cfif>
    </cfif>
    </cfif>
    <!--- Do I need to clean up? --->
    <cfset z = 1>
    <cfloop condition="listLen(cleanup)">
    <cfset z = z+1><cfif z gt 100><cfthrow
    message="ack"></cfif>
    <cfset toKill = listFirst(cleanup)>
    <cfset cleanUp = listRest(cleanup)>
    <cfif structKeyExists(ptr.scopeCache, toKill)>
    <cfloop index="item"
    list="#ptr.scopeCache[toKill].dependancies#">
    <cfif not listFindNoCase(cleanup, item)>
    <cfset cleanup = listAppend(cleanup, item)>
    </cfif>
    </cfloop>
    <cfset structDelete(ptr.scopeCache,toKill)>
    </cfif>
    </cfloop>
    <cfreturn scope_Cache>
    </cffunction>
    </cfcomponent>

    Hi, thanks to both of you for your help. I reverted back the
    custom tag and it was picked up this time - I don't know what
    happened before. The functionality works as expected but I have hit
    another problem and I am hoping I can tap your combined ColdFusion
    wisdom to solve!!
    The calendar returns leave records for staff and filters the
    records using a querystring variable appended when the user clicks
    on a particular month. However, what members of staff the user sees
    depends on the data held in the users' session variables based on
    their authority. The reason I wanted to use caching is because the
    page takes a good ten seconds to run because of the use of cfloops
    for the members of staff and the days of the week to dynamically
    build the page. Using the custom tag would have worked if all
    members of staff saw the same calendar data and could only see one
    month. Can you see anyway I can speed up the page and do you think
    caching is the way forward here?

  • Using a custom tag with a 2.3 servlet descriptor BUG?

    Hi,
    I just developed a Custom Tag and I'd like to use in my jsps.
    If I add the jsp in my JDev project with the custom tag when I try to build the project I got this error:
    Error(11): oracle.xml.parser.v2.XMLParseException: Invalid element 'listener' in content of 'web-app', expected elements '[context-param, servlet, servlet-mapping, session-config, mime-mapping, welcome-file-list, error-page, taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
    It seems like when the jsp parser encounters the line with taglib it tries to parse the web.xml against a 2.2 version of the dtd. My web.xml begins with the correct dtd version (2.3). Can anyone tell me if this is a bug and eventually tell me how to solve it?
    thanks,
    Giovanni

    I repost this issue again, now with a simple test case.
    If I wrote a simple custom tag:
    import java.io.IOException;
    import javax.servlet.jsp.tagext.TagSupport;
    public class MyCustomTag extends TagSupport {
    public int doStartTag() {
    try {
    pageContext.getOut().print("FOO");
    } catch (IOException ioe) {
    pageContext.getServletContext().log(ioe.getMessage(),ioe);
    return(SKIP_BODY);
    with the associated tld:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.2</jspversion>
    <shortname>try</shortname>
    <uri>try</uri>
    <info>A short description...</info>
    <tag>
    <name>mytag</name>
    <tagclass>MyCustomTag</tagclass>
    <bodycontent>EMPTY</bodycontent>
    </tag>
    </taglib>
    and a jsp using the custom tag:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    The current time is:
    </H2>
    <P>
    <% out.println((new java.util.Date()).toString()); %>
    <%@ taglib uri="try.tld" prefix="try" %>
    <try:mytag />
    </P>
    </BODY>
    </HTML>
    all runs fine if I have a web.xml with the dtd version 2.2
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    but if I use the version 2.3 because I want filters,context listeners and so on:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>
    <description>Empty web.xml file for Web Application</description>
    <filter>
    <filter-name>FilterRedirector</filter-name>
    <filter-class>org.apache.cactus.server.FilterTestRedirector</filter-class>
    </filter>
    <!-- Filter Redirector URL mapping -->
    <filter-mapping>
    <filter-name>FilterRedirector</filter-name>
    <url-pattern>/FilterRedirector/</url-pattern>
    </filter-mapping>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    I get the error I report in my last post. (the jsp doesn't compile) If I remove the custom tag from my jsp all works fine (filters, listeners,etc). In my project settings I use the 2.3 version of servlet.jar instead of the ServletRuntime that comes with JDeveloper.
    Can anyone tell me how to resolve this issue (Using simple custom tag with a web application using the 2.3 servlet specs)?
    Thanks in advance,
    Giovanni
    If I remove the filter secion all

  • Error processing CFX custom tag "CFX_iMSMail".

    Hi
    I am testing a CF application and this is the error I get.,
    when I am trying to 'register for a certain event'.
    Error processing CFX custom tag "CFX_iMSMail".
    'The CFX custom tag "CFX_iMSMail" was not found in the custom
    tag database. Please be sure to add custom tags to the database
    before using them. If you have added your tag to the database then
    you should check the spelling of the tag within your template to
    insure that it matches the database entry.'
    Text
    The following are the lines of code in one of my cf pages
    that seem to be responsible for causing the error.
    486 : spooldir="#application.mailPath#/Out/"
    487 : priority="0"
    488 : smtpfrom="#listPart.contactEmail#"
    489 : header_from="#Trim(listPart.contactName)#
    <#Trim(listPart.contactEmail)#>"
    Is there any fix for the CFX custom tag problem or is there
    anything I am missing. I am using CF 7.0 on Windows XP
    thanks in advance

    You must register CFX custom tags in the CF Administrator.
    Until you do, they will not be found by the server. That's what the
    error message is trying to tell you.

  • Urgent: Unable to run JSP pages(using JRun Custom Tags) in Weblogic 5.1

    Hi,
    I am using JRun Custom tags to bulid JSP pages.
    Could not run the jsp page on Weblogic 5.1.
    I could run the same on JRun Server but not on Weblogic?.
    Had placed JRuntags.jar in the web_inf directory.
    What/where i need to update in properties file?.
    Please reply..
    Best Wishes.
    Satish k.Yalamaddi.

    javax.servlet.ServletException: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
    This is your problem either your tomcat or eclipse is pointing to a wrong jre
    here the problem is you are trying to run a code that was compiled using j2sdk1.5 in j2sdk1.4

  • Error in running custom tag

    Hi
    I am new in jsp?s custom tag development and trying to run it's example with jakarta-tomcat-4.1.30. I have hello.jsp
    <%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="first" %>
    <HTML>
    <HEAD> <TITLE>hELLO tAG</TITLE></HEAD>
    <BODY bgcolor="#ffffcc"><B>My first tag prints</B>
    <first:hello/></HTML>
    and mytaglib.tld as
    <?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.2</jspversion>
    <shortname></shortname>
    <uri></uri>
    <info>A simple tag library for the example</info>
    <tag>
    <name>hello</name>
    <tagclass>HelloTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info></info>
    </tag>
    </taglib>
    and HelloTag.java as
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.PageContext;
    import javax.servlet.jsp.tagext.Tag;
    public class HelloTag implements Tag {
         private PageContext pageContext;
         private Tag parent;
         public HelloTag() {
              super();     }
         public void setPageContext(PageContext arg0) {
              this.pageContext = arg0;}
         public void setParent(Tag arg0) {
              this.parent = arg0;}
         public Tag getParent() {
              return parent;}
         public int doStartTag() throws JspException {
              try{
                   pageContext.getOut().print("This is my first Tag");
              }catch(Exception e){throw new JspException("Error);}
              return SKIP_PAGE;     }
         public int doEndTag() throws JspException {
              return SKIP_PAGE;}
         public void release() {     }
    I am getting 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: /hello.jsp(7,0) Unable to load class hello
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
         at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:712)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    Can anyone help me in running this example.

    an uri is not an url,
    in your web.xml you should have something like
    <taglib>
    <taglib-uri>http://yourtaglib/taglib</taglib-uri>
    <taglib-location>/WEB-INF/yourtaglibtld</taglib-location>
    </taglib>
    that uri should be same as in the tld.file and same as in the <%@ taglib tag

  • Custom tag help

    Hi there,
    I was wondering if someone might help me construct a custom tag handler class that either allows or denies access to a given JSP page? I'll start by showing the code I want to replace in all my JSP pages:
    <%
      String companyID = (String)session.getAttribute("companyID");
      String administratorID = (String)session.getAttribute("administratorID"); 
      if(companyID == null || administratorID == null)
         out.println(ServletUtilities.headWithTitle("ACCESS DENIED") +
        <body><h1>ACCESS DENIED</h1><a href=\"/scholastic/Login.jsp\">Return to Login Page</a></body></html>");
         return;
      else
    %>What this code is doing is extracting from the session object the companyID and administratorID. Both of these were placed into the session object when the user logged into the system. As we know, when a session times out, these IDs no longer exist, thus I test for null. If either value is null, then I create HTML markup that instructs the user to login again.
    So, what would be better is a custom tag that I can call just once, like so:
    <%@ taglib uri="stlib-taglib.tld" prifix="stlib" %>
    <stlib:allow_admin_access />
    The behaviour I want is to prevent the rest of the JSP from loading if the custom tag is unable to obtain the companyID and administratorID from the session object.
    I've not create custom tags before and would like some guidance on the tag handler class. Perhaps declare it:
    public class AllowAdminAccess extends TagSupport
      public int doStartTag(){...}
      public int doEndTag(){...}
    }Please advise,
    Alan

    Ok, I obtained a tutorial I found on the net and am trying to make it work on my application. So far, this is what I have:
    <!-- web.xml -->
    <filter>
          <filter-name>AccessFilter</filter-name>
          <filter-class>mvcs.AccessFilter</filter-class>
          <description>This filter attempts of obtain a User object from the HttpSession.  The User object would have been placed their identifying the user when he/she logged in.  If it doesn't exist, the session has probably timed out, or this is an unauthorized user.  If the User object is null the person is redirected to the Login.jsp page.</description>
          <init-param>
            <param-name>login_page</param-name>
            <param-value>/scholastic/Login.jsp</param-value>
          </init-param>
        </filter>
        <filter-mapping>
             <filter-name>AccessFilter</filter-name>
             <url-pattern>/*</url-pattern>
        </filter-mapping>
    <!-- AccessFilter class -->
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class AccessFilter implements Filter {
      protected FilterConfig filterConfig;
      private final static String FILTER_APPLIED = "_filter_applied"; 
      public void init(FilterConfig config) throws ServletException {
        this.filterConfig = config;   
      public void doFilter(ServletRequest request, ServletResponse response,
                       FilterChain chain) throws IOException, ServletException
        boolean authorized = false;
        // Ensure that filter is only applied once per request.
        if (request.getAttribute(FILTER_APPLIED) == null)
          request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
          if(request instanceof HttpServletRequest)
            HttpSession session = ((HttpServletRequest)request).getSession(false);
            if(session != null)
              User user = (User)session.getAttribute("scholastic.tracks.user");
              if(user != null)
                 authorized = true;
        if(authorized)
          chain.doFilter(request, response);
          return;
        else if(filterConfig != null)
          String login_page = filterConfig.getInitParameter("login_page");
          System.out.println("login_page: " + login_page);
          if(login_page != null && !login_page.equals(""))
            System.out.println("Step1");
            filterConfig.getServletContext().getRequestDispatcher(login_page).forward(request, response);
            System.out.println("Step2");
            return;
        throw new ServletException("Unauthorized access, unable to forward to login page");
      public void destroy() { }
    }The directory structure for my application goes like this:
    webapps/scholastic/Login.jsp
    webapps/scholastic/*.jsp
    webapps/scholastic/admin/*.jsp
    webapps/scholastic/WEB-INF/classes/servlets.class
    Now, when I launch the browser and try to go to http://localhost:8080/scholastic/Login.jsp AccessFilter kicks in and since there is no User object in the session object yet, authorized will remain false. The logic continues to the line:
    filterConfig.getServletContext().getRequestDispatcher(login_page).forward(request, response);
    But in the end I wind up with a Page Not Found 404 error.
    I tried changing the <param-value>/scholastic/Login.jsp</param-value> to just <param-value>/Login.jsp</param-value> but this resulted in an endless loop condition with the Tomcat container. "/scholastic/Login.jsp" is the correct relative URL. So I'm stuck at this point.
    Please advise,
    Alan

  • Retriving Portlet preference information using a custom tag

    Hi ,
    I am trying to create a custom tag which will be used to retrieve portlet prefrence information (administrative pref, community pref, user pref etc.).
    In the displayTag method i am not able to create the Portlet request object.
    I am getting the IEnvironment reference by calling the method GetEnvironment().
    IEnvironment has methods called currentHTTPRequest() and currentHTTPResponse() which returns IXPRequest and IXPResponse object,
    But to create a portlet context I need HTTPRequest and HTTPresponse.
    If some one is aware of any other method for creating the portlet context from IXPRequest and IXPResponse object. please share as it will be of great help.
    Thanks in advance!!

    Thanks for reply!
    Actualy I am trying to retrieve the Prefernces ( Community Preference, User Preference, Administrative Preference ) values in a custom Tag.
    But I did not find any way in native APIs to retrieve the preferences.
    So I was wondering if somehow I can established a remote session using IDK to retrieve the same.

  • Using a custom tag inside another tag's attribute value?

    Hi all,
    I have a custom tag, mytag:link, whose use currently looks like this:<mytag:link path="/images/logo.gif"/>Nevermind what the tag does. Here's its TLD:<?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.1.1</tlib-version>
        <jsp-version>1.2</jsp-version>
        <short-name>My custom tags TLD</short-name>
        <tag>
            <name>link</name>
            <tag-class>test.MyLinkTag</tag-class>
            <body-content>empty</body-content>
            <description>...</description>
            <attribute>
                <name>path</name>
                <required>true</required>
                <rtexprvalue>true</rtexprvalue>
            </attribute>
        </tag>
    </taglib>I want to replace the path argument of the mytag:link tag to the result of the evaluation of another tag (a SiteMesh decorator tag) like this:<mytag:link path="<decorator:getProperty property="meta.logo"/>"/>This, of course, doesn't work, as I get the following error:org.apache.jasper.JasperException: /decorator.jsp(34,92) equal symbol expected
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)
         org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:193)
         org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:143)
         org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1328)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
         org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         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:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.opensymphony.module.sitemesh.filter.PageFilter.applyDecorator(PageFilter.java:156)
         com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:59) If I replace the call to the other tag with
    <mytag:link path="<%=someVariable%>"/>then it all works fine. This behavior seems correct, as the SiteMesh getProperty tag is writing its output to the Writer returned by pageContext.getOut() as it should. As such, this seems to be a design question, then. How are you supposed to do this?
    Thanks in advance,
    Matthew

    Note that I've also posted a question to the SiteMesh user forums about this. It has more information about the motivation of this question.
    See http://forums.opensymphony.com/thread.jspa?threadID=8561
    I'm still looking for an answer, though.
    --matthew                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error in JSP Custom Tag Program

    Hi Dear,
    when I compile my JSP Custom tag program on weblogic Its give that Error..
    Parsing of JSP File '/Home.jsp' failed: /Home.jsp(-1): cannot load TLD: weblogic.xml.dom.ChildCountException: missing child tagclass in tag
    probably occurred due to an error in /Home.jsp line -1:
    Tue Sep 09 18:46:56 GMT 2008
    My Files are:
    Home.jsp:
    <%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="neeraj" %>
    <neeraj:hello name="Vijay">
    It is a Tag Body<br>
    </neeraj:hello>
    taglib.tld:
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <uri>WEB-INF/tlds/taglib.tld</uri>
    <tag>
    <name>hello</name>
    <tag-class>mypack.MyTag</tag-class>
    <attribute>
    <name>name</name>
    <required>true</required>
    </attribute>
    </tag>
    </taglib>
    MyTag.java:
    package mypack;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyTag extends TagSupport
    String name;
    public void setName(String c)
    try
    name=c;
    catch(Exception e)
    count=1;
    public int doStartTag()
    return EVAL_BODY_INCLUDE;
    public int doAfterBody
    JspWriter out=pageContext.getOut();
    out.print("Good Night "+name);
    catch(Exception e)
    return EVAL_PAGE;
    web.xml:
    <web-app>
    <welcome-file-list>
    <welcome-file>/Home.jsp</welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>taglib</taglib-uri>
    <taglib-location>/WEB-INF/tlds/taglib.tld</taglib-location>
    </taglib>
    </web-app>
    Please resolve my issue..

    I had the same problem. In your .tld change tagclass to tag-class and bodycontent to body-content and that should do the trick. The names slightly changed for JSP spec 1.2.
              

  • Cannot use cfx_image custom tag

    While trying to use cfx_image tag I am getting the following error and anyone give me an idea what I am missing?
    Thanks

    Yes there was a problem with bits. I was trying to run a 32bit dll in 64bit CF.
    Fix:
    Rather than reinstalling my CF I gave up using cfx_image tag as I found a better option.
    The builtin CF function ImageResize:
    <!--- This resizes an image to attributes.thumbsize of original size and resize it proportionately to the new width. Notice that the height is blank.--->
            <cfset uploadedImage=ImageNew("#attributes.imagepath#\#photo#")>
            <cfset ImageResize(uploadedImage,"#attributes.thumbsize#","","highestQuality",1)>
    more details about this function can be found at:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_h-im_39.html

  • Compile Errors when Generating Conditional Tag Help File

    Ok, here is a recap of everything I have done. I started over from scratch. Unzipped the Help File into C:\Users\edwinwood\Documents\My RoboHelp Projects\Adobe RoboHelp 9 folder. Went to the properties SSOL Help Development folder and unchecked read only. Opened RoboHelp 9 as an administrator, went to File->Open and opened the help file. The first thing that pops up is a message stating this is a help file made with an older version of RoboHelp(v8) and must be upgraded(v9). I hit ok. The next pop-up is this “Unable to connect to the project $/SSOL HelpDevelopment@:ROBOSOURCE in version control. Would you like to browse for it?” I hit yes and the next pop-up just asks do you want to discontinue connection attempts in the future. I hit no. After that is usually where the files that are write protected pop-up but they didn’t this time. After about 5 minutes It will say upgrade complete. I shut down RoboHelp go into the language folder copy the robohhre.lng and paste it into the root folder. Like I said this file has nothing in it.  I reopen RoboHelp as an administrator and open the project again. I then go to View->Pods->Single Source Layouts. Double click the Tag1 Remove Hickory Tech and then click save and generate. At the very end of the compile process I still get Template Errors...
    Applying WebHelp 5.50 Template...
    Template Error: can not resolve macro: WH_LNG_LoadingData
    ...Template Error: can not resolve macro: WH_LNG_MergeError1
    Template Error: can not resolve macro: WH_LNG_MergeError2
    Template Error: can not resolve macro: WH_LNG_JS_alert_ProjectLoadingFail
    ...Template Error: can not resolve macro: WH_LNG_PreTooltip in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    Template Error: can not resolve macro: WH_LNG_NextTooltip in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    Template Error: can not resolve macro: WH_LNG_Show_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    Template Error: can not resolve macro: WH_LNG_Hide_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    Template Error: can not resolve macro: WH_LNG_Show_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    Template Error: can not resolve macro: WH_LNG_Hide_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    Template Error: can not resolve macro: WH_LNG_SyncTocTooltip in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtopic.js
    .....Template Error: can not resolve macro: WH_LNG_IndexSelectTopicTitle
    Template Error: can not resolve macro: WH_LNG_IndexSelectTopicLabel
    .....Template Error: can not resolve macro: WH_LNG_LoadingContentsData
    Template Error: can not resolve macro: WH_LNG_Book
    Template Error: can not resolve macro: WH_LNG_Page
    Template Error: can not resolve macro: WH_LNG_Remote_Page
    ....Template Error: can not resolve macro: WH_LNG_IndexBtnText
    ....Template Error: can not resolve macro: WH_LNG_SearchPrompt in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whfform.htm
    Template Error: can not resolve macro: WH_LNG_SearchPrompt in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whfform.htm
    Template Error: can not resolve macro: WH_LNG_SearchPrompt in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whfform.htm
    Template Error: can not resolve macro: WH_LNG_FtsMaxResult
    Template Error: can not resolve macro: WH_LNG_FtsBtnText
    .....Template Error: can not resolve macro: WH_LNG_JS_alert_ErrorInLoading
    ....Template Error: can not resolve macro: WH_LNG_About in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whskin_banner.htm
    Template Error: can not resolve macro: WH_LNG_Author in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whskin_banner.htm
    Template Error: can not resolve macro: WH_LNG_PoweredBy in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whskin_banner.htm
    Template Error: can not resolve macro: WH_LNG_GeneratedBy in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whskin_banner.htm
    Template Error: can not resolve macro: WH_LNG_SearchPrompt in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_ToolBarSearchBtnText in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_Show_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_Hide_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_Hide_Navigation_Component in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_SyncTocTooltip in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_ContentCategoryList in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_NextTooltip in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Template Error: can not resolve macro: WH_LNG_PreTooltip in C:\SSOL Tag1 Remove HickoryTech\WebHelp\whtbar.js
    Finished applying Template in 40 sec(s)

    Ok, replaced the 0k .lng file with one that actually has something in it and I am down to one error.
    Template Error: can not resolve macro: WH_LNG_ContentCategoryList
    If anyone could help me with this one I would be much obliged

  • Error using xdofx inside xdoxslt - Help!

    Hi All
    I am trying to assign a value to a variable that applies a UPPER () and not recognize it.
    What would be the correct syntax?
    *<?xdoxslt:set_variable($_XDOCTX, 'var', UPPER(ssCivil)?>*
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: D:\Proyectos\Macro\Verison 3\BM Reporte ABM Cliente_v2.rtf
    RTFProcessor setLocale: es-es
    FOProcessor setData: D:\Proyectos\Macro\Verison 3\BIP BM Account Report IO 3.xml
    FOProcessor setLocale: es-es
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
    at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
    at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
    at RTF2PDF.runRTFto(RTF2PDF.java:629)
    at RTF2PDF.runXDO(RTF2PDF.java:454)
    at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: oracle.xdo.parser.v2.XPathException: Function 'UPPER' not found.
    at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
    at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)
    ... 14 more
    Best regards
    Ignacio Vega

    It should work well, if you use
    <?xdoxslt:set_variable($_XDOCTX, 'var', xdoxslt:convert_case(ssCivil,’UPPER’))?>

  • Error Using Custom Tag

    I am trying to use a custom tag but receive an error when I use it on a jsp page.
    I have a tag handler class file, tag library descriptor file, specified the path to the .tld in the web.xml file.
    The error implies that it cannot find the SimpleTag.class file, though I put it in the \webapps\examples\WEB-INF\classes\ directory.
    Here is the error. Does anyone know what else it could be?
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\jakarta-tomcat-4.0.1\work\localhost\examples\jsp\jspVisual\ch10\using_0005ftag$jsp.java:63: Class org.apache.SimpleTag not found.
    SimpleTag_jspx_th_myFirstTag_SimpleTag_0 = new SimpleTag();

    I could not see any obvious mistakes. But what you could try, in order to isolate the problem, is to bypass the web.xml. In other words access the TLD directly by doing this in your JSP
    <%@ taglib uri="/WEB-INF/jsp/tag_library_descriptor.tld" prefix="myFirstTag" %>
    if that does work then move the your TLD out of the jsp folder and into WEB-INF , then try
    <%@ taglib uri="/WEB-INF/tag_library_descriptor.tld" prefix="myFirstTag" %>
    Maybe someone else has better idea.

Maybe you are looking for

  • HT4367 How to update Apple TV firmware 6 beta when beta expired?

    I installed Apple TV firmware 6.1.4. Now I see a message that that firmare has expired, and instructions to update connecting the Apple TV to a computer with iTunes. I did that, but iTunes downloads firmware version 5.3 which isn't capable to install

  • Java.security.KeyStoreException: Cannot store non-PrivateKeys

    I have been getting this exception: Exception in thread "main" java.security.KeyStoreException: Cannot store non-PrivateKeys      at sun.security.provider.JavaKeyStore.engineSetKeyEntry(Unknown Source)      at java.security.KeyStore.setKeyEntry(Unkno

  • Preferred inspection type

    in qm view of mtrl master, there is one indicator "preferred inspection type" which is used to give precedence to the insp type for which this indicator is set over the default setting in SPRO (variant 01).this is what i know @ it. but my que is if i

  • Unable to locate base station

    hi, every time i open airport utility it cannot discover the base station. i'm online without any problems, the light is green but my computer can't see the base station. am i missing something? thanks!!!!!!

  • Renaming IPod

    Originally it was given my name, but now I want to pass it on to my grandson. Can I change the name of the iPod, and if so, how?