Hi,
I'm trying the following can anyone advice on the existing code.
1) open this page in a new window but for some reason it does not do that
Instead it opens in the same.
2) Here I'm trying to get the URL from the prop file using the TranManager class.
String URL = trans.getProperty("URL");
(Where URL on the prop file is , URL=
https://www.hotmail.com/login.asp)
but this does not work if I change to the following
out.println("<form name=\"MyForm\" method=\"post\" action=\"URL">");
How do i pass the string value to my form action
public class LoginServlet extends ServletUtility {
Cache cache = Cache.getInstance();
TranManager trans = TranManager.getInstance();
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
resp.setContentType("text/
html");
resp.setHeader("Cache-Cont
rol","no-s
tore");
ServletOutputStream out = resp.getOutputStream();
String IdString = getId(req);
Para en = (Para)cache.getItem(IdStri
ng);
String token = null;
displayPage(token, req, resp, out);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void displayPage(String token, HttpServletRequest req, HttpServletResponse resp, ServletOutputStream out) throws IOException{
//Here I'm trying to get the URL from the prop file using the TranManager class
String URL = trans.getProperty("URL");
// out.println("<html>");
// out.println("<head>");
// out.println("</head>");
out.println("<body onload=\"document.MyForm.s
ubmit()\">
");
out.println("Please Wait...");
//out.println("<form name=\"MyForm\" method=\"post\" action=\"URL">");
out.println("<form name=\"MyForm\" method=\"post\" action=\"
https://www.hotmail.com/login.asp">")
;
out.println("<input type=\"hidden\" name=\"Token\" value=\"New Window\" onClick=\"window.open(out.
print(toke
n))\">");
out.println("</form>");
out.println("</body>");
// out.println("</html>");
}
}
Regs
bangviz
Start Free Trial