Re: Multiple serverside processes - Java PHP?
in message <email@example.com>,
firstname.lastname@example.org ('email@example.com') wrote:
I currently have two successful serverside processes that need to be
married together. One is a servlet that performs complex calculations.
Another is a PHP script that distills user input into an xml formatted
email attachment and sends.
Is it possible to link these two in some way without rewriting one in
the other language? I need one user submit to trigger it all.
Easy. Do a client-side redirect from one to the other. You can pass any
arguments you like in the redirect URL, although this isn't very secure as
they will go over the network in clear twice. Or you can create a uniquely
named temporary file on the server, and pass it's name as an argument in
the redirect URL.
HttpServletResponse res =
(HttpServletResponse) context.get( RESPONSEMAGICTOKEN );
HttpServletRequest req =
(HttpServletRequest) context.get( REQUESTMAGICTOKEN );
URL desturl = null;
if ( req != null ) // it *shouldn't* be..
// normalise the URL if possible (should be)
URL here = new URL( req.getRequestURL( ).toString( ) );
desturl = new URL( here, deststring );
desturl = new URL( deststring );
// convert it back into a string
deststring = desturl.toString( );
res.setStatus( HttpServletResponse.SC_MOVED_TEMPORARILY );
res.setHeader( "Location", deststring );
You can do the equivalent in PHP but seeing it's ten years since I built
anything significant in PHP I'll leave that to others.
firstname.lastname@example.org (Simon Brooke) http://www.jasmine.org.uk/~simon/
;; L'etat c'est moi -- Louis XVI
;; I... we... the Government -- Tony Blair