Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Forward http request from Sevlet to Package Procedure

Re: Forward http request from Sevlet to Package Procedure

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Mon, 11 Nov 2002 22:06:26 +0300
Message-ID: <aqov7s$mf5$1@babylon.agtel.net>


Not sure this is the right NG to ask, .misc looks more like it. Anyway, without seeing a snippet of your servlet code and possibly package specification it's hard to say why this doesn't work. How are you passing control to the package? Do you call it via JDBC or are you attempting to redirect the client to the right place after you're done with that extra processing?

If you work through JDBC, then you gotta emulate PL/SQL gateway (mod_plsql) in your servlet (set up environment, call the package procedure and pass it relevant parameters, collect package output and stream it to the client) if your package uses OWA and outputs anything to the client, otherwise it's pretty safe to simply call the procedure through JDBC and supply all relevant data to it.

If you do some preprocessing and then redirect client browser to the new location I don't see why it shouldn't work except for one tricky issue: there are actually three HTTP 1.1 status codes that do redirection - 302, 303 and 307, while in HTTP 1.0 there was only 302. 302 means "redo your request to this new location preserving the method" while 303 means "GET response from this new location" and 307 means practically the same as 302. Regretably, most browsers behave on 302 the way they should for 303 - they GET the new location no matter the method they used originally (so if original method was POST, 302 will cause GET on new location instead of POST with the same data), especially if the protocol in use is HTTP 1.0. So you actually should use 307 code in your response and hope that the browser on the other side understands HTTP 1.1. Take a look at RFC 2616 (http://www.ietf.org/rfc/rfc2616.txt) for more details on HTTP status codes and expected user agent behavior.

hth.

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Art" <ajs5mz2_at_yahoo.com> wrote in message news:28874e4d.0211111008.6765ec35_at_posting.google.com...

> Hi,
>
> I'm trying to foward an http request from a servlet to an Oracle
> Package Procedure. The package in question is an update package the
> normally processes a forms post method.
>
> I have redireced the forms post method the a java servelt for some
> additional processing and would like to pass the request to the
> package procedure.
>
> Is this possible? Are there some special contraints that must be met
> to allow this to work?
>
> The oracle package procedure response to the http request coming
> directly from a form just fine but it does not respond to a request
> coming from a servlet.
>
> Thanks,
>
> Art
Received on Mon Nov 11 2002 - 13:06:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US