Finding the custom tag name from inside the tag handler

Hello,
I searched the forum, but couldnt find the answer (or in the API). In my custom tag handler, I want to know what the name of the custom tag was. Is this possible?
Thanks in advance.
Chris
ps. Without parsing the .tld file... :)

Hmm, that's unfortunate. Thanks a lot for your work. I had a feeling since it wasn't in the API that it wasn't possible. Here's why, and maybe they will add this feature later...
We are making our own tags for buttons on our app (the button will be an HTML table, with a clickable background, that looks like an image, but isnt).
The HTML designers want tags they can drag and drop to the screen in DreamWeaver, including visual feedback on what they dragged and dropped. So the tag <fast:blueButton>Continue</fast:blueButton> will show a blue button image in dreamWeaver with "Continue" as the text. There are a lot of parameters to set for each button, like height, width, border, etc. that will be configured in an XML config file for each button.
It would be nice if all the buttons we invent in the tld point to the same generic button class, and when the generic button class runs, sees which button called it, and gets its config from an XML file.
This way the designer could add more buttons with the tld and XML config, and no more java classes are needed. However, if a generic button is sent with a type param: <fast:button type="blue">Continue</fast:button> then there is no visual feedback in the tool (in the first case we could have set the fast:blueButton to be the image of a blue button) and it cant be picked from a list in the tool (the designer needs to remember which types exist). It seems not important to programmers, but for designers it is important.
Oh well, I will see if there is another way to NOT have tons of Java classes to support.
Thanks,
Chris

Similar Messages

  • How to determine the Current Domain name from inside an Mbean / Java Prog

    We have registered an Application Defined MBean. The mbean has several APIs. Now we want to determine the currrent domain using some java api inside this Mbean. Similarly we have deployed a Webapp/Service in the Weblogic domain. And inside this app we need to know the current Domain. Is there any java api that will give this runtime information.
    Note: We are the MBean providers not clients who can connect to the WLS (using user/passwd) and get the domain MBean and determine the domain.
    Fusion Applcore

    Not sure if this will address exactly what you are looking to do, but I use this technique all the time to access runtime JMX information from within a Weblogic deployed application without having to pass authentication credentials. You are limited, however, to what you can access via the RuntimeServiceMBean. The example class below shows how to retrieve the domain name and managed server name from within a Weblogic deployed application (System.out calls only included for simplicity in this example):
    package com.yourcompany.jmx;
    import javax.management.MBeanServer;
    import javax.management.ObjectName;
    import javax.naming.InitialContext;
    public class JMXWrapper {
        private static JMXWrapper instance = new JMXWrapper();
        private String domainName;
        private String managedServerName;
        private JMXWrapper() {
        public static JMXWrapper getInstance() {
            return instance;
        public String getDomainName() {
            if (domainName == null) {
                try {
                    MBeanServer server = getMBeanServer();
                    ObjectName domainMBean = (ObjectName) server.getAttribute(getRuntimeService(), "DomainConfiguration");
                    domainName = (String) server.getAttribute(domainMBean, "Name");
                } catch (Exception ex) {
                    System.out.println("Caught Exception: " + ex);
                    ex.printStackTrace();
            return domainName;
        public String getManagedServerName() {
            if (managedServerName == null) {
                try {
                    managedServerName = (String) getMBeanServer().getAttribute(getRuntimeService(), "ServerName");
                } catch (Exception ex) {
                    System.out.println("Caught Exception: " + ex);
                    ex.printStackTrace();
            return managedServerName;
        private MBeanServer getMBeanServer() {
            MBeanServer retval = null;
            InitialContext ctx = null;
            try {
                //fetch the RuntimeServerMBean using the
                //MBeanServer interface
                ctx = new InitialContext();
                retval = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
            } catch (Exception ex) {
                System.out.println("Caught Exception: " + ex);
                ex.printStackTrace();
            } finally {
                if (ctx != null) {
                    try {
                        ctx.close();
                    } catch (Exception dontCare) {
            return retval;
        private ObjectName getRuntimeService() {
            ObjectName retval = null;
            try {
                retval = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
            } catch (Exception ex) {
                System.out.println("Caught Exception: " + ex);
                ex.printStackTrace();
            return retval;
    }I then created a simply test JSP to call the JMXWrapper singleton and display retrieved values:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page import="com.yourcompany.jmx.JMXWrapper"%>
    <%
       JMXWrapper jmx = JMXWrapper.getInstance();
       String domainName = jmx.getDomainName();
       String managedServerName = jmx.getManagedServerName();
    %>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JMX Wrapper Test</title>
        </head>
        <body>
            <h2>Domain Name: <%= domainName %></h2>
            <h2>Managed Server Name: <%= managedServerName %></h2>
        </body>
    </html>

  • How to find list or folder name from SharePoint document URL

    I'm implementing the SharePoint client object model in my VSTO application in .NET framework 4.0(C#).
    Actually we open MS Word files from SharePoint site, we need to create a folder inside the opened documents list/folder and after it we want to upload/add some files to that created folder.
    My problem is that how to get list name/title and folder name of opened document by using the documents URL or Is there an another option to find the list or folder name of opened document.
    Any help will be appreciable.

    In document Library you can get the name of document library directly in URL. for folder name you can try below:
    using System;
    using Microsoft.SharePoint;
    namespace Test
    class ConsoleApp
    static void Main(string[] args)
    using (SPSite site = new SPSite("http://localhost"))
    using (SPWeb web = site.OpenWeb())
    if (web.DoesUserHavePermissions(SPBasePermissions.BrowseDirectories))
    // Get a folder by server-relative URL.
    string url = web.ServerRelativeUrl + "/shared documents/test folder";
    SPFolder folder = web.GetFolder(url);
    try
    // Get the folder's Guid.
    Guid id = folder.UniqueId;
    Console.WriteLine(id);
    // Get a folder by Guid.
    folder = web.GetFolder(id);
    url = folder.ServerRelativeUrl;
    Console.WriteLine(url);
    catch (System.IO.FileNotFoundException ex)
    Console.WriteLine(ex.Message);
    Console.ReadLine();
    http://msdn.microsoft.com/en-us/library/office/ms461676(v=office.15).aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/801d1a06-0c9b-429b-a848-dd6e24de8bb9/sharepoint-webservice-to-get-the-guid-of-the-folder?forum=sharepointdevelopmentlegacy
    You can also try below:
    http://blogs.msdn.com/b/crm/archive/2008/03/28/contextual-sharepoint-document-libraries-and-folders-with-microsoft-dynamics-crm.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d2d5d7cf-9bbd-4e0f-a772-ecdce4e6149f/how-to-fetch-document-guid-from-sharepoint-document-library-using-sharepoint-web-service?forum=sharepointdevelopmentlegacy
    http://stackoverflow.com/questions/2107716/how-to-get-guid-of-a-subfolder-in-a-document-library-programmatically

  • Send email (c#) using ews and set custom display name (from)

    How to connect to exchange service via exchange web services send a mail and the display name is custom ?
    With this code, just connect to exchange server (ews) and send a mail.
    How to change my code ?
    private void t() {
    const string subjectBody = "test email ";
    const string username = "username";
    const string password = "password";
    const string domain = "domain";
    const string ewsURL = "http://exchangesrv/ews/exchange.asmx";
    unews.ExchangeServiceBinding esb = new unews.ExchangeServiceBinding();
    esb.Credentials = new System.Net.NetworkCredential( username, password, domain );
    esb.Url = ewsURL;
    unews.CreateItemType newItem = new unews.CreateItemType();
    newItem.MessageDisposition = unews.MessageDispositionType.SendAndSaveCopy;
    newItem.MessageDispositionSpecified = true;
    unews.MessageType msg = new unews.MessageType();
    msg.Subject = subjectBody;
    msg.Body = new unews.BodyType();
    msg.Body.BodyType1 = unews.BodyTypeType.Text;
    msg.Body.Value = subjectBody;
    msg.ToRecipients = new unews.EmailAddressType[1];
    msg.ToRecipients[0] = new unews.EmailAddressType();
    msg.ToRecipients[0].EmailAddress = "[email protected]";
    newItem.Items = new unews.NonEmptyArrayOfAllItemsType();
    newItem.Items.Items = new unews.ItemType[1];
    newItem.Items.Items[0] = msg;
    try {
    unews.CreateItemResponseType createItemResponse = esb.CreateItem( newItem );
    if (createItemResponse.ResponseMessages.Items[0].ResponseClass == unews.ResponseClassType.Error) {
    throw new Exception( createItemResponse.ResponseMessages.Items[0].MessageText );
    else {
    Console.WriteLine( "Item was created" );
    catch (Exception ex) {
    Console.WriteLine( ex.ToString() );
    With this code, can connect to a exchange server (smtp) and send a mail, with a custom display name.
    System.Net.Mail.SmtpClient smtpc = new System.Net.Mail.SmtpClient( "exchangesrv" );
    System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage( "CustomDisplayName <[email protected]>", "[email protected]", "test email", "test email" );
    smtpc.Credentials = new System.Net.NetworkCredential( "username", "password", "domain" );
    smtpc.Send( mm );

    That won't work the way you want it in EWS, like when you send via Outlook or OWA when you send a messages via EWS it's submitted via the Exchange store so the Sender Address will be resolved back to the default Reply address for whatever account your trying
    to send as. If you need some sort of custom display name I would suggest you stick to SMTP or possible create a Transport Agent that would rewrite the address before its sent externally.
    Cheers
    Glen

  • Accessing JSP Variables in Custom Tag Handler.

    Hi,
    I am creating a custom tag which builds a list view. I have certain String array in my JSP and I need to pass the same into my Tag Handler class. I tried following ways :
    1. In doStartTag() implementation I used
       public int doStartTag() {
             String[] myArray = (String[])pageContext.getAttribute("mystringarray", PageContext.PAGE_SCOPE;
       }This is not recognizing the String array variable defined in my JSP.
    2. I used separate attribute which is passed from the JSP to the custom tag as parameter having "rtexprvalue" as true. But I cann't pass a Sting array into my tag handler class. I can pass only String.
    How can I access variables which are defined in the JSP using declaration block. i.e.
    <%!
    String[] myArray = new String[100];
    %>
    Thanks for the time.

    You should be able to pass any type you like as an attribute to the tag.
    You just have to define its type as String[] in your tld:
    <attribute>
    <name>stringArray</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>java.lang.String[]</type>
    </attribute>
    Alternatively, If you declare your array like:
    <%!
    String[] myArray = new String[100];
    %>You can do this:
    pageContext.setAttribute("mystringarray", myArray);
    which will put it into the page context for you to pick up in your custom tag.
    Hope this helps,
    evnafets

  • How can I find the servlet class name from inside a ServletFilter?

    Ive implemented a servlet filter, but need to discover the class name of any servlet class that gets executed.
    Ive dug through the spec and cant seem to find any path to do this.
    Seems the methods needed to do this have been deprecated. (for security reasons?)
    Is there any way to write a ServletFilter to grab this info?
    If not, is there any other way to capture every servlet execution in the container, time its execution, and log the class name along with the execution time?
    (***WITHOUT*** requiring a classpath over ride of any container provider classes)
    Any help is much appreciated. Been banging my head against this for some time now :(

    request.getServletPath() returns the part of the URL which refers to the servlet. It isn't the classname of the servlet but it should be a reasonable surrogate. If you log that, then you could write some code which reads your web.xml and uses the servlet-mapping elements to convert it to servlet class names later.

  • Find transaction and exit name from the name of include program

    hai
    i want to know the transaction that is executing
    the exit which includes the include name
    as "LVKMPFZ2"
    can anyone tell me the procedure (dont forget steps )
    to know the transaction
    (but this program is include SAP automatic credit control configuration)

    Hi
    Try TSP01-Suffix2
    Regards
    Raj

  • How to find out sub site name from which sub site template is created - in solution gallery

    hi,
     i am having an issue in my "save site as a template". i have created  a subsite few weeks back with doc libs and  splists, disc.forum and  based on the template subsite I have created new subsites. now 
    as  per my new requirement i need to add new  doclibs and few columns in these doc lib. But I am unable to find which sub site was taken as a template.since i have many  subsites with different names, I forgott
    to make meaningful names, i gave some datetime for the templatesubsites,
    like project_27_jul_2pm,project_20_jul_7pm, etc etc.
    So would like to know, is it possible to find out from which subsite I have taken/prepared  the template subsite.
    any APIs are available or any power shell scripts. such that i can find  out from which subsite i have created this  sub site template.

    check this
    http://social.msdn.microsoft.com/Forums/en-US/3c492adb-e7cb-4f5c-8c29-386a21c3498e/how-to-find-out-a-list-of-sites-created-from-a-template?forum=sharepointgeneralprevious

  • How to find a Region id/name from a JTT jsp page

    Hi,
    i am on a SR details page , which i think is , ibuSRDetails.jsp in Isupport. How do i find which region it is belongs to ?
    I wanted to find out the region id /name so that i can customize the region.
    thansk
    -mahendra

    iSupport Documentation
    Or jsp source file. It will have the AK Developer Region Name.
    Or Search AK Developer Attributes with display name of the fields from SR form Header.
    May be iSupport experts might throw some light.
    HTH
    Srini

  • How do i reference a movie clip instance name from inside child movie clips.

    I have a label I am referencing form a movie clip inside the movie clip which contains the "label_2."
    Here is the code I used:
    MovieClip(parent.parent).gotoAndPlay("return_2");
    Now I need to reference a instance name of a movie clip in side the same scene.
    What would the code be?

    You should probably start by reading the docs and/or google:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7fca.html
    http://www.google.com/search?hl=en&q=AS3+events
    Once you got the basics down, look into creating/using your own custom events:
    http://www.google.com/search?hl=en&q=AS3++custom+events
    http://www.adobe.com/devnet/actionscript/articles/event_handling_as3.html
    Event dispatching and event handling is one of the most important things about ActionScript. The sooner you get into them, the better.

  • Finding message bundle from custom tag

    I have a JSP page which has a <fmt:setBundle> to set the translations bundle. It also has a tag which I handle using a custom tag handler based on TagSupport. One of the attributes to this tag is a string which I need to look up in the message bundle, so I need to find the right message bundle as set at the top of the JSP page.
    So putting the question succinctly, how, from custom tag handler code, do I find the message bundle the page is using?

    So putting the question succinctly, how, from custom tag handler code, do I find the message bundle the page is using? To answer your question:
    The <fmt:setBundle> tag (according to the documentation:
    Creates an i18n localization context and stores it in the scoped variable or the
    javax.servlet.jsp.jstl.fmt.localizationContext configuration variableSo you can look up that configuration variable, and use its information to obtain the resource bundle name, or the Localization object which wraps the bundle.
    Of course, thats the hard way...
    You see the friendly folks who wrote the JSTL knew that there would be people who would want to do this.
    So they wrote a helper class for us: [javax.servlet.jsp.jstl.fmt.LocaleSupport|http://java.sun.com/products/jsp/jstl/1.1/docs/api/javax/servlet/jsp/jstl/fmt/LocaleSupport.html]
    A better question is actually:
    How do I look up a message in the bundle set by JSTL <fmt:setBundle> when I am in a custom tag handler?The answer is:
    LocaleSupport.getLocalizedMessage(pageContext, key)Its all in their (relatively readable) [JSTL specification|http://java.sun.com/products/jsp/jstl/reference/api/index.html]
    cheers,
    evnafets

  • Cannot find CFML template for custom tag

    Why am I getting this error when my code looks like this?
    Cannot find CFML template for custom tag UPSPrice.
    ColdFusion attempted looking in the tree of installed custom tags but did not find a custom tag with this name. If you are using per-applica
    <Cfif NOT form.shipzip IS "">
    <CF_UPSPrice SERVICE="#form.upsshiptype#" FROM="#shopshipzip#" TO="#FORM.shipzip#" WEIGHT="#getshipweight.totwei#">
    <cfelse>
    <CF_UPSPrice SERVICE="#form.upsshiptype#" FROM="#shopshipzip#" TO="#FORM.zip#" WEIGHT="#getshipweight.totwei#">
    </cfif>

    UPSPrice.cfm file:
    <!---
    NAME:
    CF_UPSPrice
    DESCRIPTION:
    Cold Fusion custom tag obtain UPS shipping costs from ups.com.
    ATTRIBUTES:
    CALLTAG   - (optional) Electronic or basic call tag issued, valid options
                           are NONE BASIC or ELECTRONIC, defaults to NONE.
    COD       - (optional) Package is being sent C.O.D., valid options are YES
                           and NO, defaults to NO.
    FROM      - (required) Source (ship from) postal code.
    HANDLING  - (optional) Requires special handling (eg. - any article that
                           is not fully encased in an outside shipping container,
                           or any package that exceeds 60 inches in length).
    HAZARD    - (optional) Package contains hazardous material, valid options are YES
                           and NO, defaults to NO.
    HEIGHT    - (optional) Height (in inches) of oversized package.
    LENGTH    - (optional) Length (in inches) of oversized package.
    OVERSIZED - (optional) Package is oversized, valid options are YES and NO,
                           defaults to NO.
    RESPONSE  - (optional) Delivery confirmation service, valid options are
                           NONE BASIC SIGNATURE ALTERNATE or ALL, defaults to
                           NONE.
    SATDELIV  - (optional) Saturday delivery, valid options are YES and NO,
                           defaults to NO.
    SATPICKUP - (optional) Saturday pickup, valid options are YES and NO,
                           defaults to NO.
    SERVICE   - (required) UPS Service ID, valid service IDs are:
                           1DM    - Next Day Air Early AM
                           1DML   - Next Day Air Early AM Letter
                           1DA    - Next Day Air
                           1DAL   - Next Day Air Letter
                           1DP    - Next Day Air Saver
                           1DPL   - Next Day Air Saver Letter
                           2DM    - 2nd Day Air A.M.
                           2DA    - 2nd Day Air
                           2DML   - 2nd Day Air A.M. Letter
                           2DAL   - 2nd Day Air Letter
                           3DS    - 3 Day Select
                           GNDCOM - Ground Commercial
                           GNDRES - Ground Residential
    SHIPNOT1  - (optional) First ship notification, valid options are NONE
                           DOMESTIC or INTERNATIONAL, defaults to NONE.
    SHIPNOT2  - (optional) Second ship notification, valid options are NONE
                           DOMESTIC or INTERNATIONAL, defaults to NONE.
    TOCOUNTRY - (optional) Destination country code, defaults to US if not
                           specified. Visit the UPS site for a complete list of
                           valid two letter country codes.
    TO        - (required) Destination (ship to) postal code.
    VALUE     - (optional) Declared value for carrier liability, carrier assumes
                           $100 by default.
    VERBCONF  - (optional) Verbal confirmation of delivery, valid options are YES
                           and NO, defaults to NO.
    WEIGHT    - (required) Weight (in pounds) of package, fractions may be used.
    WIDTH     - (optional) Width (in inches) of oversized package.
    NOTES:
    This tag submits a shipping cost request to UPS for processing, and returns
    price and shipping information. CF_UPSPrice sets the following variables that
    you may use within your template after the call to CF_UPSPrice:
    UPS_BaseCharge     - Base shipping charge.
    UPS_Charge         - Total charge.
    UPS_Error          - Error message, if there was one.
    UPS_ErrorCode      - Error code, if there was one.
    UPS_FromCountry    - Source country code.
    UPS_FromPostal     - Source postal code.
    UPS_GuaranteedBy   - Guranteed delivery time.
    UPS_OptionalCharge - Total of optional charges.
    UPS_Service        - UPS service ID.
    UPS_Success        - YES if request was successful, NO if not.
    UPS_ToCountry      - Destination country code.
    UPS_ToPostal       - Destination postal code.
    UPS_ToZone         - Destination zone.
    UPS_Weight         - Billed weight.
    USAGE:
    To use just call <CF_UPSPrice> from within your Cold Fusion template,
    passing at least the required attributes TO FROM SERVICE and WEIGHT.
    EXAMPLES:
    Obtain price for next day package from NY to CA:
      <CF_UPSPrice SERVICE="1DA" FROM="11213" TO="90046" WEIGHT="1.5">
      <CFOUTPUT>Cost is #DollarFormat(UPS_Charge)#</CFOUTPUT>
    Sending a oversized package C.O.D. via second day air:
      <CF_UPSPrice SERVICE="2DA" FROM="11213" TO="90046"
       WEIGHT="1.5" HEIGHT="13" WIDTH="12" LENGTH="20" COD="Yes">
    Using form fields:
      <CF_UPSPrice SERVICE="#service#" FROM="#from#" TO="#to#" WEIGHT="#weight#">
    AUTHOR:
    Ben Forta ([email protected]) 10/14/97
    With help from Dave Beckstrom ([email protected])
    --->
    <!--- Initialize variables --->
    <CFSET proceed = "Yes">
    <CFSET error_message = "">
    <!--- Get UPS service --->
    <CFIF proceed>
    <CFIF IsDefined("ATTRIBUTES.service")>
      <CFSET product = ATTRIBUTES.service>
    <CFELSE>
      <CFSET proceed = "No">
      <CFSET error_message = "SERVICE must be specified!">
    </CFIF>
    </CFIF>
    <!--- Get destination postal code --->
    <CFIF proceed>
    <CFIF IsDefined("ATTRIBUTES.to")>
      <CFSET destPostal = ATTRIBUTES.to>
    <CFELSE>
      <CFSET proceed = "No">
      <CFSET error_message = "TO postal code must be specified!">
    </CFIF>
    </CFIF>
    <!--- Get source postal code --->
    <CFIF proceed>
    <CFIF IsDefined("ATTRIBUTES.from")>
      <CFSET origPostal = ATTRIBUTES.from>
    <CFELSE>
      <CFSET proceed = "No">
      <CFSET error_message = "FROM postal code must be specified!">
    </CFIF>
    </CFIF>
    <!--- Get weight --->
    <CFIF proceed>
    <CFIF IsDefined("ATTRIBUTES.weight")>
      <CFSET weight = ATTRIBUTES.weight>
    <CFELSE>
      <CFSET proceed = "No">
      <CFSET error_message = "WEIGHT postal code must be specified!">
    </CFIF>
    </CFIF>
    <!--- If all okay, process other options --->
    <CFIF proceed>
    <!--- Get destination country --->
    <CFSET destCountry = "US">
    <CFIF IsDefined("ATTRIBUTES.tocountry")>
      <CFSET destCountry = ATTRIBUTES.tocountry>
    </CFIF>
    <!--- Get oversized --->
    <CFSET oversized = "0">
    <CFIF IsDefined("ATTRIBUTES.oversized")>
      <CFIF ATTRIBUTES.oversized>
       <CFSET oversized = "1">
      </CFIF>
    </CFIF>
    <!--- Get COD --->
    <CFSET cod = "0">
    <CFIF IsDefined("ATTRIBUTES.cod")>
      <CFIF ATTRIBUTES.cod>
       <CFSET cod = "1">
      </CFIF>
    </CFIF>
    <!--- Get hazard --->
    <CFSET hazard = "0">
    <CFIF IsDefined("ATTRIBUTES.hazard")>
      <CFIF ATTRIBUTES.hazard>
       <CFSET hazard = "1">
      </CFIF>
    </CFIF>
    <!--- Get handling --->
    <CFSET handling = "0">
    <CFIF IsDefined("ATTRIBUTES.handling")>
      <CFIF ATTRIBUTES.handling>
       <CFSET handling = "1">
      </CFIF>
    </CFIF>
    <!--- Get calltag --->
    <CFSET calltag = "0">
    <CFIF IsDefined("ATTRIBUTES.calltag")>
      <CFIF ATTRIBUTES.calltag IS "BASIC">
       <CFSET calltag = "1">
      <CFELSEIF ATTRIBUTES.calltag IS "ELECTRONIC">
       <CFSET calltag = "2">
      </CFIF>
    </CFIF>
    <!--- Get Saturday delivery --->
    <CFSET saturdaydelivery = "0">
    <CFIF IsDefined("ATTRIBUTES.satdeliv")>
      <CFIF ATTRIBUTES.satdeliv>
       <CFSET saturdaydelivery = "1">
      </CFIF>
    </CFIF>
    <!--- Get Saturday pickup --->
    <CFSET saturdaypickup = "0">
    <CFIF IsDefined("ATTRIBUTES.satpickup")>
      <CFIF ATTRIBUTES.satpickup>
       <CFSET saturdaypickup = "1">
      </CFIF>
    </CFIF>
    <!--- Get response --->
    <CFSET response = "0">
    <CFIF IsDefined("ATTRIBUTES.response")>
      <CFIF ATTRIBUTES.response IS "BASIC">
       <CFSET response = "1">
      <CFELSEIF ATTRIBUTES.response IS "SIGNATURE">
       <CFSET response = "2">
      <CFELSEIF ATTRIBUTES.response IS "ALTERNATE">
       <CFSET response = "3">
      <CFELSEIF ATTRIBUTES.response IS "ALL">
       <CFSET response = "4">
      </CFIF>
    </CFIF>
    <!--- Get vcd --->
    <CFSET vcd = "0">
    <CFIF IsDefined("ATTRIBUTES.verbconf")>
      <CFIF ATTRIBUTES.verbconf>
       <CFSET vcd = "1">
      </CFIF>
    </CFIF>
    <!--- Get first ship notify --->
    <CFSET firstshipnotify = "0">
    <CFIF IsDefined("ATTRIBUTES.shipnot1")>
      <CFIF ATTRIBUTES.shipnot1 IS "DOMESTIC">
       <CFSET firstshipnotify = "1">
      <CFELSEIF ATTRIBUTES.shipnot1 IS "INTERNATIONAL">
       <CFSET firstshipnotify = "2">
      </CFIF>
    </CFIF>
    <!--- Get second ship notify --->
    <CFSET secondshipnotify = "0">
    <CFIF IsDefined("ATTRIBUTES.shipnot2")>
      <CFIF ATTRIBUTES.shipnot2 IS "DOMESTIC">
       <CFSET secondshipnotify = "1">
      <CFELSEIF ATTRIBUTES.shipnot2 IS "INTERNATIONAL">
       <CFSET secondshipnotify = "2">
      </CFIF>
    </CFIF>
    </CFIF> <!--- End process params --->
    <!--- If have all params, process request --->
    <CFIF proceed>
    <CFHTTP
      URL="http://www.ups.com/using/services/rave/qcostcgi.cgi"
      METHOD="POST"
    >
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="accept_UPS_license_agreement" VALUE="yes">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="10_action" VALUE="3">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="13_product" VALUE="#product#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="15_origPostal" VALUE="#origPostal#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="19_destPostal" VALUE="#destPostal#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="22_destCountry" VALUE="#destCountry#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="23_weight" VALUE="#weight#">
      <CFIF IsDefined("ATTRIBUTES.value")><CFHTTPPARAM TYPE="FORMFIELD" NAME="24_value" VALUE="#ATTRIBUTES.value#"></CFIF>
      <CFIF IsDefined("ATTRIBUTES.length")><CFHTTPPARAM TYPE="FORMFIELD" NAME="25_length" VALUE="#ATTRIBUTES.length#"></CFIF>
      <CFIF IsDefined("ATTRIBUTES.width")><CFHTTPPARAM TYPE="FORMFIELD" NAME="26_width" VALUE="#ATTRIBUTES.width#"></CFIF>
      <CFIF IsDefined("ATTRIBUTES.height")><CFHTTPPARAM TYPE="FORMFIELD" NAME="27_height" VALUE="#ATTRIBUTES.height#"></CFIF>
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="29_oversized" VALUE="#oversized#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="30_cod" VALUE="#cod#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="33_hazard" VALUE="#hazard#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="34_handling" VALUE="#handling#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="35_calltag" VALUE="#calltag#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="37_saturdaydelivery" VALUE="#saturdaydelivery#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="38_saturdaypickup" VALUE="#saturdaypickup#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="39_response" VALUE="#response#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="43_vcd" VALUE="#vcd#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="44_firstshipnotify" VALUE="#firstshipnotify#">
      <CFHTTPPARAM TYPE="FORMFIELD" NAME="45_secondshipnotify" VALUE="#firstshipnotify#">
    </CFHTTP>
    <!--- Check if succeeded --->
    <CFIF ListFirst(CFHTTP.FileContent, "%") IS "UPSOnLine3">
      <!--- Success, set variables --->
      <CFSET CALLER.UPS_Success = "Yes">
      <CFSET CALLER.UPS_Service = ListGetAt(CFHTTP.FileContent, 2, "%")>
      <CFSET CALLER.UPS_FromPostal = ListGetAt(CFHTTP.FileContent, 3, "%")>
      <CFSET CALLER.UPS_FromCountry = ListGetAt(CFHTTP.FileContent, 4, "%")>
      <CFSET CALLER.UPS_ToPostal = ListGetAt(CFHTTP.FileContent, 5, "%")>
      <CFSET CALLER.UPS_ToCountry = ListGetAt(CFHTTP.FileContent, 6, "%")>
      <CFSET CALLER.UPS_ToZone = ListGetAt(CFHTTP.FileContent, 7, "%")>
      <CFSET CALLER.UPS_Weight = ListGetAt(CFHTTP.FileContent, 8, "%")>
      <CFSET CALLER.UPS_BaseCharge = ListGetAt(CFHTTP.FileContent, 9, "%")>
      <CFSET CALLER.UPS_OptionalCharge = ListGetAt(CFHTTP.FileContent, 10, "%")>
      <CFSET CALLER.UPS_Charge = ListGetAt(CFHTTP.FileContent, 11, "%")>
      <CFSET CALLER.UPS_GuaranteedBy = ListGetAt(CFHTTP.FileContent, 12, "%")>
      <CFSET CALLER.UPS_Error = "">
      <CFSET CALLER.UPS_ErrorCode = "">
    <CFELSE>
      <!--- Failed, set variables and error message --->
      <CFSET CALLER.UPS_Success = "No">
      <CFSET CALLER.UPS_Service = "">
      <CFSET CALLER.UPS_FromPostal = "">
      <CFSET CALLER.UPS_FromCountry = "">
      <CFSET CALLER.UPS_ToPostal = "">
      <CFSET CALLER.UPS_ToCountry = "">
      <CFSET CALLER.UPS_ToZone = "">
      <CFSET CALLER.UPS_Weight = "">
      <CFSET CALLER.UPS_BaseCharge = "">
      <CFSET CALLER.UPS_OptionalCharge = "">
      <CFSET CALLER.UPS_Charge = "">
      <CFSET CALLER.UPS_GuaranteedBy = "">
      <CFSET CALLER.UPS_Error = ListGetAt(CFHTTP.FileContent, 2, "%")>
      <CFSET CALLER.UPS_ErrorCode = ListGetAt(CFHTTP.FileContent, 3, "%")>
    </CFIF>
    <CFELSE>
    <!--- Failed, display error message, and abort --->
    <CFOUTPUT><H1>Error: #error_message#</H1></CFOUTPUT>
    <CFABORT>
    </CFIF>

  • Custom Tag issue and then ApplicationID?

    Hello,
    is there anybody out there who can help me with the following
    problem:
    I installed ColdFusion 4.5 Server on my Windows XP machine
    and wanted to access an already built CF application. When
    accessing
    the main default page, i got the following error:
    "Cannot find CFML template for custom tag
    CFA_APPLICATIONINITIALIZE.
    ColdFusion attempted looking in the tree of installed custom
    tags but
    did not find a custom tag with this name. "
    I copied the same Administrator settings, code and folders
    from the
    working production server to my local machine and it just
    doesn't seem
    to work. (I couldn't find any differences to the working
    application)
    I tried to fix it by copying the custom tag folder (located
    under allaire/spectra/customtags/) to C:\CFusion\CustomTags which
    somehow cleared the previous error but gave me the following new
    one:
    "Error Occurred While Processing Request > Error
    Diagnostic Information > This application can't be located by
    name. Use ApplicationID instead"
    Please, i appreciate any kind of comment on this post (i have
    been trying to fix this for the past 3 days!)
    Thanks,
    bbinto

    Spectra requires 4.5.1 or 5.
    Run the Spectra install to set up all the correct mappings
    and the webtop. Then copy over the custom application. It's been
    awhile since I've dug into the folder structure of the webtop, so I
    don't have a complete list of steps required for a Spectra app
    deployment. So you still have some work ahead of you.
    Just make sure you backup your database before the install,
    mirror it, or use a new schema for the installation and then switch
    over your datasources.
    I would recommend an old Spectra book you can probably find
    on eBay.
    http://www.forta.com/books/0789723654/

  • 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

  • Evaluate customtag inside tag handler.

    How to make a custom tag to be evaluated in another custom tag handler?
    Sample Code:
    public class MyTag extends ELTextTag {
    public int doStartTag() throws JspException {
         StringBuffer js = new StringBuffer(800);
         // This is evaluated
         js.append(�<tr></td>this plain html is evaluated</td></tr>�);
         // This custom tag doest not evaluate, just prints as it is
         js.append(�<myTag:divTag class=\�tagClass\� />�);
    TagUtils.getInstance().write(this.pageContext, js.toString());
    How to force this custom tags to be evaluated ?
    Rgds
    Ramya

    I guess you are referring to post #3 in the other thread where somebody had suggested that the way to do it would be to replicate the container implementation of the nested tag inside the main one.
    I think that's exactly what the cold tags link that I posted does. Its a hack and if it works, then I dont see why you shouldnt use it.
    However a word of caution. Tags, like servlets are container managed objects and every container does several optimizations on tag instances. For example some containers pool tag objects per page. By hijacking the lifecycle methods of the tag, you may be opening yourself to some potentially serious discrepancies when the tag is used by itself (ie the container invokes it) and you use it from within another tag.
    If you arent impressed, think about this - is it proper to call a Servlet from another Servlet just by invoking the init(), service() and destroy() method of the second servlet from within the first? It would work, but God only knows what problems you would face in future to such hacks :)
    Anyways all the best.
    cheers,
    ram :)

Maybe you are looking for

  • How do I set up a mail account for an older macbook?

    I'm trying to set up a mail account for my dad on a used (but refurbished) macbook. It's running 0SX10.6.8. I'm not sure how to configure the incoming and outgoing mail servers. I didn't have to do this for my macbook air and my brother did not have

  • Esr obj in 7.1

    Hi Friends, I am new to PI 7.1. I have imported swcv into ESR and after creating namespace,I see models,namespace and imported objects under my swcv. I am confused how to create the design objects,as in lower versions of xi once we create namespace a

  • How i can Delete iPhone configuration utility ?

    i have this problem in my macbook os x 10.9.3 1- itunes can not backup my iphone it gave error: the backup could not be save on this computer . 2- the iphone usb on the network always red :iphone usb is not plugged in or the device is not responding

  • Using process variables in XPath

    I am trying to use a variable (/process_data/@Division) to identify an xml node to determine the person for a task: /process_data/DivisionRolesXML/divisions/division[Division='string(/process_data/@Division )' and Position='Div Executive']/LDAPId I g

  • Unable to connect to "My World" in Blackberry App World.

    I keep getting untrusted server certificate errors and messages that the app world server is unavailable.  this has been happening for about a week now.  Any suggestions?