By Date: <-- -->
By Thread: <-- -->

SV: SV: Problem with filter and calling Perl-script with Tomcat 5.5.20



Ok that should not be that hard to POST with java, your filter is acting like a client.

have a look there

http://www.javaworld.com/javaworld/javatips/jw-javatip34.html


Gunnar.Bostrom (at) tietoenator.com a écrit :
Hi,

No I can't because it is a form with data posted that should be sent over to the Perl script and one additionally parameter.

Regards
Gunnar



-----Ursprungligt meddelande-----
Från: Michael Courcy [mailto:michael.courcy (at) gmail.com] Skickat: den 17 oktober 2006 11:05
Till: Tomcat Users List
Ämne: Re: SV: Problem with filter and calling Perl-script with Tomcat 5.5.20


Can't u use

request.sendRedirect("myperlscript.cgi?aparam="+request.getPar
ameter("blah"));

Mic

Gunnar.Bostrom (at) tietoenator.com a écrit :
Hi,

The problem is not to get the parameters in my java filter. The problem is that I need to pass the posted parameters
from the form plus one additional parameter to my Perl script.
Regards
Gunnar


-----Ursprungligt meddelande-----
Från: Martin Gainty [mailto:mgainty (at) hotmail.com]
Skickat: den 16 oktober 2006 18:06
Till: Tomcat Users List
Ämne: Re: Problem with filter and calling Perl-script with Tomcat 5.5.20


Gunnar-

String AStringWhichHoldsPostedOrQSValue;
if(HttpServletRequest.getMethod() == "POST") { //Post only AStringWhichHoldsPostedOrQSValue = HttpServletRequest.getParameter("whatever");
}
else
{ //Get Only..
AStringWhichHoldsPostedOrQSValue = HttpServletRequest.getQueryString();
}
It has been my experience that getParameter<Whatever> does NOT retrieve POSTed values when Method = 'Get')



M-

This e-mail communication and any attachments may contain confidential and privileged information for the use of the
designated
recipients named above. If you are not the intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination,
distribution or
copying of it or its contents
----- Original Message -----
From: <Gunnar.Bostrom (at) tietoenator.com>
To: <users (at) tomcat.apache.org>
Sent: Monday, October 16, 2006 11:09 AM
Subject: Problem with filter and calling Perl-script with Tomcat 5.5.20



Hi,

I've a problem with the new 5.5.20 Tomcat version.
I think this has to do with this bug fix http://issues.apache.org/bugzilla/show_bug.cgi?id=37285.


The problem is that I have a filter that adds a parameter
before the
CGI-filter calling out to a Perl-script.

This code worked with Tomcat 5.5.17 and works with 5.5.20 if the request is a GET but not a POST.

This is the relevant code:

HttpServletRequest httpServletRequest =
(HttpServletRequest) request;
HashMap<String, String[]> parameters = new HashMap<String,
String[]>(
(HashMap<String, String[]>)
httpServletRequest.getParameterMap());
fillUserInfo(parameters);
httpServletRequest = generateWrapper(httpServletRequest,
parameters); chain.doFilter(httpServletRequest, response);


Can you advise me what to do?

Regards
Gunnar


---------------------------------------------------------------------
To start a new topic, e-mail: users (at) tomcat.apache.org To
unsubscribe,
e-mail: users-unsubscribe (at) tomcat.apache.org
For additional commands, e-mail: users-help (at) tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users (at) tomcat.apache.org To
unsubscribe,
e-mail: users-unsubscribe (at) tomcat.apache.org
For additional commands, e-mail: users-help (at) tomcat.apache.org



--------------------------------------------------------------------- To start a new topic, e-mail: users (at) tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe (at) tomcat.apache.org For additional commands, e-mail: users-help (at) tomcat.apache.org