Announcement Announcement Module
Collapse
No announcement yet.
Java Plug-in, applet, HttpInvoker, cookies Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java Plug-in, applet, HttpInvoker, cookies

    Hello:

    I'm relatively new to Spring and I'm having some issues using the HttpInvoker within an applet. Okay, I'm new to applets as well. I did several searches of this site and I did not find anyone else expressing these specific concerns, so I apologize in advance if this has already been addressed...

    I am using Spring 1.2RC2. I see 1.2 final has just be released, and I'll start working with that soon. I am currently prototyping a system we'd like to put into production. This is a server (webapp) that fields requests from an applet using the Spring HttpInvoker remoting technology. The application server is JRun 3.1 (yeah, I know it's old), authentication is required (security constraints defined, authentication does occur), and this will all run over HTTPS with a loadbalancer in tow. Both a load balancer cookie and the JRun session cookie must be present in the request in order for it to reach the server code.

    Currently, I'm just using plain old HTTP. In my first attempt, I had <applet> parameters generated by a JSP that provided cookie names and values. I used HttpClient (3.0) in the Applet provide the cookies with each request, and things seemed fine.

    In the real world, the client browser may well be configured to use a proxy. I did this so I could check out the network traffic using Ethereal (server and client running on my PC, localhost). While I could see the expected HTTP traffic in getting the applet loaded, I never saw the HttpInvoker calls. Then it dawned on me that perhaps the proxy is not being used for those.

    I spent some time reading about the Java Plug-in (1.4.2_07), which is installed in the browser (IE). The Sun pages talk about how the plug-in can access the cookies cached by the browser. And, how it can also obtain the proxy settings. It also talks about working over HTTPS. Hmm, that sounds just perfect.

    So, how can I take advantage of this using the vanilla HttpInvoker in Spring? While I had to define a CommonsHttpInvokerRequestExecutor bean and an HttpClient instance for using the HTTP client stuff, it seems now I don't have to define anything other than the HttpInvokerProxyFactoryBean for each service interface I wish to invoke. In theory, then, should not the applet then make use of the Java plug-in functionality when making HTTP requests? Does the Spring HttpInvoker somehow bypass it?

    When I try to run this way, I get the I/O stream corrupted exception, which is probably because the client is receiving a login page for authentication rather than a serialized Java object.

    Thanks for any helpful suggestions. Perhaps this just cannot be done?

    Cheers,

    Jeff

  • #2
    Well, this is interesting...

    Now that I'm playing with my prototype at home using Mac OS X (10.3.8) and Safari (1.2.4), my services (Still JRun 3.1) are being invoked properly. Again, I'm not using HttpClient.

    Safari does not draw the applet at all correctly, but I'm able to see what my HttpInvoker server side is printing out, the the values it claims to be returning to the applet. I'm not sure how the Java plug-in technology works with Safari (I can't find a way to bring up a Java console either), but I'm guessing it is getting the expected results returned by the server. I can see that both the jsessionid and the load balancer (ARPT) cookie (artificially set in a JSP) are being presented with each request.

    My work prototype environment was IE on Windows XP, with the Java 1.4.2 plug-in. The other difference between the two setups is that I was using a proxy at work, but not here at home...

    Cheers,

    Jeff

    Comment

    Working...
    X