JPSTranslate:Custom tag is missing required attribute for

When ever I am placing a label in jsf using RAD i am getting a similar error which i am not able to rectify. And how to integreate swing components in Faces jsp file
Please help me out.

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.

Similar Messages

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

  • Bulk import error - Missing required attribute ‘fullname’

    Folks,
    I am having trouble trying to bulk import some users.
    I have the following file for import (cut down from what I really want to import):
    command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname,global.fullname
    Create,”user1”,”myLDAPresourcename”,”passwd”,”passwd”,”myfirstname1”,”mysurname1”,” myfirstname1 mysurname1”This works using “Accounts->Launch Bulk Actions” with Action set to “From Action List” and everything else on that page left at the default value. The correct data appears in IDM and the LDAP resource.
    Now if I try to import the following file, in which the user does not have a first name, I get in to trouble:
    command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname,global.fullname
    Create,”user2”,”myldapresourcename”,”passwd”,”passwd”,””,”mysurname2”,”mysurname2”
    The error message is:
    com.waveset.Util.WaveSetException: An error occurred adding user ‘uid=user2,…..’ to resource “myLDAPresourcename”.
    com.waveset.util.WavesetException:  Missing required attribute ‘fullname’Clearly the import file contains a column for ‘fullname’ (column 8) and a value for ‘fullname’ in the only row of data “mysurname2”. As far as I am concerned it is perfectly valid for a user not to have a ‘firstname’; but they must have a ‘fullname’.
    I have tried using an import file without a value for ‘fullname’, but with a ‘firstname’ and ‘lastname’ like this
    command,user,waveset.resources,password.password,password.confirmpassword,global.firstname,global.lastname,global.fullname
    Create,”user3”,”myLDAPresourcename”,”passwd”,”passwd”,”myfirstname3”,”mysurname3”,””This works. The correct data appears in IDM and the LDAP resource and IDM has generated a ‘fullname’ value of “{Firstname} {Surname}”. Trying to leave out the ‘firstname’ and the ‘fullname’ gives the same error as above.
    The configuration of my resource (in summary) is
    objectclasses:
         top
         person
         inetOrgPerson
    Account Attributes:
         accounted     -> uid               [required]
         password     -> userPassword
         firstname     -> givenname
         lastname     -> sn               [required]
         objectClass     -> objectClass
         fullname     -> cn               [required]
    As an experiment I have tried reconfiguring the resource so that ‘fullname’ is not marked as required.
    Importing user1 and user3 still works and still creates the correct data in IDM and the LDAP resource.
    Importing user2 now gives a different error:
    com.waveset.Util.WaveSetException: An error occurred adding user ‘uid=user2,…..’ to resource “myLDAPresourcename”.
    javax.naming.directory.SchemaViolationException: [LDAP: error code 65 – Object Class Violation]I don’t understand why, during the import of a user without a ‘firstname’ IDM will not generate a ‘fullname’ or use the supplied ‘fullname’.
    Can anyone help?
    Regards,
    Gavin

    After further testing it turned out that I couldn't create a user without a firstname from the IDM GUI and this in turn was because of the way fullname was generated by the user form.
    I've got the user form changed and now user creation (from the GUI and via bulk import) is working as hoped.

  • Custom Tag with script in attribute.

    Hi,
              I use a custom tag in which an attribute is generated dynamicly.But it
              doesn't work.
              Here is the sample:
              <tlt:MyTag MyAttr="<%= "abc"%>" />
              the result is MyTag doesn't work correctly but output <tlt:MyTag
              MyAttr="abc" /> in the browser source file.My server is wls5.1 sp6.
              Can I use this approach?
              Pan
              

    Pan YangBin wrote:
              >
              > Hi,
              > I use a custom tag in which an attribute is generated dynamicly.But it
              > doesn't work.
              >
              > Here is the sample:
              > <tlt:MyTag MyAttr="<%= "abc"%>" />
              That's because the value of MyAttr attribute is included in the same
              quotes as the value of the expression. Change the line to:
              <tlt:MyTag MyAttr='<%= "abc"%>' />
              and it should do the trick.
              >
              > the result is MyTag doesn't work correctly but output <tlt:MyTag
              > MyAttr="abc" /> in the browser source file.My server is wls5.1 sp6.
              Oh, I see. You didn't specify that the page uses the Tag Library which
              is done by
              <%@ taglib uri="/uri_to_your_TLD" prefix="tlt" %>
              Another mistake is that the name of the "MyAttr" attribute begins with
              the uppercase letter, so at the end the page compilation will result
              with an error saying that appropriate attribute won't be found or so.
              Change the name of "MyAttr" to "myAttr" or whatever you like, but it
              must start with the lowercase letter.
              Take a look at JavaServer Pages specification available at
              http://java.sun.com/products/jsp. There you can find loads of answers,
              esp. a chapter about Tag Extenstions.
              > Pan
              Jacek Laskowski
              HP Consulting
              

  • [svn:fx-trunk] 7553: Fix the default value of the [skinPart] "required" attribute for asdoc.

    Revision: 7553
    Author:   [email protected]
    Date:     2009-06-04 09:32:51 -0700 (Thu, 04 Jun 2009)
    Log Message:
    Fix the default value of the "required" attribute for asdoc.
    Bugs: SDK-21488
    QE Notes: None.
    Doc Notes: None.
    tests: checkintests
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-21488
    Modified Paths:
        flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java

    ${ui:cond( uix.current.isNewRow, 'true', ui:cond( bindings.AddProjectNutsoverleg.value == 1, 'true', 'false' ) ) } notice the '.value' it could also be '.inputValue'.
    If not there is also an option to make sure that when the checkbox is empty a value is returned anyways this work like this:
      protected void processUpdateModel( DataActionContext ctx )
        //First look for the request parameter
        Object cbInRequest = ctx.getHttpServletRequest().getParameter( "nameofthecheckbox" );
        //We only need to do anything if it was not submitted
        if( cbInRequest == null )
          // Get hold of the Form Bean containing the record
          BindingContainerActionForm updateForm = (BindingContainerActionForm) ctx.getActionForm();
          //Get the binding for our particular column
          JUCtrlAttrsBinding checkBoxBinding = (JUCtrlAttrsBinding)updateForm.get( "nameofthecheckbox" );
          //Reset that explicitly to the *unchecked* value
          checkBoxBinding.setAttribute( 0, new oracle.jbo.domain.Number( 0 ) );
        super.processUpdateModel( ctx );
      }Maybe this helps.

  • OBIEE Plug-in for AWM error: Missing spread attribute for dimension\

    Hi,
    While trying to export a cube to OBIEE administrator using the AWM plugin for OBIEE we get the following error for a lot of dimensions.
    AWM version is 11.1.0.7.0B on a 11.1.0.7 DB
    ERROR: Missing spread attribute for dimension DAY_FLG at level ALL_FLAGS
    ERROR: Missing spread attribute for dimension DAY_FLG at level FLAG
    ERROR: Validation problems found for dimension DAY_FLG
    Dimension DAY_FLG will not have UDML generated
    As suggested in other forums I have created a long_desc attribute and selected the "created level attribute in views" option for all the dimensions in the cube, still the error persists.
    Please help.
    Regards,
    Abhishek
    Edited by: 866977 on Jun 20, 2011 3:30 AM

    Thanks for you response David. But I'm afraid this does not solve the problem. I did it to all the dimensions and the error on day_flg persists. I noticed that an error on one of the other dimensions thougfh has changed. Detailed error below:
    ERROR: Missing spread attribute for dimension DAY_FLG at level ALL_FLAGS
    To Fix error: In AWM on the attribute panel for the long description attribute of each applicable dimension -
    select the check box 'Create level attribute columns in views'
    ERROR: Missing spread attribute for dimension DAY_FLG at level FLAG
    ERROR: Validation problems found for dimension DAY_FLG
    Dimension DAY_FLG will not have UDML generated
    ERROR: Missing spread attribute for dimension HOUR at level ALL_HRS
    ERROR: Spread Attribute HR_LONG_DESC found but is not visible for level HR
    The dimension HOUR will be marked invalid and no UDML will be generated for this dimension or any cube dimensioned by this dimension.
    ERROR: Validation problems found for dimension HOUR
    Please help

  • Required Attribute For mx:TextInput

    Hi All,
    I need to set required="true" attribute to
    <mx:TextInput/> .
    But as per the docs, there is no such attribute for this
    component.
    The <mx:FormItem/> has the required Attribute, but i am
    not using the Forms , but a simple TextInput and it should be
    entered mandatory by the User.
    Any Idea's how to set required="true" for
    <mx:TextInput/>
    Regards,
    Madan N

    Hi ,
    below is the code to display the TextInput
    <mx:GridRow>
    <mx:GridItem width="110"><mx:Label text="Name"
    width="100" fontWeight="bold"/></mx:GridItem>
    <mx:GridItem><mx:TextInput width="100" id="name"
    tabIndex="1"/></mx:GridItem>
    <mx:GridItem width="110"><mx:Label text="SurName"
    width="100" fontWeight="bold"/></mx:GridItem>
    <mx:GridItem><mx:TextInput width="100" id="surname"
    tabIndex="2"/></mx:GridItem>
    </mx:GridRow>
    I need to show up the TextInputs as required and a tooltip
    saying this field is required as that showsup when using
    <mx:FormItem/>
    Madan N

  • How to override the default "required" attribute for the UIComponent?

    Hi, consider the following markup: <h:inputText id="txt_firstName" value="#{myBean.firstName}" required="true"/>
    if I leave this field empty and hit the submit button, the required validator will fire an error msg. If however, I leave an empty space in the text box and hit submit button, it will go through no problem.
    I'd like to override the required attribute, so it will trim the spaces first before decide if it really is empty:
    //whatever the name of the method i'm overriding....
    String value = (String)value;
    if(value==null)throw new ValidatorException(whateverDefinedInTheBundle);
    value = value.trim();
    if(value.length==0)throw new ValidatorException(whateverDefinedInTheBundle);
    How can I go about doing that?
    Thank you.

    Did you already try
               <af:treeTable value="#{bindings.DashProjectPhasesDev.treeModel}"
                                  var="node"
                                  selectionListener="#{bindings.DashProjectPhasesDev.treeModel.makeCurrent}"
                                  rowSelection="none" rowBandingInterval="0"
                             inlineStyle="width:810px; height:1100px;"> Check the last line with inlineStyle...
    Julian

  • Custom Tag: Cannot find setter method for attribute

    This has been working fine in appserver6.5.
    In the jsp:
    =======
    <display:table configFileDir="theDirectory"...>
    =======
    The tld entry:
    <tag>
    <name>table</name>
    <tagclass>org.apache.taglibs.display.TableTag</tagclass>
    <teiclass>org.apache.taglibs.display.TableTagExtraInfo</teiclass>
    <bodycontent>JSP</bodycontent>
    <attribute>
    <name>configFileDir</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    =============
    In TableTag.java:
    =============
    private String configFileDir = null;
    public void setConfigFileDir( String v )
         v = v.trim();
    this.configFileDir = v;
    ============
    Help, I'm going nuts.

    Then you also need to create a UI element that extends HtmlPanelGrid
    that has a tModelKey member and getters/setters. That object will hold
    the information so that you can use it in your bean.Whoops... ignore that! Sorry. Attributes are simply stored in the component map component.getAttributes().
    Add to your Tag class:
    public void setProperties(UIComponent component) {
        super.setProperties(component);
        Tags.setString(component, "tModelKey", tModelKey);
    public void release() {
        // see above
    }Where Tags.java is:public class Tags {
        public static void setString(UIComponent component, String attributeName, String attributeValue) {
            if (attributeValue != null) {
                if (UIComponentTag.isValueReference(attributeValue)) {
                    setValueBinding(component, attributeName, attributeValue);
                } else {
                    component.getAttributes().put(attributeName, attributeValue);
        public static void setValueBinding(UIComponent component, String attributeName, String attributeValue) {
            FacesContext context = FacesContext.getCurrentInstance();
            Application app = context.getApplication();
            ValueBinding vb = app.createValueBinding(attributeValue);
            component.setValueBinding(attributeName, vb);
    }

  • How to create a custom tag for a custom converter

    In Jdeveloper 11g, I have a project where I have created a custom converter class that impements the javax.faces.convert.Converter class. I have registered the converter with an id in the faces-config.xml file of the project, and the converter works fine by using the <f:converter type="myconverter"> tag. However, the custom converter has a field which I would like to set from the tag itself. Hence, I would like to add an attribute to <f:converter> tag if possible or create a custom tag that has the attribute.
    I have done some reserach and I found that a custom tag can be implemented: I need to create a class which extends from the ConverterTag class or javax.faces.webapp.ConverterElTag class, which I did, but I also need to create ".tld" (tag library) file which defines the tag itself.
    The part about creating the ".tld" file and registring the new tag is what I'm not sure how to do.
    Does someone know how to do this?
    thank you

    Hi frank,
    that's a good document, and it explains how to make a custom converter. I already created the custom converter, it converts a number to any currency pattern. I know java already has a currency converter, but it doesn't support Rupee currency format, and I need that format.
    My converter works, but I would like to pass the pattern of the format through an attribute in a tag. Since f:converter doesn't seem to support that, I created a custom tag which uses my converter, and it enables me to pass a pattern to the converter.
    All of that works, but I need to be able to pass the pattern as an EL expression, and it's not evaluating the expression before passing it to the converter. It just passes the whole expression as a string. I'm thinking It may be something I'm doing wrong.
    this is the tag library definition file:
    <!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.2</tlib-version>
    <jsp-version>2.1</jsp-version>
    <short-name>custom</short-name>
    <uri>custom-currency-converter</uri>
    <description>
    custom currency custom tag library
    </description>
    <tag>
    <name>CurrencyConverter</name>
    <tag-class>
    converter.Tag.CurrencyConverterTag
    </tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <name>pattern</name>
    <type>java.util.String</type>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    Edited by: Abraham Ciokler on Feb 4, 2011 11:20 AM

  • Error when using a condition for required attribute

    Hi
    I have a requirement to validate the mandatory fields only when the submit button is pressed....if some other button is pressed or some how the form is submitted the validations should not be performed....
    I have used required="#{MyBB.somecondition}" for all the mandatory fields...the method that is being called for doing the condition check is given below:
    public boolean isSomeCondition() {
        // assumes submitButton is a component binding 
        FacesContext fc = FacesContext.getCurrentInstance();
        Map reqParams = fc.getExternalContext().getRequestParameterMap();
        return reqParams.containsKey(submitButton.getClientId());
      }It is same that is given at the following location
    http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works ---Soln 3
    But the problem is if I am submitting the form using Javascript from another page(page is a popup that is opened inside the current window), this condition doesnt work and it gives me an error saying "Check some field for its value"
    Please help me sort out this problem
    Thanks

    I think the problem is not clear....my mistake
    I try to be more elaborate on this....
    I open up a popup page from my main window....Here I perform a search(lets say there is a requirement for finding the Country and pincode for a particular city that the user enters)
    Now when I select the particular row in the datatable and click the submit button...... I want the selected values to be filled inside the parent window.....
    I want to bring to your notice that the button that is clicked is in the popup page...not in the parent window.....
    So you see that when that button in popup is clicked i am submiting the form of the parent window and during that time I dont want the validation to occur..... To submit the form of the parent window I use the Javascript like this : window.opener.document.forms[0].submit();Also one more thing that I want to mention is that the method that is used for specifying the condition for required attribute for mandatory fields in the parent window works fine for any button that i click inside my parent window......
    What I mean by this is lets say I have a button to add a dynamic row into my parent page then also I have to submit the form but during that time validation should not occur and it works fine.
    So now I think its clear that the Javascript is being invoked from another page which is submitting the parent window.....
    Then you're doing something wrong. Invoking the wrong button maybe? So please enlighten me where i am wrong and how possibly would I know which button I am invoking??

  • Why doesn't my custom tag work?

    First, my backend database is MS Access. Nothing I can do about that, unfortunately.
    I have defined three custom tags (no body, no attributes) to display report information from my project tracking/metrics Access database:
    <prefix:showProjectInfo />
    <prefix:showProjectTeam />
    <prefix:showProjectHistory />
    In my JSP, the first tag I use, <prefix:showProjectInfo />, works perfectly. However, <prefix:showProjectTeam /> gives no output.
    First, here is the tld file that defines the tags (report.tld):
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE taglib
            PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
            "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
        <tlib-version>1.0</tlib-version>
        <jsp-version>1.2</jsp-version>
        <short-name>report</short-name>
        <uri>/report</uri>   
        <!-- Forte4J_TLDX:  This comment contains code generation information. Do not delete.
        <tldx>
            <tagHandlerGenerationRoot>classes</tagHandlerGenerationRoot>
        </tldx>
        -->
        <!-- A validator verifies that the tags are used correctly at JSP
             translation time. Validator entries look like this:
          <validator>
              <validator-class>com.mycompany.TagLibValidator</validator-class>
              <init-param>
                 <param-name>parameter</param-name>
                 <param-value>value</param-value>
           </init-param>
          </validator>
       -->
       <!-- A tag library can register Servlet Context event listeners in
            case it needs to react to such events. Listener entries look
            like this:
         <listener>
             <listener-class>com.mycompany.TagLibListener</listener-class>
         </listener>
       -->
       <tag>
            <name>showProjectInfo</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectInfoTag</tag-class>
            <body-content>empty</body-content>
            <description>Shows the basic project information</description>       
       </tag>
       <tag>
            <name>showProjectTeam</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectTeamTag</tag-class>
            <body-content>empty</body-content>
       </tag>
       <tag>
            <name>showProjectHistory</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectHistoryTag</tag-class>
            <body-content>empty</body-content>
       </tag>
    </taglib>Next, here is the relevant section of web.xml that defines this taglib:
      <taglib>
            <taglib-uri>/WEB-INF/report.tld</taglib-uri>
            <taglib-location>/WEB-INF/report.tld</taglib-location>
      </taglib>Next, the code for showProjectTeamTag.java:
    * showProjectTeam.java
    * Created on March 9, 2005, 10:46 AM
    package mil.usaf.rad.metrics.report;
    import java.io.*;
    import java.sql.*;
    import java.lang.Integer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * @author  jason.ferguson
    public class showProjectTeamTag extends TagSupport
        public showProjectTeamTag()
            super();
        public int doAfterBody() throws JspException
            HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
            int pr_id = Integer.parseInt(req.getParameter("pr_id"));
            JspWriter out = pageContext.getOut();
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
               out.print("test");
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               conn = DriverManager.getConnection("jdbc:odbc:Metrics");
            catch (Exception e)
                throw new JspException(e.getMessage());
            String queryGetTeam = "SELECT Projects.pr_id, Accounts.name AS Name, Sum(Schedule.hours) AS SumOfhours FROM tblTAAccounts AS Accounts INNER JOIN ((tblTAScheduleEntries AS Schedule INNER JOIN tblProjectRelease AS ProjectRelease ON Schedule.projectID = ProjectRelease.tblFKTimeAccntProject) INNER JOIN tblPMProjects AS Projects ON ProjectRelease.Release_ID = Projects.pr_id) ON Accounts.accountID = Schedule.accountID WHERE Projects.pr_id=" + pr_id + " GROUP BY Projects.pr_id, Accounts.name, ProjectRelease.Release_number, Projects.Project_name";
            try
                out.print(queryGetTeam);
                stmt = conn.createStatement();
                rs = stmt.executeQuery(queryGetTeam);
                if (rs == null)
                    out.print("No Results!");
                out.print("<table>\n");
                out.print("<tr>\n");
                out.print("<th>Name</th>\n");
                out.print("<th>Total Hours</th>\n");
                out.print("</tr>\n");
                while(rs.next())
                    out.print("<tr>\n");
                    out.print("<td>" + rs.getString("Name") + "</td>\n");
                    out.print("<td>" + rs.getInt("SumOfhours") + "</td>\n");
                    out.print("</tr>\n");
                out.print("</table>\n");
                rs.close();
                stmt.close();
                conn.close();
            catch (Exception e)
                throw new JspException(e.getMessage());
            return SKIP_BODY;
    }Finally, projectdetail.jsp, where the tag is called:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.sql.*" %>
    <%@page import="java.lang.Integer" %>
    <%@taglib uri="/WEB-INF/report.tld" prefix="report" %>
    <html>
    <head><title>Project Detail</title></head>
    <body>
    <h1 align="center">Project Status</h1>
    <h3>Project Description</h3>
    <report:showProjectInfo />
    <h3>Team Members</h3>
    <report:showProjectTeam />
    </body>
    </html>The first tag, <report:showProjectInfo />, works fine. However, I get no output whatsoever when the system encounters <report:showProjectTeam />. I am a relative newbie at this, so any help is appreciated.
    Jason

    It doesnt seem to matter if the code is in doStartTag(), doEndTag(), orr any of the other functions.
    I also put, as the first item in the function:
    System.out.println("TEST");Nothing.
    Just as an aside, here is the code for the <prefix:showProjectInfo />. Maybe I made a mistake in it? I closed the resultset and connection...
    import java.io.*;
    import java.sql.*;
    import java.lang.Integer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * @author  jason.ferguson
    public class showProjectInfoTag extends BodyTagSupport
        public int doEndTag() throws JspException
            HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
            int pr_id = Integer.parseInt(req.getParameter("pr_id"));
            JspWriter out = pageContext.getOut();
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                conn = DriverManager.getConnection("jdbc:odbc:Metrics");
            catch (Exception e)
                throw new JspException(e.getMessage());
            String queryProjectInfo = "SELECT * FROM tblPMProjects WHERE pr_id=" + pr_id;
            try
                stmt = conn.createStatement();
                rs = stmt.executeQuery(queryProjectInfo);
                while (rs.next())
                    out.print("<table border=\"1\" style=\"border-collapse:collapse\">\n");
                    out.print("<tr>\n");
                    out.print("<td><b>Project Name:</b>" + rs.getString("Project_name") + "</td>\n");
                    out.print("<td align=\"right\"><b>RAD Number:</b>" + rs.getString("tblProjectNumber") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Project description: " + rs.getString("Project_description") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer: " + rs.getString("Customer_POC") + "</td>");
                    out.print("<tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer Unit: " + rs.getString("Customer_OFC") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer Phone: " + rs.getString("Customer_phone") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("</table>\n");
                    rs.close();
                    stmt.close();
                    conn.close();
            catch (Exception e)
                throw new JspException(e.getMessage());
            finally
                //conn.close();
            return SKIP_BODY;

  • JSP Custom Tags, Tag Handlers, Passing values

    Multiple questions here while I try to work with custom tags (its a requirement):
    From what I have had so far - I have a .tld file, a .java file and a .jsp page.
    (this is not a working version as I just got it from a website)
    platform: tomcat on an xp box.
    I was wondering if we can pass the parameters that are passed to the the jsp page (like blah.jsp?param1=value1&param2=valu2 ) to the tag handler?
    This is because the processing that I need to do in the handler would depend on what I have in the passed values.
    Any help in letting me know where to place those files on the tomcat context root would help. Please see, I do have a couple of servlets running on the box also and they might be in the same context root.
    Any good short tutorial link is also welcome as a short answer as I try to unravel the custom tags in jsp.

    I am using TomCat 5.5
    What I need to do using tags is to build a web-page on the fly by polling a couple of different tables in the database.
    This is to be done using a jsp and custom tag (requirement) which would be able to handle any resultsets. We also have to come up with pageContext attribute names and supply column names as those attributes. Thus we will have to come up with the meta data file and a tag library descriptor as well.
    I found a helloworld solution on a website and was trying to modify it to meet my needs. But I guess I under-estimated the work that needed to be done in this one.

  • Trying to create a custom tag

    I want to create a custom tag that has a attribute that ask
    for a number. like below...
    <cf_makeattributes number="?">
    Now say I made that number something like 5
    <cf_makeattributesnumber=
    "5">
    I would like for the tag to take that number and make 5
    attributes called "Form" in a array from 1 to 5 like below...
    <cfset attributes.form = arraynew(1)>
    <cfloop index="i" from="1" to="#attributes.number#">
    #attributes.form
    </cfloop>
    Is it possible to make a tag that ask for a number like 5 and
    make 5 attributes and within the same tag assign values to those 5
    attributes. for example consider the above.
    <cf_makeattributes number="5" attribute1="hi"
    attribute2="hello" attribute3="howdy" attribute4="hey"
    attribute5="HOWE!">
    or say i want to make 2 attributes and assign 2 values to
    those attributes
    <cf_makeattributes number="2" attribute1="This tag asked
    for 2 numbers" attribute2="and therefore gave me the ability to
    make 2 attributes">
    I also have another question that kinda applies to the
    question above.
    How does the coldfusion server read the tags. for example
    look at below
    <cf_makeattributes number="2" attribute1="hello"
    attribute2="world">
    would the server read it like this...
    step 1
    <
    cf_makeattributes number="2" attribute1="hello"
    attribute2="world">
    step 2
    <cf_makeattributes
    number="2" attribute1="hello" attribute2="world">
    step 3
    makeattributes.CFM (it now goes to the template that holds
    the tags scripts)
    Or does it first read all thats bold below
    <cf_makeattributes
    number="2" attribute1="hello" attribute2="world">
    then goes to the makeattributes template. Is there away I
    can compile my script one step at a time like C# and C++ just to
    see the steps
    PLUS Do i have to put my custom tag into a specific folder or
    can I just put it in the same folder as the document thats calling
    the custom tag

    > I could either make a bunch of attributes that will grab
    all the
    > values or I could loop out a array of attributes. Thats
    my goal
    I was with you until that line. The term attributes is
    confusing in this context. I'm not sure if you're talking about
    attributes in a generic sense or the custom tag attribute
    scope.
    > Now here wat im thinking now. What if instead I put the
    forms in a list. something like this...
    > <cf_Formentry
    Forms="#Form.one#,#form.two#,#form.three#">
    Do you mean form
    fields?
    Let's try this from a different angle. Can you give a
    concrete example of the desired results using this form?
    <form>
    <input name="username1" value="Alice">
    <input name="username2" value="Bob">
    <input name="username3" value="Kyle">
    <input name="username4" value="Michelle">
    <input name="username5" value="Robert">
    </form>

  • Cfselect "required" attribute

    hi guys, i've been having trouble with the required attribute
    for cfselect. i can't seem to find a time when the javascript will
    launch. I've searched online and i've seen that other ppl have been
    having probs with this too, but i didn't see anything about a
    solution. any help would be appreciated

    It seems that there is a "bug" in the CFFORM.JS file in how
    it handles the CFSELECT required attribute (see comments at the
    bottom of the
    http://livedocs.macromedia.com/coldfusion/5.0/CFML_Reference/Tags91.htm
    page). Just adding a one-line change to the CFFORM.JS file fixes
    the problem. Note that if you have multiple site instances on one
    server, you may have to apply this fix to every CFFORM.JS that
    exists within the JRUN4\Servers\... folders.
    I should also mention, as stated in the Live Docs page (see
    above link), that if you use the MULTIPLE parameter of the CFSELECT
    tag that it works fine. It is when you only want to restrict to one
    selection that the CFFORM.JS fix is needed.
    I would expect that the CFFORM.JS change would be valid fix
    for most of the versions (I am running CFMX 7.0.2). Hopefully Adobe
    will apply this fix to any future releases of the CFFORM.JS file.

Maybe you are looking for