Users comes to a page by using following URL:
http://myswerver/mydb.nsf/myagent?OpenAgent
Now I want this Java agent check something in the db and if it meets some conditions then redirect user to another page. If not - load main page that is build by myagent. Here is my agent code:
PrintWriter pw = getAgentOutput();
if(myvar == 1){
pw.flush();
pw.println("Content-Type: text/html");
pw.println("<html><head>");
pw.println("<script>location.href=\"http://www.mypage.com\"</script>");
pw.println("</head></html>");
}
The problem that it loads agents' page everytime even it redirects then. I do want to redirect immediately