I haven't actually used it, but the Commons HttpClient
(http://jakarta.apache.org/commons/httpclient/index.html) might of
interest to you.

Steve

> -----Original Message-----
> From: Henry Voyer [mailto:[EMAIL PROTECTED]
> Sent: September 13, 2003 8:50 PM
> To: [EMAIL PROTECTED]
> Subject: Q : Calling an action via a java URL ?
>
>
> hi fellow programmers
>
> im trying to call a struts action via http in a java program.
>
> Something like URL (Action to call)
>
> http://localhost:8443/printHelloWorld.do
>
> this returns a blank page with the text "Hello World"
>
> I want to read this input from a java program using something like
>
>    URL u = new URL(notificationServiceURL);
>     URLConnection uc = u.openConnection();
>     uc.setDoOutput(true);
>     uc.setRequestProperty("Content-Type",
> "application/x-www-form-urlencoded");
>     PrintWriter pw = new PrintWriter(uc.getOutputStream());
>
>     pw.close();
>
>     BufferedReader in = new BufferedReader(new InputStreamReader(
>         uc.getInputStream()));
>     String res = in.readLine()
>                    .trim();
>     in.close();
>
> But i keep getting some errors.
> Has someone tried this before? with parameters, properties, etc etc?
>
> Thanks a lot
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> ------------------------------------------------------------
> ---------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to