Passing Data between CF and Java pages

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Passing Data between CF and Java pages

    I've got a ColdFusion page on one server and a Java page on another server. I
    need to make a request from the CF page for data such as "Company Name" or
    "Company Phone Number". The Java page (on a different server) will do some
    processing and return the data to the ColdFusion page...

    How does this communication take place on the CF side? I tried a ColdFusion
    Component but that method seems to be for processing internally. I need to pass
    the variables names of what I want and then receive back the variable name and
    the value.

    Any ideas or articles?

    Thanks.

    Mike Paim Guest

  2. Similar Questions and Discussions

    1. Help! - Passing form data between multiple pages
      Hi, I am working on a multiple pages survey, right now if my user fill out page 1, click next, then fill out page2, page3, his answer will be...
    2. passing data between pages... one has a drop down form
      I need to pass a zip code from a drop down form on one .cfm (passing.cfm) to another. How does the receiving page (receiving.cfm) understand which...
    3. Passing parameters from t Java application to Flash
      Hi all, Does anybody know if it's possible to pass data from a Java application (JSP pages / Servlets) to a Flash application ? Thanks a lot...
    4. Passing information between pages
      I am currently building a site, and we have a number of users that can have a particular priveledge, but each user has their own set of cases that...
    5. [PHP] Passing $Vars between 2 php pages
      Thank you Robert! But, I forgot to mention... "and without URI"
  3. #2

    Default Re: Passing Data between CF and Java pages

    On 2005-05-03 07:28:58 -0500, "Mike Paim" <webforumsuser@macromedia.com> said:
    > I've got a ColdFusion page on one server and a Java page on another
    > server. I need to make a request from the CF page for data such as
    > "Company Name" or "Company Phone Number". The Java page (on a
    > different server) will do some processing and return the data to the
    > ColdFusion page...
    >
    > How does this communication take place on the CF side? I tried a
    > ColdFusion Component but that method seems to be for processing
    > internally. I need to pass the variables names of what I want and then
    > receive back the variable name and the value.
    >
    > Any ideas or articles?
    >
    > Thanks.
    If I understand what you're getting at, the simplest way to do this
    would probably be to use HTTP POST or GET. Just have the form (I'm
    assuming there's a form involved since you say "make a request for
    data") submit from the CF server to the Java server. The Java server
    won't care where the submission is coming from (dependent upon your
    security settings on the Java server of course). Then the Java server
    can do its thing and pass a response back to CF again via either POST
    or GET, with GET probably being the simpler means since you could just
    do a redirect on the Java server back to the CF server using a simple
    URL.

    You could also use web services of course, but based on what you're
    saying the web service would be on the Java server.

    Matt
    --
    Matt Woodward
    [email]mpwoodward@gmail.com[/email]
    Team Macromedia - ColdFusion

    mpwoodward *TMM* Guest

  4. #3

    Default Re: Passing Data between CF and Java pages

    Matt,

    I guess I could make it into a form. However, I hadn't planned on it. There
    isn't neccessarily going to be someone one the page clicking submit, although
    it can autosubmit.

    The idea is that I've got a website that has basic customer and product
    information. However, to get detailed pricing information or detailed customer
    information, I need to make a request from the Java server, managed by another
    company. There would be sensitive information being passed back and forth.

    If I wanted to use a web service, I understand that the database hit would be
    on the Java server. However, what would I need to do on my side to send the
    variables to them?

    Example:
    Send to URL
    AcountNumber=8456123

    Receive to My Site:
    CompanyName="My Company"
    CompanyPhone="888-555-6263"

    ?
    Thanks,
    Michael

    Mike Paim Guest

  5. #4

    Default Re: Passing Data between CF and Java pages

    Mike,

    How to accomplish this all depends on how much control you have on the java
    side. You said it's controlled by another company. Is there already an
    interface? if so, what is it? is it form-based? is it a webservice? Do you have
    to authenticate with the other server first? how is that handled?

    If they already have a well-defined method for integration, then you just
    follow that. If they don't have a well-defined method and you have some leeway
    with how you take it, you need to take into account authentication if
    necessary, the complexity of the data being returned, etc. and that will point
    you to either using cfhttp calls to get the data, or trying to integrate with a
    webservice.

    Kronin555 Guest

  6. #5

    Default Re: Passing Data between CF and Java pages

    Hi,
    I have problems that passing a JavaScript variable back to CF in a JavaScript
    item change event. For example, a user selects a state in one dropdown list,
    all the cities in the state should appear in another dropdown list.

    Try One method:
    <cfset STvar = ''CA'> -- Works if is set to constant value
    <cfset STvar = ''{stselect.text}'> -- Not Work if try to read a field
    <cfquery name="city" datasource="xxx".
    SELECT REGION FROM WEB."CITY" WHERE (STCODE = '#STvar#' )
    </cfquery>

    Try method 2:
    <cfset STsel = 'AL' > Works if is set to constant
    <cfset STsel = "{stselect.selectedItem.data}" > No Work - - after the
    <cfquery>, it returns me the correct SQL syntax, but not the result of the
    query.
    <cfset strSQL= "SELECT City FROM WEB.""STATE"" WHERE (STCODE = '" &
    variables.STsel & "' )">
    <cfquery name="city" datasource="xxx">
    #Evaluate('strSQL')#
    </cfquery>

    In the last method, how can I get the query result of the #Evaluate('strSQL')#
    if it returns the correct SQL statement. How can I read a selection text
    field into a CfSet varialbe before I click the POST Submit button.

    Thanks,
    James

    James168 Guest

  7. #6

    Default Re: Passing Data between CF and Java pages

    James, don't hijack this thread. Your question doesn't have anything to do with
    the original question. What you're looking for is dependent select boxes, and
    has been discussed at length before. There are CFX tags that already do exactly
    what you're looking for. Here's one example I pulled off of google. I know
    there's a much nicer one, but I can't find it right now:
    [url]http://www.cfdeveloper.co.uk/forum/forum_posts.asp?TID=129&PN=1&get=last[/url]

    Kronin555 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139