-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4255182
By: nobody1
Hello,
i want to download a *.cvs File after click a button, but the GUI should be static. So i try this:
void getFile(){
Window win = new Window();
win.setParent(rootWindow);
win.setMode("popup");
win.doPopup();
win.setVisible(false);
Iframe iF = new Iframe();
iF.setParent(win);
Sessions.getCurrent().setAttribute("attrName",Java.Object);
Sessions.getCurrent().setAttribute("attrName","ObjectTyp");
iF.setSrc("http://localhost:8080/Servlet");
}
this is working with Session in Servlet, but if i'll change the following:
iF.setSrc("http://192.169.0.1:8080/Servlet");
it won't work the Servlet doesn't get any Attributes.
The Servlet has the Following structure in the doGet(HttpServletRequest request, HttpServletResponse response) Method:
response.setContentType("application/x-download");
response.setHeader("Content-Disposition","attachment;filename="file.csv");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
out.print(session.getAttribute("attrName"));
out.print(session.getAttribute("attrName1"));
}
I don't know why it works with the http://localhost, but never with the IP form Server
I hope someone can help me
-----
nobody1
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4255232
By: nobody1
I've logged something with the code above and the chaning IP's:
The SessionCreationTime is by http://localhost:8080/WebApp/Servlet the same
CreationTime:1176290578062
CreationTime:1176290578062
CreationTime:1176290578062
but if I call http://127.0.0.1/WebApp/Servlet or http://192.168.0.1/WebApp/Servlet
different:
CreationTime:1176301009140
CreationTime:1176301019687
So the result is that the session is termianted, but why it won't terminate by localhost?
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4256460
By: jumperchen
I think that any difference domain name is different for webapp server.
Jumper
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4256488
By: nobody1
thx it work's. The problem was that my pc is server and client together and so i've called locelhost but when i call IP it works fine
nobody1
Asked: 2007-04-11 13:44:37 +0800
Seen: 279 times
Last updated: Apr 12 '07