Re: Chaining Perl and C handlers

2000-11-15 Thread G.W. Haywood

Hi there,

On Tue, 14 Nov 2000, Andrew Chen wrote:

 1. Request comes in for t.jsp?test=1joe=2
 2. Handler steps in and adds another parameter, t.jsp?test=1joe=2moe=3
 3. Request is then handled by BEA-Apache bridge so that it is forwarded to
 Weblogic
 4. JSP runs on Weblogic, and the new parameter (joe)

moe?

 can be referenced in the JSP.

I'm not familiar with this bridge, but I don't see why this needs to
be complicated.  What determines the new parameter?  After the handler
adds the new parameter, could you get it to make another request which
then gets caught by mod_rewrite and/or mod_proxy for example?

73,
Ged.




Re: Chaining Perl and C handlers

2000-11-15 Thread Andrew Chen

Ged,

Thanks for the input-- here are my answers below...

The new parameter (which in the example was moe and not joe, my mistake)
will be a "webid", a unique identifier for each website that is parsed out
of the physical location of the file.

For example,
  www.joe-honda-dealer.com/inventory.jsp
corresponds to something like:
  /web/active/honda/joedeal/html/inventory.jsp
where joedeal is the webid.

Instead of having a bunch of identical inventory pages, however, we're
just going to have one JSP on the Weblogic server that accepts a webid
parameter which is responsible for how the page gets built. Let me know if
you need further clarification on this.

My main issue is that I don't know how to add parameters to the POST and
GET data.

Again, thanks for the help!!

Andrew Chen
Software Engineer, Architecture
[EMAIL PROTECTED]
206-219-8445
The Cobalt Group, Inc. (www.cobaltgroup.com)
2200 First Avenue South
Seattle, WA 98134

On Wed, 15 Nov 2000, G.W. Haywood wrote:

 Hi there,
 
 On Tue, 14 Nov 2000, Andrew Chen wrote:
 
  1. Request comes in for t.jsp?test=1joe=2
  2. Handler steps in and adds another parameter, t.jsp?test=1joe=2moe=3
  3. Request is then handled by BEA-Apache bridge so that it is forwarded to
  Weblogic
  4. JSP runs on Weblogic, and the new parameter (joe)
 
 moe?
 
  can be referenced in the JSP.
 
 I'm not familiar with this bridge, but I don't see why this needs to
 be complicated.  What determines the new parameter?  After the handler
 adds the new parameter, could you get it to make another request which
 then gets caught by mod_rewrite and/or mod_proxy for example?
 
 73,
 Ged.
 




Re: Chaining Perl and C handlers

2000-11-15 Thread Perrin Harkins

On Wed, 15 Nov 2000, Andrew Chen wrote:
 The new parameter (which in the example was moe and not joe, my mistake)
 will be a "webid", a unique identifier for each website that is parsed out
 of the physical location of the file.
 
 For example,
   www.joe-honda-dealer.com/inventory.jsp
 corresponds to something like:
   /web/active/honda/joedeal/html/inventory.jsp
 where joedeal is the webid.
 
 Instead of having a bunch of identical inventory pages, however, we're
 just going to have one JSP on the Weblogic server that accepts a webid
 parameter which is responsible for how the page gets built. Let me know if
 you need further clarification on this.
 
 My main issue is that I don't know how to add parameters to the POST and
 GET data.

The "GET data" is just the URI requested.  You can mess with that easilly.  
POST data is slightly trickier but should also be possible through the
Apache API.

If that's all you want do, don't bother using mod_perl for it.  It sounds
like you could maybe do it with mod_rewrite or a tiny custome TransHandler
written in C.  No need to use all that memory loading Perl just for this.

- Perrin




Re: Chaining Perl and C handlers

2000-11-14 Thread Andrew Chen

Ged,

What we are doing is having requests for files of extension *.jsp be
passed from Apache to a BEA Weblogic box to be handled. However, we want
to add an extra parameter into the GET/POST data before the request is
passed.

Thus, these are the steps:

1. Request comes in for t.jsp?test=1joe=2
2. Handler steps in and adds another parameter, t.jsp?test=1joe=2moe=3
3. Request is then handled by BEA-Apache bridge so that it is forwarded to
Weblogic
4. JSP runs on Weblogic, and the new parameter (joe) can be referenced in
the JSP.

In order to do this, I was thinking that I could either chain the handlers
(have the custom handler alter the data in the request and then pass it
onto the BEA-Apache bridge) or I could just put the custom handler in an
earlier stage and alter the request then. I'm just not sure how to do it.

Let me know if you need any more clarification! Thanks a lot!

Andrew Chen
Software Engineer, Architecture
[EMAIL PROTECTED]
206-219-8445
The Cobalt Group, Inc. (www.cobaltgroup.com)
2200 First Avenue South
Seattle, WA 98134

On Tue, 14 Nov 2000, G.W. Haywood wrote:

 Hi ther,
 
 On Mon, 13 Nov 2000, Andrew Chen wrote:
 
  Is there any way to maybe sneak into the handler cycle before the
  BEA-Apache handler and alter the GET/POST data, thus accomplishing the
  same thing? Let me know if you need any clarification.
 
 I need clarification.
 
 :)
 
 73,
 Ged.
 




Re: Chaining Perl and C handlers

2000-11-13 Thread Andrew Chen

Thanks for the reply!

Is there any way to maybe sneak into the handler cycle before the
BEA-Apache handler and alter the GET/POST data, thus accomplishing the
same thing? Let me know if you need any clarification.

(any replies should go to my e-mail address, as I'm not subscribed to the
mod_perl list)

Andrew Chen
Software Engineer, Architecture
[EMAIL PROTECTED]
206-219-8445
The Cobalt Group, Inc. (www.cobaltgroup.com)
2200 First Avenue South
Seattle, WA 98134

On Tue, 7 Nov 2000, G.W. Haywood wrote:

 Hi there,
 
 On Mon, 6 Nov 2000, Andrew Chen wrote:
 
  According to my trusty Eagle book, I can chain Perl handlers (by using
  $r-pushhandlers(), but can I chain a C handler after a Perl handler?? 
 
 Not until Apache 2.0, Eagle Book p175, "Chaining Content Handlers".
 A C handler either handles the entire request or returs declined.
 
 73,
 Ged.
 




Re: Chaining Perl and C handlers

2000-11-07 Thread G.W. Haywood

Hi there,

On Mon, 6 Nov 2000, Andrew Chen wrote:

 According to my trusty Eagle book, I can chain Perl handlers (by using
 $r-pushhandlers(), but can I chain a C handler after a Perl handler?? 

Not until Apache 2.0, Eagle Book p175, "Chaining Content Handlers".
A C handler either handles the entire request or returs declined.

73,
Ged.




Chaining Perl and C handlers

2000-11-06 Thread Andrew Chen

All,

The project I'm working on requres me to do the following:

1. GET/POST Request comes in
2. Request gets handled by a mod_perl handler, which modifies and adds
to the GET/POST variables.
3. Request is then sent to a C handler (BEA WLS-Apache bridge)
4. Request is then handled by a JSP, which should be able to read the
changes that were added in step 2.

According to my trusty Eagle book, I can chain Perl handlers (by using
$r-pushhandlers(), but can I chain a C handler after a Perl handler?? 
And yes, I know this is kind of bizarre.

Thanks in advance!

I'm not on the mod_perl list, so please cc: me.

Andrew Chen
Software Engineer, Architecture
[EMAIL PROTECTED]
206-219-8445
The Cobalt Group, Inc. (www.cobaltgroup.com)
2200 First Avenue South
Seattle, WA 98134