Retrieving HTML Header in ColdFusion

Hi all,
I am a little lost as to what tag I would be using to
accomplish this. This is the situation. I am doing SAML single
sign-on. A page would post the information of the user in the HTML
header to my page in Coldfusion. Now, my question, how do I get
those information in the HTML header? Do I use CFHTTP or some other
tags?
Thanks in advance,
Monte

Not sure what you mean by the "HTTP header". Lots of
information from
the HTTP header is available to the ColdFusion action page.
<cfhttp...> is probably not what you want. That tag is
used to make a
http request to another resource and return it to the current
CF request.
Using the expression "A page would post...", would indicate
to me that
the data is most likely in the Form scope on the action page
to which
the data was posted. But it is also possible that the data is
in the
URL scope if the word "post" was not a literal post operation
but a get
operation. Thirdly it is possible something might be
happening in the
CGI scope.
So try this on the ColdFusion action page and see if it does
not
enlighten you.
<cfdump var="#form#" label="Post Data">
<cfdump var="#url#" label="Get Data">
<cfdump var="#CGI#" label="CGI Data">
This does assume a fairly recent CF so that the dump tag is
available
(post CF 5, IIRC)
TangoRules wrote:
> Hi all,
>
> I am a little lost as to what tag I would be using to
accomplish this. This
> is the situation. I am doing SAML single sign-on. A page
would post the
> information of the user in the HTML header to my page in
Coldfusion. Now, my
> question, how do I get those information in the HTML
header? Do I use CFHTTP
> or some other tags?
>
> Thanks in advance,
> Monte
>

Similar Messages

  • Retrieve html page before parsing it

    Hi:
    I'm trying to parse some query result returned from a web site. The following code returned me nothing, not even the html header and the pre-filled tags. When I replace "while(s2!=null){" with "a finite number of loops, say, 100, it worked. But when I increased the number of loops to 300 (actual page returns 327 lines of html code), it gave me nothing again. Could anybody please let me know what's wrong with my code or what should I do to retrieve an html page before I parse it? Thanks.
              String s1 = new String();
              String s2 = new String();
              try{
                   URL u = new URL(url);
                   InputStream ins = u.openStream();
                   InputStreamReader isr = new InputStreamReader(ins);
                   BufferedReader br = new BufferedReader(isr);
                   while(s2!=null){
                        s2 = br.readLine();
                        s1 = s1.concat(s2);
                   //test part
                   response.setContentType("text/html");
              PrintWriter out = response.getWriter();
         out.print(ServletUtilities.headWithTitle("Hello WWW") +
         "<BODY>\n" + s1 +     
                        "MANUALLY-ADDED" +
         "</BODY></HTML>");

    Here is a simple [url http://forum.java.sun.com/thread.jsp?forum=31&thread=285107]example. Don't use String.concat(..) method. Use a StringBuffer and convert it to a String once the entire file has been read.

  • HTML DB  Select Statement in HTML HEADER

    Can I put a select statement that return a value in the HTML HEADER?
    If I can How? Would point the way.
    Second Question
    Can I call store function from HTML HEADER? Help!

    I have a report screen that has Delete button. Each record on the screen has a checkbox
    What I would like to do is:
    when the user puts a check in the checkbox and click the Delete button. a message will pop up and ask "Are you usre?" If the user click Yes then the system will check for child record. If there no No child record go head delete the record. If there is a child record then another message pop up and ask "This Schedule is currently active. Do you really want to delete this." If the user answers Yes then it will delete both parent and child records. If the user answer no then no record will be deleted.
    I have been struggle with this in HTML DB for a bit, but I did not find the solution yet. Please Help!!!!

  • Pass a value from a PL/SQL function to a javascript (html header) ? ?

    Hey Guys,
    Have a question regarding how to pass a value from a PL/SQL function to a javascript in the HTML Header.
    I have created a PL/SQL function in my database, which does looping.
    The reason for this is:  On my apex page when the user selects a code, it should display(or highlight buttons) the different project id's present for that particular code.
    example= code 1
    has project id's = 5, 6, 7
    code 2
    has project id's = 7,8
    Thank you for your Help or Suggestions
    Jesh
    The PL/SQL function :
    CREATE OR REPLACE FUNCTION contact_details(ACT_CODE1 IN NUMBER) RETURN VARCHAR2 IS
    Project_codes varchar2(10);
    CURSOR contact_cur IS
    SELECT ACT_CODE,PROJECT_ID
    FROM ACTASQ.ASQ_CONTACT where ACT_CODE = ACT_CODE1;
    currec contact_cur%rowtype;
    NAME: contact_details
    PURPOSE:
    REVISIONS:
    Ver Date Author Description
    1.0 6/25/2009 1. Created this function.
    BEGIN
    FOR currec in contact_cur LOOP
         dbms_output.put_line(currec.PROJECT_ID || '|');
         Project_codes := currec.PROJECT_ID|| '|' ||Project_codes;
    END LOOP;
    RETURN Project_codes;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHEN OTHERS THEN
    -- Consider logging the error and then re-raise
    RAISE;
    END contact_details;
    /

    Jesh:
    I have made the following modifications to your app to get it to work as I thing you need it to.
    1) Changed the source for the HTML Buttons Region(note use of id vs name for the Buttons)
    <script>
    function hilitebtn(val) {
    //gray buttons
    $x('graduate').style.backgroundColor='gray'
    $x('distance').style.backgroundColor='gray'
    $x('career').style.backgroundColor='gray'
    $x('photo').style.backgroundColor='gray'
    //AJAX call to get project-ids
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=GETPROJECTS',0);
    get.addParam('x01',val)
    gReturn = get.get();
    var arr=gReturn.split(':');  //dump into array
    get = null;
    for (i=0;i<arr.length;i++) {
    // alert('val=' + arr);
    if ( arr[i]==5)
    $x('graduate').style.backgroundColor='red';
    if ( arr[i]==6)
    $x('distance').style.backgroundColor='red';
    if ( arr[i]==7)
    $x('career').style.backgroundColor='red';
    if ( arr[i]==8)
    $x('photo').style.backgroundColor='red';
    </script>
    <table cellpadding='0' cellspacing='0' border='0'>
    <tr><td>
    <input type='button' id='graduate' value='Graduate'>
    </td>
    <td>
    <input type='button' id='distance' value='Distance'>
    </td>
    <td>
    <input type='button' id='career' value='Career/Tech'>
    </td>
    <td>
    <input type='button' id='photo' value='Photos'>
    </td>
    </tr></table>
    2) Defined the application process  GETPROJECTS as DECLARE
    IDS varchar2(1000);
    l_act_code varchar2(100) :=4;
    begin
    IDS:='';
    l_act_code := wwv_flow.g_x01;
    for x in(
    SELECT ACT_CODE,PROJECT_ID
    FROM ASQ_CONTACT
    where ACT_CODE = l_act_code)
    LOOP
    IDS := IDS || X.PROJECT_ID|| ':' ;
    END LOOP;
    HTP.PRN(IDS);
    END;
    3) Changed the 'onchange' event-handler on p1_act_code to be 'onchange=hilitebtn(this.value)'
    4) Added the JS to the HTML Page Footer <script>
    hilitebtn($v('P1_ACT_CODE'));
    </SCRIPT>

  • Page failure when attempting to save java script in html header

    Currently there is java script code for a function that is seeded in the html header of a forms page by apex when the form is generated. This code is for the chicken test for the DELETE button.
    The function works as designed, but if I try to "APPLY CHANGES" to the the page definition I get the The page cannot be displayed "Cannot find server or DNS Error". "the url is http://nldg-3.appl.devjones.com:7777/pls/apex/wwv_flow.accept" If I remove the script coding from the HTML header the page will save just fine, but of course no more java script.
    I need to add a java script function to the page and I am unable to do so at this time because of this issue. I can reproduce this error on any of the sample apps that I have loaded into apex.
    the Apache error log contains:
    [Fri Feb 13 06:11:06 2009] [error] [client 172.16.85.122] [ecid: 1234527066:192.168.211.127:31922:0:17188,0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-500 Error Reading Data from Client!!
    The Apache access gets:
    172.16.85.122 - APEX_PUBLIC_USER [13/Feb/2009:06:23:47 -0600] "POST /pls/apex/wwv_flow.accept HTTP/1.1" 500 653
    Apex is version 3.1.2.00.02 and uses on iAS on a Linux server. The Database is 10g. The browser is IE 6.0.2900.2180.
    I have been developing for about 3 months in Apex and this is the first issue of this kind that I have run into. Any help will be greatly appreciated as I have no clue at this time.

    Luis,
    All the forms are created by Apex with a default function in the html header for a delete chicken test as follows:
    <scrpt language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    Even though the function is already a part of the page, if I try to save it, it will fail. I will look into the "black list" a little deeper. I have asked around abit as I also had suspected that, but so far all the answers were that it should not be a problem. If I take out the "SCRIPT" word I can get the page to save, but of course the code is worthless at that point.
    Keith

  • Is there a limit to amount of code that can be added to the HTML Header?

    I've got several javascript functions in the HTML Header section of the page attributes. I recently added another function and now receive an HTTP 404 Not Found error at runtime when navigating to the page. When I remove the function the error is gone. I don't think there is anything wrong with the function because even when I copy and rename an existing working function, this error occurs...as if I've exceeded some size limit. Any ideas?

    I now have a better understanding after reading this thread: Javascript as static file or on filesystem?
    As the post indicates, there are essentially two ways of including a .js file:
    1) upload as static file to the workspace or application and refer to it using the #APP_IMAGES# or #WORKSPACE_IMAGES# tag.
    2) put it on the webserver as a file on the filesystem under the images directory and refer to it using the #IMAGE_PREFIX# tag.
    For now (since I don't have permissions to the file server directory) I have created a .js file and uploaded it as a static file in Shared Components. I referenced the file as below, but when I go the page at runtime, none of my functions are being utilized. Is it because the web server is not using this static file yet because of caching? Does it need to be restarted in order to start using the uploaded js file?
    <script type="text/javascript" src="#WORKSPACE_IMAGES#apex_selection_criteria_page.js">
    </script>

  • How can I submit the page from javascript in html header?

    I followed
    http://www.oracle.com/technology/products/database/htmldb/howtos/htmldb_javascript_howto2.html#client
    It says "doSubmit('Delete');" to submit the delete action.
    If I do the same in the java script that is embededed in html header, it does not work.
    I am assuming 'Delete' is the name of the button here.
    I also tried:
    document.forms[5].submit(); --> does not work
    document.formname.submit(); --> does not work
    I want to know:
         how I get the form name. I am assuming that this is the name in Name field in "Page definition" or is this page number?
         how to sumit a form from the javascript in html header

    sudheshna,
    function deleteConfirm(msg)
    should be
    function Confirmdelete(msg)
    cheers
    KIM

  • Outbound Plain HTML Adapter how to change the html-header field "host"?

    Hello,
    I'm using XI 3.0 SP11 and want to transmit a message to a business partner using the Plain HTML Adapter.
    My problem is now that I need to change the default Html-Header field "host" because it seems that the adapter engine is converting it to lower case and is attaching the port-number which is causing trouble with the loadbalancer/applicationserver of our business partner.
    I tried to set the appropriate http-header value in the communication channel configuration, but the adapter engine is ignoring this value.
    Thanks in advance for any ideas.
    Sascha Fuchs
    Message was edited by: Sascha Fuchs

    Hi Sascha,
    unfortunately the Plain HTTP adapter is not running in the J2EE, therefore you cannot extend the functionality with an adapter module.
    I am not sure to understand the problem right. Why do you need to change the HTTP header? What is in it in your case and what should be?
    Regards
    Stefan

  • Limit to HTML Header text in APEX Page

    I have an APEX page that has a fairly large amount of javascript in the HTML header. After I added some more, the page blows up. Is there a limit to how much you can add. It doesn't look like Page 0 has the limitation. Is there one one on either?
    What is the best way around this? Adding the individual page javascript to Page 0 or creating a .js that gets included on that page only.
    Thanks!

    Large page sizes will DESTROY your perceived performance. High performance apps go way out of their way to improve page load times by:
    - Minifying or compressing javasript
    - Making sure it is cache-able
    - Loading the minimum amount of javascript you need for the page to function, then "lazy loading" (background loading) the rest
    - Lazy loading all of the JavaScript files you need for the app on the login page or first page to cache them
    - Using gzip compression in the app server
    - Using a Content Delivery Network (CDN)
    - Reducing HTML size using CSS and other techniques
    - Reducing the number of network requests for images using CSS sprites. (more info here: http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/ )
    Storing JavaScript in the head of the page flies in the face of almost everyone of those concepts. Have a look at this if you have time:
    http://developer.yahoo.com/performance/
    Tyler Muth
    http://tylermuth.wordpress.com
    "Applied Oracle Security: Developing Secure Database and Middleware Environments": http://sn.im/aos.book

  • Can we have javascript function in the HTML header of Page 0

    Hello,
    I want to have a javascript function implemented on page zero, Can anyone help me out with this issue.
    Thanks,
    Orton

    There is no HTML Header on Page Zero. The equivalent would be to use the page template.
    It's also possible to place JavaScript in HTML regions on Page Zero, but I wouldn't consider this a good practice. JavaScript is better kept in external files and referenced using the SRC attribute.

  • HTML Header - Size Limit

    Forum
    Is there a limit to the size of the text that can be entered on a page's HTML Header Section ?
    We are seeing an application page fail when we add more lines to the section .... ( yes - they are valid syntax :-)). When we remove these lines - the page works again.
    Also if we add two lines , and then remove the 2 comment lines higher in the section , the page seems to work.
    Strange ...
    P.

    &lt;body onLoad="javascript:f_comm()";&gt;1. In the XHTML normally used in APEX 4.0 mark-up, all XHTML, including attribute/event handler names, must be in lower case: <tt>onclick</tt>, <tt>onfocus</tt>, <tt>onload</tt>...
    2. The "javascript:" pseudo-protocol is evil. There are a few places in APEX where we may have to resort to using it as a URL is all we're offered to work with, but it's always better to use an event handler of some kind, either inline or (better) registered dynamically at runtime following the principles of unobtrusive JavaScript. It absolutely should not be used in inline event handlers.
    3. Semicolons (";") are part of the JavaScript language, not XHTML, and so go within the quotes as part of the JS code.
    So:
    &lt;body onload="f_comm();"&gt;

  • Should there be a difference between javascript in HTML Header vs js file?

    Application Express 3.2.1.00.10
    I'm finding that IE shows javascript errors when I refer to functions contained in a js file (uploaded as static file) referenced in the HTML Header versus copying the exact same code and keeping it in HTML Header. I can't seem to pinpoint it. Could it be that the APEX javascript API's (e.g. htmldb_Get, $x, $v, etc) that I reference in my functions will not work in external js file?
    The HTML Header is:
    <script type="text/javascript" src="#WORKSPACE_IMAGES#my_file.js></script>
    {code}
    but if i copy the code out of the file and change the HTML Header to this i get some kind of errors:
    {code}
    <script type="text/javascript">
    <!--
    .....all my functions here
    // -->
    </script>
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hello,
    >> Could it be that the APEX javascript API's (e.g. htmldb_Get, $x, $v, etc) that I reference in my functions will not work in external js file?
    No it couldn’t. First, the APEX JavaScript APIs are also stored in external files. Secondly, the origin of the JavaScript code shouldn’t matter, it’s the actual code that count.
    You didn’t specify any error message you received so it’s to pinpoint you problem, but in general, the main difference between external JavaScript code and a inline code is that external code can’t use substitution strings in the format of ‘&ITEM.’ (because the APEX engine doesn’t get the chance to perform the substitution). Other than that, the code should be identical.
    You mentioned a specific APEX built-in JavaScript functions. You should also check that these libraries are loaded correctly into you page.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Forthcoming book about APEX: Oracle Application Express 3.2 – The Essentials and More

  • DW Uploads HTML Header only ??

    I have been using Dreamweaver MX2004 for a few years to
    maintain a school web site. It has always performed well but
    recently I find that when I upload an HTML and check it on the web
    site, I find that the file only contains the HTML header
    information!
    In order to test this I have produced a new, very basic HTML
    file in DW with only a single item of text in it, but this still
    appears on the web site as just the html header information.
    However, I can upload files using a basic FTP program
    (coffeecup) with no problems.
    Please help
    Dave

    Sure looks like they are set up the same.
    In DW, create a file with a nonsense name, and upload it.
    Then look at the
    files found in the /web/ folder. Do you see this nonsense
    named file there?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "DaveWhiltshire" <[email protected]> wrote
    in message
    news:[email protected]...
    > Thanks for your help.
    > Here is the site setup from DW and the Coffecup setup is
    shown below:
    >
    >
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <site>
    > <localinfo sitename="ewelme" ftporrdsserver="FALSE"
    refreshlocal="TRUE"
    > cache="TRUE" httpaddress="
    http://" curserver="webserver"/>
    > <remoteinfo accesstype="ftp"
    host="www.ewelme.oxon.sch.uk"
    > remoteroot="/web/"
    > usefirewall="FALSE" usepasv="FALSE" useSFTP="FALSE"
    > pathNameCharacterSet="Windows-1252"/>
    > <designnotes usedesignnotes="TRUE"
    sharedesignnotes="TRUE"/>
    > <sitemap pagesperrow="200" columnwidth="125"
    showdependentfiles="FALSE"
    > showpagetitles="FALSE" showhiddenfiles="FALSE"/>
    > <fileviewcolumns sharecolumns="TRUE">
    > <column name="Local%20Files" align="left" show="TRUE"
    share="FALSE"
    > builtin="TRUE" localwidth="130" remotewidth="91" />
    > <column name="Notes" align="center" show="FALSE"
    share="FALSE"
    > builtin="TRUE" localwidth="36" remotewidth="36" />
    > <column name="Size" align="right" show="TRUE"
    share="FALSE"
    > builtin="TRUE"
    > localwidth="0" remotewidth="0" />
    > <column name="Type" align="left" show="TRUE"
    share="FALSE"
    > builtin="TRUE"
    > localwidth="161" remotewidth="0" />
    > <column name="Modified" align="left" show="TRUE"
    share="FALSE"
    > builtin="TRUE" localwidth="124" remotewidth="0" />
    > <column name="Checked%20Out%20By" align="left"
    show="TRUE"
    > share="FALSE"
    > builtin="TRUE" localwidth="40" remotewidth="98" />
    > </fileviewcolumns>
    > <appserverinfo servermodel="" urlprefix="
    http://localhost/"
    > connectionsmigrated="FALSE" serverobjectsversion="1"
    defaultdoctype="HTML"
    > accesstype="none" testsvrbinaccesstype="none"/>
    > <cloaking enabled="TRUE" patterns="FALSE">
    > <cloakedpattern pattern=".png"/>
    > <cloakedpattern pattern=".fla"/>
    > </cloaking>
    > <contributorintegration enabled="FALSE"/>
    > </site>
    >
    >
    > Coffecup FTP Site setup:
    >
    > Host Name : www.ewelme.oxon.sch.uk
    > Passive Mode : yes
    > Annonymous : No
    > Port : 20
    > Timeout : 120 sec
    >
    > Initial host:/web
    > Proxy Settings:
    > Proxy Hostname : not set
    > Proxy Login : not set
    > Port : not set
    > Type : not set
    >

  • Where Should the JavaScript Go if I'm Calling from the Page HTML Header?

    In the Application Express User's Guide under "Calling the JavaScript File from the HTML Header Attribute" point 4 says:In HTML Header, call the JavaScript file using the following syntax:
    <script src="/my_images/custom.js" type="text/javascript"></script>However, it doesn't say where my_images is located.
    Where should the .js file be stored?
    Thanks,
    Gregory

    naviagte to shared component in the application edit screen and upload your .js file to static files.
    now you can ref. this file as
    In HTML Header, call the JavaScript file using the following syntax:
    <script src="#WORKSPACE_IMAGES#custom.js" type="text/javascript"></script>
    {?code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • HTML header Page zero

    Hello all,
    We are trying to add a reference to a jquery image on page zero of our app. We are supposed to add this to the html header. We do not have an html header on page zero and we cannot figure out how to create or access it. Any help would be greatly appreciated.
    Thanks

    It is not possible to add an HTML Header to page zero. Including the required element(s) in the HTML &lt;head&gt; in the page template(s) would be equivalent.

Maybe you are looking for

  • OC4J Restarts (Is there any way to control this?)

    Hello, I have an OC4J instance on Oracle Application Server Java Edition 9.0.4.0.0 We been having a problem where EM will restart our OC4J instance. Currently, the development team is not sure why the instance is being restarted. It is one of 5 OC4J

  • WL 81 Uninstall Problem

    Hi, I tried uninstalling my WL Workshop 8.1 from my Win 2000 machine. The uninstaller program exits after giving a message which says "There in no disk space for the uninstaller to run". The installation drive has more than 4.5 GB hard disk space. Ca

  • EM 10g : java.lang.Exception: Exception in sending Request :: null

    I have installed 2 db on 10.2.0.1.0. The first one is running fine and easily manageable via Enterprise Manager. When I open EM on the second db I receive "java.lang.Exception: Exception in sending Request :: null" with no further explanation. When I

  • Error 9006 - Update to iOS for iPad

    I have been trying to update my iOS software to 4.2 for my iPad and keep getting the error 9006 and have to start the procedure all over again. Sometimes it gets to 200mb complete, sometimes just 20mb. I have searched previous forums and cannot find

  • Multilevel  menu -buletted menu item list

    Hi, I have created a multilevel menu in my portal. The dropdown menu items appears correctly but in addition to the drop down menu I also get a bulleted list of menu items under the root menu. Can anyone tell me how to disable this bulleted list. The