1 16 package org.mortbay.jetty.servlet; 17 18 import java.io.IOException ; 19 20 import org.mortbay.http.HttpFields; 21 import org.mortbay.http.HttpResponse; 22 import org.mortbay.http.UserRealm; 23 24 25 29 public class BasicAuthenticator extends org.mortbay.http.BasicAuthenticator 30 { 31 32 33 36 public void sendChallenge(UserRealm realm, HttpResponse response) throws IOException 37 { 38 response.setField(HttpFields.__WwwAuthenticate,"basic realm=\""+realm.getName()+'"'); 39 40 ServletHttpResponse sresponse = (ServletHttpResponse) response.getWrapper(); 41 if (sresponse!=null) 42 sresponse.sendError(HttpResponse.__401_Unauthorized); 43 else 44 response.sendError(HttpResponse.__401_Unauthorized); 45 } 46 } 47 | Popular Tags |