Integrating PHP with Java

Hi
Is it possible to retrieve the session attributes in PHP, that are set in JSP?
My requirement is as i login ,i shud be redirected to a PHP page and in that page i need to access the session attributes which i set on authentication.
Any help is greatly appreciated.

I think you'd have to have a back door to do that. Basically the only thing that your PHP and Java will have in common is the session id that will come back in a cookie or a URL rewrite. Something on the Java side would have to present a page or an API or something to allow the PHP to get all of the variables.
But this sounds like a horrible hack. I'd encourage something easier like have the Java side put the stuff you need into a database or a flat file or something that is more naturally shared. I could see a database table that has the session id as the primary key and has all of the other things you need in it.

Similar Messages

  • Integrating Excel with Java

    Hi,
    How can Excel be integrated with Java such that if a user is working on an Excel , my Java application should be able to capture all the events from Excel Sheet.
    I have looked into POI, but it seems to me , it can read and wriite to Excel from Java, but i would like that if a user is making changes to a spredsheet then my Java Application should be notified about those changes
    In short, i would like to expose front end of a web application in Execl!
    Is there any open source package that can help in doing the integration
    Kindly share your views/ suggestions

    jschell wrote:
    If you just want most of what is occuring in Excel only then there are probably events in the Excel API (OLE >probably) that allow you to modify and react to changes. In my experience figuring out how to do that is very >difficult even for small bits of functionality.Can u please explain a little more on this.
    Can i use JNI to listen to COM server, probaly if i create some proxies for Excel that use JNI to listen to COM Server.
    I found a link on the internet http://www.ibm.com/developerworks/java/library/j-bridge/
    This Java bridge can integrate COM objects into their applications. But i am not sure if i can capture the live stuff from an Excel file when somebody is editing it.
    Also i would like to know, what should be the best stratergy when i would like to expose the Front end of an application in Excel , since the application involves a lot of numbers and users are more comfortable with Excel interface, and the rest of the application you want in Java.
    Kindly share your views on this!

  • PHP with JAVA

    I was working on one of the most common examples of getting system date, system property etc by calling Date and System classes of java from a PHP script. I have set up apache as the webserver on RedHat linux 7.2. Compiled PHP for java and i believe its properly compiled since it doesn't give error like "Fatal error: Cannot instantiate non-existent class:"
    When i try to access the script using the browser, the script itself is displayed instead of the output of the script.

    Is the problem with java or php?
    Check your apache.conf (or httpd.conf) settings.
    Find the lines and remove # if any.
    LoadModule php4_module libexec/libphp4.so
    AddModule mod_php4.c
    AddType application/x-httpd-php .php
    For further help try php lists.

  • Integrating flash with java

    i have a form made with flash, and form handlers made with java. So how can i make it work. i have couple java packages that make the calculations from the values given in flash form.any good websites that have info about java and flash?

    hey, try getting both communicated with XML

  • SSO Integration problem with Java version in 10g

    Hi,
    I'm following the instructions to integrate my HTML DB with 9iAS 9.0.2 SSO. The instructions tell me to download the SSO PDK and extract the file SSOHash.class then load it into my FLOWS_xxxx schema. My database version is 10g, and the loadjava fails with the following message:
    Error while testing for existence of dbms_java.handleMd5
    ORA-03113: end-of-file on communication channel
    The reason is that the function handleMD5 is no longer in the dbms_java package in 10g, it is in this package in 9i. Has anyone got a workaround to this?
    Thanks,
    Steve

    Scott,
    Actually I'm wrong about the function not being there, it is. But someone else is having the same issue, please look here:
    loadjava hangs
    Steve

  • Integrating Flash With Java Game

    hi guys,
    i'm doing the final touch up for my RPG, i plan to put flash animation as intro before my game starts, is it possible to call .swf file directly from java itself, how am i gonna make it possible??Please advice~
    Thanks~

    here's that dhtml trick I was telling you about:
    <html>
    <head>
    <title>Example</title>
    <style type="text/css"><!--
         #tagArea {
              font: 10pt tahoma,verdana,serif;
    --></style>
    <script language="javascript"><!--
         /* edit the next two variables to your swf/applet tags
         * after trying this example out
         var swfTag = "[your swf tag here] pretend this is a <a href=\"javascript:flipTags();\">link</a> in your swf object";
         var appletTag = "[your applet tag here]";
         var swf = true;
         /* when this gets called, the switch of tags is made */
         function flipTags() {
              var tagArea = document.getElementById("tagArea");
              if (swf) tagArea.innerHTML = appletTag;
              else tagArea.innerHTML = swfTag;
              swf = !swf;
    //--></script>
    </head>
    <body>
    <div id="tagArea">
    <script language="javascript"><!--
         document.write(swfTag);
    //--></script>
    </div>
    </body>
    </html>if you're too lazy to slap all that into an html file, go ahead and jsut view it here :P

  • How to integrating php with flex

    hi
       iam new to flex i want to check the username and password from database using php
    and i have written that but iam getting this error
    [RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/flex/login.php"]. URL: http://localhost/flex/login.php"]
        at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:216]
        at mx.rpc::Responder/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\Respo nder.as:49]
        at mx.rpc::AsyncRequest/fault()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\rpc\As yncRequest.as:103]
        at DirectHTTPMessageResponder/errorHandler()[E:\dev\3.0.x\frameworks\projects\rpc\ src\mx\messaging\channels\DirectHTTPChannel.as:343]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/redirectEvent()
    can any one say wt that error iam attaching that code also

    Looking at the error, it seems like you are not able to access the php file on the server.
    Could you please try accessing the php from your browser directly and let us know if you are able to access it.
    Thanks,
    Sudhir

  • Image not showing in Abobe integrated with Java WebDynPro

    Hi All,
    Image is not showing in Abobe integrated with Java WebDynPro.
    I did the following:
    Added the image field in adobe form. in URL value set the value of context node binding. Binding set to none and size set to Use Original Size.
    Then in script editor i wrote
    this.value.image.href = xfa.resolveNode(this.value.image.href).value;
    at innitialize , javascript and client.
    I can see the image from the same url context value if image field is created directly in WebDynPro View.
    Can anyone suggest what is missing?
    Thanks and Regards,
    Nuzhat

    Try changing your line of code for this one
    this.value.image.href = xfa.record.Images.URL;
    Check that the url passed by scripting is correct with a messageBox for example.
    You can also try assigning a hardcoded url at scripting level to check if its works.
    Best regards, Aldo.

  • Getting Error while integrating Crystal reports with Java

    Hi All,
    I am getting below error while integrating crystal report with java
    [java] os.arch = x86
    [java] java.lang.NoSuchMethodError: com.crystaldecisions.Utilities.d.<init>
    (Ljava/awt/Image;I)V
    [java] at com.crystaldecisions.Utilities.af.try(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.a(Unknown Source)
    [java] at com.crystaldecisions.Utilities.af.<init>(Unknown Source)
    [java] at com.businessobjects.crystalreports.viewer.applet.g.a(Unknown
    Source)
    [java] at com.crystaldecisions.ReportViewer.ReportViewer.start(Unknown
    Source)
    [java] at ReportViewerFrame.<init>(ReportViewerFrame.java:51)
    [java] at JRCViewReport.launchApplication(JRCViewReport.java:29)
    [java] at JRCViewReport$1.run(JRCViewReport.java:50)
    [java] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:
    178)
    [java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:443)
    [java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
    spatchThread.java:190)
    [java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
    atchThread.java:144)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:138)
    [java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
    ava:130)
    [java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    Any help can be appreciated
    Kalyan

    Hi All,
    For got to mention i am using crystal reports XI release 2 with JDK1.4.
    Kalyan

  • Configuration Requirement for Integrated Planning in BI 7.0 with JAVA Addin

    Hi,
    We have BI 7.0 with Java Add-in installation newly migrated to Unicode.
    BW consultants (I am BASIS Consultant) want to use "Integrated Planning".  I already checked IMG link of it & JCO destinations mentioned there are not in J2EE engine.   Even I am not able to create b'cos current setup is not on SLD.
    I would really appreciate your help on below queries :
    1) Can I configure Integrated Planning without using SLD ?
    2) Do I need to install BI JAVA to running Integrated Planning ?
    3) Do I need to install EP & EP Core ?
    I already checked most of SDN thread but sorry couldn't able to get answer to above questions.   I have checked SAP Notes : 901022, 919850, 917950.
    Your early reply would be highly appreciated.
    Thanks & Regards,
    Narsing.

    Hi Balaji,
    Thanks for information.   One thing to update with JAVA/JAVA addin portal core components gets installed.   So I didn't installed EP.  
    Now Integrated Planner is working fine.
    Thanks for your help.
    Best Regards,
    Narsing.

  • Issue with Java - PHP interoperability

    Hi,
    There are some converts written in PHP that can take raw wikipedia data and output a good HTML. I wanted to make use of these in my Java code.
    So in my Java Web App, I wanted to run the PHP parser, get hold of the InputStream and push it to my ServletOutputStream.
    Code Snippet:
       String command="php testparser.php Anarchism.wikimarkup";
       proc = Runtime.getRuntime().exec(command);
       InputStream in = proc.getInputStream();
       InputStreamReader isr = new InputStreamReader(in);
       BufferedReader br = new BufferedReader(isr);
       String line = null;
       while ((line = br.readLine()) != null) {
         System.out.println(line);
       }But the problem here is that the PHP Process never stops and hence the Buffer never ends. THe program is waiting in infinite loop in readLine().
    Please let me know if anyone has tried this and whats a better way to handle interoperability between PHP and Java.
    Thanks,
    Phani

    Phanikumar_Bhamidipati wrote:
    Yeah, I had a look at the document. But as per my understanding, the way the PHP engine runs is different from normal execs. I don't see how it can 'run different' and in my experience it doesn't. PHP sends output to stdout and stderr and reads from stdin. When PHP terminates it will close stdout and stderr and, if you have followed the recommendations in the reference, your readLine() will return 'null'.
    Because the same code ran fine when I automated unzipping a set of files using "bunzip2" command.If you read the article it explains a possible reason for this BUT until you implement the recommendations you will not know what is wrong.
    >
    I tried using Process.waitFor() method as well, but the result is same (Infinite Loop).This almost certainly is nothing to do with Process.waitFor() and probably everything to do with buffers filling (probably stderr).
    Until you post the code with the recommendations implemented that exhibits the same blocking problem it is a waste of time anyone responding further.

  • Portal Integration with JAVA ?

    Hello All,
           I've been working in the Portal for the past 1 Year.
    The work which I've done is :
    1. Creation of BSP's in SAP
    2. Create iViews in Portal accessing these BSP Applications.( BSP , IAC, URL,BW etc )
    3. Create Roles.
    Now I'm moved to one more Project which does the Portal Integration with JAVA.
    Can any one tell me what is it and how it can be done ?
    Regards,
    Deepu.K

    Hi Deepu
    You can achieve the same,please visit the following links:-
    http://help.sap.com/saphelp_nw04s/helpdata/en/d8/6ee03fc2269615e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/d8/6ee03fc2269615e10000000a155106/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/771fa290-0201-0010-3d93-865e66cc6d7e
    Regards
    Navneet
    Please revert incase of doubt.

  • Php with xsl on Sun Java Web Server 7.0

    Hi anyone,
    i installed php as nsapi via phppack. Now i need xsl support in php. I've tryed to compile php with the following line (php 5.2.6):
    ./configure with-nsapi=/export/netscape_71 enable-force-cgi-redirect with-gettext with-zlib --with-xsl=/usr/lib64/php5/extensions
    magnus.conf, obj.conf and mime.types are assimilate to this article:
    http://developers.sun.com/webtier/reference/techart/php2.html
    After compiling, i copy the libphp5.so in the .plugins/php/ dir an restart the webserver.
    He stops with this message:
    failure: CORE2253: Error running Init function load-modules: dlopen of /export/netscape_71/plugins/php/libphp5.so failed (/export/netscape_71/plugins/php/libphp5.so: wrong ELF class: ELFCLASS64)
    failure: server initialization failed
    What's going wrong?
    How i get xsl Support on Sun Java Web Server?
    thanks!

    essential wrote:
    ./configure with-nsapi=/export/netscape_71 enable-force-cgi-redirect with-gettext with-zlib --with-xsl=/usr/lib64/php5/extensionsYou are pointing to 64-bit library path. Change it to 32-bit library path.
    failure: CORE2253: Error running Init function load-modules: dlopen of /export/netscape_71/plugins/php/libphp5.so failed (/export/netscape_71/plugins/php/libphp5.so: wrong ELF class: ELFCLASS64)
    failure: server initialization failedThis means that it expects a 32-bit library but it found a 64-bit one.

  • Integrating crystal report with java

    Hi
    Any one can send me sample program for integrating Crystal report with java.I dont know how to integrate java with cryatal report.if any one helps me out from this problem an advance thanks to them
    Thanks
    Dilip

    Hi All,
    For got to mention i am using crystal reports XI release 2 with JDK1.4.
    Kalyan

  • How to get php content with java ??

    i have made a php file what will display a number,
    here's a example
    <?php
    if ($action == "answer"){
    echo "18274926";
    ?>
    no i want to get the number with java
    so here's my java code
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    class URLConnecties
        public static void main(String args[]) throws Exception
            int teken;
            URL url = new URL("http://www.gamer.mineurwar.nl/net/javachallenge.php?command=DaTe");
            URLConnection urlconnection = url.openConnection();
            System.out.println("Type inhoud: " +
                urlconnection.getContentType());
            System.out.println("Datum document: " +
                new Date(urlconnection.getDate()));
            System.out.println("Laatst gewijzigd: " +
                new Date(urlconnection.getLastModified()));
            System.out.println("Document vervalt: " +
                urlconnection.getExpiration());
            int lengteinhoud = urlconnection.getContentLength();
            System.out.println("Lengte inhoud: " + lengteinhoud);
            if (lengteinhoud > 0) {
                InputStream in = urlconnection.getInputStream();
                while ((teken = in.read()) != -1) {
                    System.out.print((char) teken);
                in.close();
    }if you change the url ro a .html file it displays the code correctly(source),
    but when trying to get the content of a php file (the number)
    it says that there is no content from the php file
    yhe source of the original php file what's in the code can be found at
    www.gamer.mineurwar.nl/net/javachallenge.txt

    The 'content' is generated dynamically by a PHP script so the "content lenght" can't be known in advance by the server. For this reason connection.getContentLenght() returns -1; it doesn't mean that there is no content, only that it can't be known how much there will be.
    To solve the issue, remove the if statement from around the while-loop:// if (lengteinhoud > 0) { DELETE THIS LINE
    InputStream in = urlconnection.getInputStream();
    while ((teken = in.read()) != -1) {
        System.out.print((char) teken);
    // } and this too

Maybe you are looking for