Redirect page in web service
Hi,
I am developing a web service for a client. When a client access the web service, he will be authenticated first. If the authentication is fail, he will be redirected to the error page. The question is how to redirect into a web page from web service? My code is below:
@WebService()
public class basicWS {
@Resource()
WebServiceContext wsContext;
/**
* Web service operation
*/
@WebMethod(operationName = "returnName")
public String returnName(@WebParam(name = "i") String i) {
//TODO write your implementation code here:
String tokenTest = "invalidToken:";
if (globalVar.testToken == false) {
response.redirect("error.html) --> this doesn't work for redirect page
return tokenTest+";"+i;
} else{
return "success:" +globalVar.clientPerm;
}
}
I want to redirect page after the if statement above. Does anybody know how to solve it?
Thanks,
Rick