关于饼干和窗户疑惑的HtmlUnit [英] HtmlUnit doubts regarding cookies and windows
问题描述
如果商店的HtmlUnit在内存中的Cookie,然后将响应的HtmlUnit使用cookie的服务器?
If the HtmlUnit stores cookies in memory then Will HtmlUnit respond the server with cookies?
在化的HtmlUnit会话终止?它会终止我的呼唤webclient.closeWindow()?
When the HtmlUnit session terminates? Will it terminate when i call webclient.closeWindow()?
由于累计。以化的HtmlUnit文档,Web客户端重新presents浏览器,所以它是重新present一个多发窗口浏览器(如IE 7中,我们可以打开多个标签),或者重新preSEN单窗口浏览器?
As acc. to the HtmlUnit docs, WebClient represents a browser, so Is it represent a mutiple-windows browser (like IE7 in which we can open multiple tabs) or represen a single-window browser?
如果它重新presents的多窗口浏览器,那么就HttpSession中保持翻过的Web客户端像真正的浏览器的多个窗口?
If it represents a multiple-window browser, then does the HttpSession is maintained accross multiple windows of that webclient like real browsers?
推荐答案
不是一个真正的答案,但一些线索。
Not a real answer, but some hints.
如果商店的HtmlUnit在内存中的Cookie,然后会用的HtmlUnit回应饼干服务器?
If the HtmlUnit stores cookies in memory then Will HtmlUnit respond the server with cookies?
的HtmlUnit的cookie政策是要浏览器兼容的,所以我希望它这样做。
HtmlUnit's cookie policy is to be browser-compatible so I would expect it to do so.
在化的HtmlUnit会话终止?它会终止我的呼唤webclient.closeWindow()?
When the HtmlUnit session terminates? Will it terminate when i call webclient.closeWindow()?
我不知道这一个。你有没有尝试测试或调试呢?你看看源$ C $ C?其实,我不知道应该是预期的行为在这里。
I'm not sure about this one. Did you try to test or debug this? Did you look at the source code? Actually, I wonder what should be the expected behavior here.
由于累计。以化的HtmlUnit文档,Web客户端重新presents浏览器,所以它重新present一个多发窗口浏览器(如IE 7中,我们可以同时打开多个标签),或者单窗口浏览器?
As acc. to the HtmlUnit docs, WebClient represents a browser, so does it represent a mutiple-windows browser (like IE7 in which we can open multiple tabs) or a single-window browser?
我认为 Web客户端
重新presents一个标签式浏览器。
I consider that WebClient
represents a single tabbed browser.
如果它重新presents的多窗口浏览器,那么就HttpSession中保持翻过的Web客户端像真正的浏览器的多个窗口?
If it represents a multiple-window browser, then does the HttpSession is maintained accross multiple windows of that webclient like real browsers?
请注意,这种行为是不是浏览器之间和浏览器版本之间是一致的:IE6,IE7,IE8,火狐,Chrome,他们的行为都(或多或少)不同(见的在Firefox和Internet Explorer ,或者Cookie <一个href=\"http://sqlblogcasts.com/blogs/jonsayce/archive/2007/11/06/Browsers_2C00_-processes_2C00_-cookies-and-session-state.aspx\"相对=nofollow>浏览器,流程,饼干和会话状态,或的会话Cookie,sessionStorage的,和IE8 )。所以,我不认为有与真正的浏览器的一般规则。
Note that this behavior is not consistent between browsers and between browser versions: IE6, IE7, IE8, Firefox, Chrome, they all behave (more or less) differently (see Cookies in Firefox and Internet Explorer, or Browsers, processes, cookies and session state, or Session Cookies, sessionStorage, and IE8). So I wouldn't consider that there is a general rule with "real" browsers.
其实,我认为你最好的武器是源$ C $ c和调试器。这些问题会很容易验证IMO。
Actually, I think that your best weapons are the source code and your debugger. These questions would be easy to verify IMO.
这篇关于关于饼干和窗户疑惑的HtmlUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!