Custom tag paths

I have serveral CF servers running. Is it possible to map to
custom tags on one server from another server without a share
between the servers?
Or even with shared drives?
What are the security issues if you create a share?
Thanks
Mark

Mark Mongeau wrote:
> I have serveral CF servers running. Is it possible to
map to custom tags on one
> server from another server without a share between the
servers?
> Or even with shared drives?
> What are the security issues if you create a share?
> Thanks
> Mark
>
It would be possible but both servers would have to be able
to read a
common network/file location. Either a shared drive on one CF
server or
the other or a common directory on a file server that both cf
servers
can read. For any of this to work one or both of the cf
servers will
have to be configured to run under a user (localsystem by
default on a
windows box) that has the required permissions to read the
desired
remote resource.
Once the required permissions are granted, one just needs to
put the
UNC/Mapped drive path to the shared custom tag directory in
the
appropriate server setting.
The risk is the same with granting any user permission to a
common file
location. They have the granted permissions to do what they
are allowed
to do at that location. With intelligent consideration of
what
permissions to give the user designated to run CF under this
can be
easily mitigated to a low risk issue. Don't use an
administrator/super
user account that can do anything anywhere. Create a CF user
and only
give it the required permissions to do what you need CF to
do.

Similar Messages

  • Custom Tag Paths in CF8

    Hi
    In CF8 it's not possible to use unc path for "Custom Tag
    Paths"? In CF7 this
    work! New feature? bug? possible workarounds?
    Thanks,
    Allan

    Mark Mongeau wrote:
    > I have serveral CF servers running. Is it possible to
    map to custom tags on one
    > server from another server without a share between the
    servers?
    > Or even with shared drives?
    > What are the security issues if you create a share?
    > Thanks
    > Mark
    >
    It would be possible but both servers would have to be able
    to read a
    common network/file location. Either a shared drive on one CF
    server or
    the other or a common directory on a file server that both cf
    servers
    can read. For any of this to work one or both of the cf
    servers will
    have to be configured to run under a user (localsystem by
    default on a
    windows box) that has the required permissions to read the
    desired
    remote resource.
    Once the required permissions are granted, one just needs to
    put the
    UNC/Mapped drive path to the shared custom tag directory in
    the
    appropriate server setting.
    The risk is the same with granting any user permission to a
    common file
    location. They have the granted permissions to do what they
    are allowed
    to do at that location. With intelligent consideration of
    what
    permissions to give the user designated to run CF under this
    can be
    easily mitigated to a low risk issue. Don't use an
    administrator/super
    user account that can do anything anywhere. Create a CF user
    and only
    give it the required permissions to do what you need CF to
    do.

  • Excel2Query Custom Tag

    I am part of a team that admins 3 Windows 2003 web servers
    running ColdFusion MX7. Each of the 3 servers has the
    CFX_Excel2Query custom tag registered. The tag works without issue
    on our production and development, but not on the test server. On
    the test server, we receive the message, "The CFX custom tag
    "CFX_excel2query" was nt found in the custom tag database. Please
    be sure ...."
    Additional info:
    I registered the tag in the "CFX Tags" Page
    I registered the location of the CFX_Excel2Query to the
    "Custom Tag Paths" page
    Any help would be greatly appreciated.
    Thanks,
    Tony

    Questions:
    1. Have you tried the CFSPREADSHEET tag?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec17cba-7f 87.html
    2. Can you post your code?

  • Weblogic 10.3.6 - Custom Tag Issue

    We have created custom tag in our application. It is working fine with Tomcat and Jetty Server but on Weblogic 10.3.6 we are getting below issue:
    securities.jsp:301:5: The tag handler class was not found "jsp_servlet._tags.__money_tag".
      <neutrino:money placeHolderKey="label.security.faceValue" labelKey="label.security.faceValue"
                             ^------------^
    securities.jsp:301:20: This attribute is not recognized.
      <neutrino:money placeHolderKey="label.security.faceValue" labelKey="label.security.faceValue"
                                            ^------------^
    securities.jsp:301:62: This attribute is not recognized.
      <neutrino:money placeHolderKey="label.security.faceValue" labelKey="label.security.faceValue"
                                                                                      ^------^
    securities.jsp:302:4: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="faceValue"
                            ^-------^
    securities.jsp:302:21: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="faceValue"
                                             ^-------------^
    securities.jsp:302:41: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="faceValue"
                                                                 ^-----^
    securities.jsp:302:53: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="faceValue"
                                                                             ^--------^
    securities.jsp:302:73: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="faceValue"
                                                                                                 ^-------^
    securities.jsp:303:4: This attribute is not recognized.
      id="faceValue" path="faceValue" tabindex="13" viewMode="${view}" maxLength="16" />
                            ^^
    securities.jsp:303:19: This attribute is not recognized.
      id="faceValue" path="faceValue" tabindex="13" viewMode="${view}" maxLength="16" />
                                           ^--^
    securities.jsp:303:36: This attribute is not recognized.
      id="faceValue" path="faceValue" tabindex="13" viewMode="${view}" maxLength="16" />
                                                            ^------^
    securities.jsp:303:50: This attribute is not recognized.
      id="faceValue" path="faceValue" tabindex="13" viewMode="${view}" maxLength="16" />
                                                                          ^------^
    securities.jsp:303:69: This attribute is not recognized.
      id="faceValue" path="faceValue" tabindex="13" viewMode="${view}" maxLength="16" />
                                                                                             ^-------^
    securities.jsp:308:5: The tag handler class was not found "jsp_servlet._tags.__money_tag".
      <neutrino:money placeHolderKey="label.security.price" labelKey="label.security.price"
                             ^------------^
    securities.jsp:308:5: The tag handler class was not found "jsp_servlet._tags.__money_tag".
      <neutrino:money placeHolderKey="label.security.price" labelKey="label.security.price"
                             ^------------^
    securities.jsp:308:20: This attribute is not recognized.
      <neutrino:money placeHolderKey="label.security.price" labelKey="label.security.price"
                                            ^------------^
    securities.jsp:308:58: This attribute is not recognized.
      <neutrino:money placeHolderKey="label.security.price" labelKey="label.security.price"
                                                                                  ^------^
    securities.jsp:309:4: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="price"
                            ^-------^
    securities.jsp:309:21: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="price"
                                             ^-------------^
    securities.jsp:309:41: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="price"
                                                                 ^-----^
    securities.jsp:309:53: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="price"
                                                                             ^--------^
    securities.jsp:309:73: This attribute is not recognized.
      mandatory="true" moneyBoxColSpan="4" colSpan="6" validators="amount" errorPath="price"
                                                                                                 ^-------^
    securities.jsp:310:4: This attribute is not recognized.
      id="price" path="price" tabindex="14" viewMode="${view}" maxLength="16" />
                            ^^
    securities.jsp:310:15: This attribute is not recognized.
      id="price" path="price" tabindex="14" viewMode="${view}" maxLength="16" />
                                       ^--^
    securities.jsp:310:28: This attribute is not recognized.
      id="price" path="price" tabindex="14" viewMode="${view}" maxLength="16" />
                                                    ^------^
    securities.jsp:310:42: This attribute is not recognized.
      id="price" path="price" tabindex="14" viewMode="${view}" maxLength="16" />
                                                                  ^------^
    securities.jsp:310:61: This attribute is not recognized.
      id="price" path="price" tabindex="14" viewMode="${view}" maxLength="16" />
                                                                                     ^-------^
    money.tag:2:25: The encoding specified on the page cannot be different than detected encoding for the file.
    <%@ tag language="java" pageEncoding="UTF-8"%>
                            ^----------^
    money.tag:2:25: The encoding specified on the page cannot be different than detected encoding for the file.
    <%@ tag language="java" pageEncoding="UTF-8"%>
                            ^----------^
    >

    Hi.
    I had similar problems with appc.
    Try to remove the line "<%@ tag language="java" pageEncoding="UTF-8"%>" or at least the pageEncoding attribute from the *.tag files.
    In my case, I had no idea why the compiler complained about encoding. No UTF-8 specific characters were used and both, *.jsp and *.tag set the same encoding by directive.
    If you get rid of the "The encoding specified on the page cannot be different than detected encoding for the file.", you will also get rid of the "The tag handler class was not found" and the resulting errors.

  • SendRedirect in custom tag

              Hi,
              I have a custom tag that invokes sendRedirect() in the doAfterBody(). I'm curious
              as to why the redirection output is not complete. Here's what I always got:
              start of output ---------------------------------
              HTTP/1.1 302 Moved Temporarily
              Location: http://xenon:7001/ctl/error?WebLogicSession=OtCL5lprXh5wN0S5JJF4GFsDfU
              BKZk40AQ8mluIVsHKw2TcG5xpz|6804183543513756739/167846717/6/7001/7001/7002/7002/7
              001/-1
              Server: WebLogic 5.1.0 Service Pack 8 12/20/2000 16:34:54 #95137
              Content-Length: 481
              Content-Type: text/html
              Set-Cookie: WebLogicSession=OtCL5lprXh5wN0S5JJF4GFsDfUBKZk40AQ8mluIVsHKw2TcG5xpz
              |6804183543513756739/167846717/6/7001/7001/7002/7002/7001/-1; path=/
              Connection: Close
              <html><head><title>302 Moved Temporarily</title></head>
              <body bgcolor="#FFFFFF">
              <p>This document you reque
              -- end of output-------------
              As you can see, the Content Length is huge compared to the incomplete returned
              document.
              Can anyone help please?
              Thanks,
              Iwan
              

    you can pass the response object as argument to your
    method..Thanks for your response!
    Unfortunately I can't change the doEndTag() method parameters as doEndTag() is defined in the Tag interface. But if you mean pass the response object as an attribute of the tag i suppse that is possible.
    However, that's pretty close to the hack I currently have to work around this problem except I'm putting the response object in a request attribute in the page and then retrieving it in the doEndTag() method.
    But I am after something a little cleaner than either of these options..... I'm hoping I can just get the response object from another object I have access to. Any more thoughts?

  • Custom tag for Marquee in JSF

    Hi,
    I am trying to develop a custom tag for Marquee in JSF, my usecase is to display a value from managed bean(Dynamically). please find the code below and guide me where i have made mistake
    regards
    Sandeep
    Component class:
    package customtags;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponentBase;
    import javax.faces.context.FacesContext;
    public class Marquee extends UIComponentBase {
         public static final String COMPONENT_TYPE = "marqueecomp";
         public static final String RENDERER_TYPE = "marqueeRenderer";
         private Object[] _state = null;
         private String value;
         public String getValue() {
              if (null != this.value) {
                   return this.value;
              ValueExpression _ve = getValueExpression("value");
              return (_ve != null) ? (String) _ve.getValue(getFacesContext()
                        .getELContext()) : null;
         public void setValue(String marquee) {
              this.value = marquee;
         public String getFamily() {
              // TODO Auto-generated method stub
              return COMPONENT_TYPE;
    //     public void encodeBegin(FacesContext context) throws IOException {
    //          ResponseWriter writer = context.getResponseWriter();
    //          writer.startElement("marquee", this);
    //          writer.write(getValue());
    //          writer.endElement("marquee");
         public void restoreState(FacesContext context, Object state) {
              this._state = (Object[]) _state;
              super.restoreState(_context, this._state[0]);
              value = (String) this._state[1];
         public Object saveState(FacesContext _context) {
              if (_state == null) {
                   _state = new Object[2];
              state[0] = super.saveState(context);
              _state[1] = value;
              return _state;
    Tag Class:
    package customtags;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponent;
    import javax.faces.webapp.UIComponentELTag;
    public class MarqueeTag extends UIComponentELTag {
         protected ValueExpression marquee;
         public String getComponentType() {
              // TODO Auto-generated method stub
              return Marquee.COMPONENT_TYPE;
         public String getRendererType() {
              // TODO Auto-generated method stub
              return Marquee.RENDERER_TYPE;
         * protected void setProperties(UIComponent component) {
         * super.setProperties(component); Marquee marqComp = (Marquee) component;
         * if (marquee != null) { marqComp.setValue(marquee); } }
         protected void setProperties(UIComponent component) {
              super.setProperties(component);
              Marquee marqComp = null;
              try {
                   marqComp = (Marquee) component;
              } catch (ClassCastException cce) {
                   throw new IllegalStateException(
                             "Component "
                                       + component.toString()
                                       + " not expected type. Expected: com.foo.Foo. Perhaps you're missing a tag?");
              if (marquee != null) {
                   //marqComp.setValueExpression("value", marquee);
                   marqComp.setValue("fsdfsdfsdfsdfsd");
         * @return the marquee
         public ValueExpression getMarquee() {
              return marquee;
         * @param marquee
         * the marquee to set
         public void setMarquee(ValueExpression marquee) {
              this.marquee = marquee;
    *.tld file*
    <?xml version="1.0" encoding="UTF-8"?>
    <taglib 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-jsptaglibrary_2_1.xsd"
         version="2.1">
         <tlib-version>1.0</tlib-version>
         <short-name>marqueecomp</short-name>
         <uri>http://tags.org/marquee</uri>
         <tag>
              <name>marqueeTag</name>
    <tag-class>customtags.MarqueeTag</tag-class>
    <body-content>empty</body-content>
    <attribute>
    <description><![CDATA[Your description here]]></description>
    <name>id</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <description><![CDATA[Your description here]]></description>
    <name>value</name>
    </attribute>
         </tag>
    </taglib>
    Renderer class:
    package customtags;
    import java.io.IOException;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.context.ResponseWriter;
    import javax.faces.render.Renderer;
    public class MarqueeRenderer extends Renderer {
         public void encodeBegin(final FacesContext facesContext,
    final UIComponent component) throws IOException {
    super.encodeBegin(facesContext, component);
    final ResponseWriter writer = facesContext.getResponseWriter();
    writer.startElement("DIV", component);
    /*String styleClass =
    (String)attributes.get(Shuffler.STYLECLASS_ATTRIBUTE_KEY);
    writer.writeAttribute("class", styleClass, null);*/
    public void encodeEnd(final FacesContext facesContext,
    final UIComponent component) throws IOException {
    final ResponseWriter writer = facesContext.getResponseWriter();
    writer.endElement("DIV");
    in Faces-Config:
    <component>
              <display-name>marqueecomp</display-name>
              <component-type>marqueecomp</component-type>
              <component-class>customtags.Marquee</component-class>
              <component-extension>
    <renderer-type>marqueeRenderer</renderer-type>
    </component-extension>
         </component>
         <render-kit>
    <renderer>
    <component-family>marqueecomp</component-family>
    <renderer-type>marqueeRenderer</renderer-type>
    <renderer-class>customtags.MarqueeRenderer</renderer-class>
    </renderer>
    </render-kit>
    In class path --->marquee.taglib.xml
    <?xml version="1.0"?>
    <!DOCTYPE facelet-taglib PUBLIC
    "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
    "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
    <facelet-taglib>
    <namespace>http://tags.org/marquee</namespace>
    <tag>
    <tag-name>marqueeTag</tag-name>
    <component>
    <component-type>marqueecomp</component-type>
    <renderer-type>marqueeRenderer</renderer-type>
    </component>
    </tag>
    </facelet-taglib>
    *.xhtml file*
    <html xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en"
         xmlns:a4j="http://richfaces.org/a4j"
         xmlns:rich="http://richfaces.org/rich" xmlns:mycomp="http://tags.org/marquee">
    <head>
    <title>DEBTDOC Home Page</title>
    <meta http-equiv="keywords" content="enter,your,keywords,here" />
    <meta http-equiv="description"
         content="A short description of this page." />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" type="text/css" href="../css/common.css"></link>
    <script language="javascript" src="../script/common.js"></script>
    </head>
    <body>
    <f:view>
    <mycomp:marqueeTag value="hello World"></mycomp:marqueeTag>

    There exist the JSTL SQL taglib, but I don't recommend this. It should only be used for quick development and testing. For database connectivity, rather create a data layer with DAO classes which you on its turn just plug in your business layer (with servlets).

  • How to use a variable of jsp custom tag in my java code?

    hi folks,
    i got a folderList tag like this:
    ArrayList list = new ArrayList(20);
    %>
    <foo:folderList path="${attributes.newsPath}" var="year" contentType="folder">
    <%
              list.add(${year.contentEntryName});   // of course, this doesn't work
    %>
    </foo:folderList>I think, its clear what I want to do. I am just wondering how I can use my Variable "year" in the Java code between <% %>...

    <% list.add(year.getContentEntryName()); %>
    You have to have defined in the custom tag that "var" relates to a scripting variable that you want defined.
    <tag>
      <variable>
        <name-given>var</name-given>
        <variable-class>myPackage.myClass</variable-class>
        <declare>true</declare>
        <scope>NESTED</scope>
      </variable>
    </tag> Cheers,
    evnafets

  • Custom Tag is missing required attribute property

    Hello,
    Here is my struts config file source;
    <global-forwards>
              <forward name="mainpage" path="/index.jsp">
              </forward>
              <forward name="CustomerDetailsForward" path="/GoToCustomerPage.do">
              </forward>
         </global-forwards>
         <!-- Action Mappings -->
         <action-mappings>
              <action path="/SubmitCustomerForm" type="action.SubmitCustomerForm" name="CustomerForm" scope="request" validate="true" input="/CustomerDetails.jsp">
                   <forward name="success" path="/Success.jsp">
                   </forward>
                   <forward name="failure" path="/Failure.jsp">
                   </forward>
              </action>
              <action path="/GoToCustomerPage" type="org.apache.struts.actions.ForwardAction" parameter="/CustomerDetails.jsp">
              </action>
         </action-mappings>
    And my index.jsp source;
    <html:html>
    <head>
    <html:base/>
    </head>
    <body>
    <html:button></html:button>
    <html:link forward="CustomerDetailsForward">Go To Customer Form </html:link>
    </body>
    </html:html>
    And here is the error;
    Error Message:JSPG0227E: Exception caught while translating /index.jsp: /index.jsp(13,1) --> JSPG0006E: Custom Tag is missing required attribute property
    Root Cause:com.ibm.ws.jsp.translator.JspTranslationException: JSPG0227E: Exception caught while translating /index.jsp: /index.jsp(13,1) --> JSPG0006E: Custom Tag is missing required attribute property     at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.visitCustomTagStart(ValidateVisitor.java:304)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:267)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:268)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:139)     at com.ibm.ws.jsp.translator.visitor.JspVisitor.visit(JspVisitor.java:121)     at com.ibm.ws.jsp.translator.JspTranslator.processVisitors(JspTranslator.java:121)     at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJsp(JspTranslatorUtil.java:181)     at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJspAndCompile(JspTranslatorUtil.java:83)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:349)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:317)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:226)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:131)     at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)     at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:472)     at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)     at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)     at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)     at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)

    volkov wrote:
    Error Message:JSPG0227E: Exception caught while translating /index.jsp: /index.jsp(13,1) --> JSPG0006E: Custom Tag is missing required attribute propertyWhich is line 13 then? And check the syntax for that tag.

  • Custom Tag with open body loop

    Hi
    I'm fairly new to custom tags. I want to do something like the following
    index.jsp
    <mytag:allItems>
    ${item.name} ${item.url}
    </mytag:allItems>
    At the moment I have the following which works fine
    menu.tag
    <jsp:useBean id="items" class="com.content.urls"/>
    <c:forEach var="menuItem" items="${items.attachedItems}">
    ${menuItem.name}
    </c:forEach>
    index.jsp
    <mytags:menu />
    The bean returns a list and the tag file produces the urls which is great. However what I would like to do is using the example above not have the content of the loop fixed. For exmaple I could do
    <mytag:allItems>
    ${item.name}
    </mytag:allItems>
    or
    <mytags:menu>
    <li>${item.name}</li>
    </mytags:menu>
    I would also like to leave it so that closing the tag would still produce the list of urls as a default.
    any help much appreciated.

    Rob - replace your forEach with:
    <c:forEach var="menuItem" items="${items.attachedItems}">
        <%@ variable name-given="menuItem" scope="NESTED" %>
        <jsp:doBody />
    </c:forEach>The key here is that the menuItem variable is then exposed to the tag body before it is output.
    then your jsp will be:
    <mytag:allItems>
        <a href="${menuItem.url}">${menuItem.name}</a>
    </mytag:allItems>To do the last bit - you just need to define a variable for the body and then test whether it is set:
    <jsp:doBody var="body" />
    <c:forEach var="menuItem" items="${items}">
        <c:if test="${not empty body}">
            <%@ variable name-given="menuItem" scope="NESTED" %>
            <jsp:doBody />
        </c:if>
        <c:if test="${empty body}">
             <a href="${menuItem.path}">${menuItem.name}</a>
        </c:if>
    </c:forEach>Peter.

  • [Custom Tags] Dynamic Variable Name // Spring MVC

    I am having a problem with a tag,
    i try to make a dynamic select tag that is reuseable, the problem is that my spring controller generates a model where i can access the list information for a select and that i have to pass this to the dynamic tag, the model could have different name, so it could be ${listitemsa} ${listitemsb} ${listitemsc} and i want to pass this list to my custom tag.
    i tried the following, but the problem is that the var is passed as a string and not the list, does anybody know how to do this?
    <tag:formfield-selectbox name="listA" path="prototypeForm.selectionA" list="${listitemsa} " />
    <tag:formfield-selectbox name="listB" path="prototypeForm.selectionB" list="${listitemsb} " />
    <tag:formfield-selectbox name="listC" path="prototypeForm.selectionC" list="${listitemsc} " />     
    <%@ tag body-content="scriptless" %>
    <%@ attribute name="name" required="true" %>
    <%@ attribute name="path" required="true" %>
    <%@ attribute name="list" required="false" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> 
    <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <spring:bind path="${path}">
         <c:if test="${status.error}">
              <span class="error">
                   <c:forEach items="${status.errorMessages}" var="error">
                        <c:out value="${error}"/>
                   </c:forEach>
              </span><br />
         </c:if>
         <label for="<c:out value="${status.expression}"/>">${name}: </label>
         <form:select path="${path}">
              <form:option value="-1" label="--Please Select--" />
              <form:options items="${list}" />
         </form:select>
    </spring:bind>

    I've sorted it. Here's the solution for anybody experiencing the same problem.
    The problem is with switching from Java 1.2.1 to Java 1.3.0_02. Custom tags are (as of the JSP 1.1 spec) JavaBean compnents, and the Introspector appears to work differently in different Java versions.
    Consider this example:
    public void setAbc(String abc){}
    public boolean getAbc(){}Since the setter method takes a String and the finder method returns a boolean, the 1.2 Introspector takes the property type to be String, and returns null as the finder name. Java 1.3 (I haven't tested this explicitely, but this is what seems to be happening), returns null for both the setter name and the finder name (Probably a better way to do it, but breaks old code).
    We've rolled back to Java 1.2 and everything works again. It looks to me like the best way to fix the problem for 1.3 is to write custom BeanInfo classes for each JSP custom tag (Can anybody recommend a good JavaBeans book?). I don't yet know what will happen when you have multiple setter methods with different parameter types??? - something I've always found useful in custom tags.
    You don't get the problem on some JSP engines that don't use the Introspector (apparently JRun just puts the method name in the code and lets it fail at runtime if it doesn't exist, whereas apache and iPlanet check the methods exist at compile time).
    Here's where I got most of the answers from:
    http://groups.google.com/groups?hl=en&safe=off&ic=1&th=9330b85b1867cc7,3&seekm=8rnl24%24ef1%241%40nnrp1.deja.com#p
    http://groups.google.com/groups?hl=en&safe=off&ic=1&th=edd3053ac670ff5b,8&seekm=D8E32A666B62F7BD0076240185256A16.0073785185256A15%40webforums#p
    http://groups.google.com/groups?hl=en&safe=off&ic=1&th=7b5480449150ea26,3&seekm=3B2FA8C3.3F14A9F3%40switzerland.org#p

  • Problem in using jsp 1.1 custom tag library in websphere

    I am using was 3.5.2. Everything has been installed properly. I am using jdeveloper 3.2 for building the jsp application using custom tag library. But when I run the jsp file in browser, its gives dr. watson on java.exe. I am using websphere 3.5.2 application server.
    Have any body got this type of prob. ...
    pls respond asap.
    Thanks in Advance
    Yogesh

    Let me explain the problem again
    I am using was(websphere) 3.5.2. Everything has been installed properly. I am using jdeveloper 3.2 for building the jsp application using custom tag library.
    Application works fine in JDeveloper 3.2.
    Application works fine even when deployed on JRun 3.0. ( we are evaluating various web servers).
    How when deployed on WAS and I run the jsp file in browser, its gives dr. watson on java.exe. I am using websphere 3.5.2 application server.
    WAS has typical settings as against JRun and Tomcat and may be I have not set the necessary paths.
    Have any body got this type of prob. ...
    pls respond asap.
    Thanks in Advance
    Yogesh
    null

  • Custom tag library called multiple times

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

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

  • JSP Custom tag uri problem

    I'm using custom tags in my app (JSP 1.2). My tld is located in WEB-INF/tlds (not packaged in a JAR), meaning that the uri in the tld file should be picked up by JSP 1.2's autodiscovery. This works fine in actual deployment, but Nitrox claims that:
    "The tag library uri "mytaglib" cannot be mapped to an existing tld file. "
    when I attempt to reference it as follows from within my jsps:
    <%@ taglib uri="mytaglib" prefix="m" %>
    Do you know if this is a bug, or have any suggestions as to why the tld uri isn't being picked up by Nitrox?
    Thanks,
    John

    This is a known (kind of) issue. There are 2 easy workarounds:
    1- Specify the path to the tld file in the uri attribute. For example:
    <%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="m" %>
    2- Map the tld file in web.xml. For example:
    <taglib>
    <taglib-uri>mytaglib</taglib-uri>
    <taglib-location>/WEB-INF/mytaglib.tld</taglib-location>
    </taglib>
    M7 Support

  • 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.

  • Custom tags prob

    Hi,
    I have created a prog using Custom Tags. I have compiled it . But when I try to run it I am getting Not found error with JSP. Can somebody help me with that:
    package com.brainysoftware;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyCustomTag extends TagSupport {
    public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();
    try {
    out.println("Hello from the custom tag.");
    catch (Exception e) {
    return super.doEndTag();
    & my jsp code is :
    <%@ taglib uri="/myTLD" prefix="easy"%>
    <easy:myTag/>
    Can somebody help me to run custom tag based jsp?
    Zulfi.

    My jsp is:
    <%@ taglib uri="/myTLD" prefix="easy"%>
    <easy:myTag/>
    & its path is:
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\jsp2\el
    tag.tld file is:
    <?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>
    <tlibversion>1.0</tlibversion>
    <shortname></shortname>
    <tag>
    <name>myTag</name>
    <tagclass>com.brainysoftware.MyCustomTag</tagclass>
    </tag>
    </taglib>
    Path of MyCustomtag.tld is:
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\WEB-INF
    Path of web.xml is:
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\WEB-INF
    & my web.xml (portion of tld )is:
    <taglib> <taglib-uri>/myTLD</taglib-uri> <taglib-location>/WEB-INF/taglib.tld</taglib-location></taglib>
    Path ofMyCustomtag.class
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\WEB-INF\classes\com\brainysoftware
    & its source is:
    package com.brainysoftware;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyCustomTag extends TagSupport {
    public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();
    try {
    out.println("Hello from the custom tag.");
    catch (Exception e) {
    return super.doEndTag();
    I am accessing it through example folder. I have to run tomcat to tell u the exact url. If the above information is not enopugh I would tell u the exact url. Plz hold sometime for that.
    Zulfi

Maybe you are looking for