Mark -

        Thanks for the pointers. I ended up picking up code from the
Tomcat source of org.apache.catalina.ant.AbstractTask and using that to do
Basic Authentication. I've got it working now.



Garey Mills
Library Systems Office
UC Berkeley

The brain is not where you think

On Tue, 18 Apr 2006, Mark Thomas wrote:

> Garey Mills wrote:
> > Mark -
> > 
> >     I have looked at the manager app how-to, and it doesn't describe
> > how connect from a script. I have this
> > 
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >     private static String stop =
> > "http://myhost:8080/manager/stop?path=/myapp";;
> > 
> >     public static void main(String[] args) {
> > 
> > 
> >             try {
> >         
> >         URL stopURL = new URL(stop);
> > 
> >         URLConnection cnxn = ustopURL.openConnection();
> > 
> >         cnxn.setRequestProperty("username", "user");
> >         cnxn.setRequestProperty("password", "password");
> > 
> >         cnxn.connect();
> > 
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > 
> > but am still getting 401. Do you have any suggestions?
> 
> This isn't how BASIC authentication works. For details see RFC 2617 or
> for the quick solution see the applyHttpBasicAuthentication method in
> http://marc2.theaimsgroup.com/?l=fop-cvs&m=114069081209918&w=2
> 
> Alternatively take a look at HTTPClient that will hide all this fun
> and games.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> 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