Data collection after JSP login-strange Apache server

Source: Internet
Author: User

A site created by JSP can obtain some information only after logon. Generally, websites, ASP, and aspx maintain the logon status through cookies or sessions (marked by cookies, therefore, access the logon page to obtain the cookie, and then attach the cookie to the request to obtain the target page. The result was fruitless one afternoon in the JSP site yesterday, the post logon page is successful, and the seesion information is returned (as follows. allowautoredirect = false; then, you can get the JSESSIONID correctly. However, if you attach this JSESSIONID to a new request (when the page needs to be collected), the server will always return the 500 Error !,
Observe the header information repeatedly.
// ==================== Header information returned after Logging
HTTP/1.1 302 moved temporarily
Set-COOKIE: JSESSIONID = a8e7b16c1786f6e3d40457cf1_8c4c2; Path =/scoretable
Location: http://xxx.com: 8080/xxx. jsp
Content-Type: text/html; charset = GBK
Content-Length: 0
Date: Thu, 19 Feb 2009 03:07:28 GMT
Server: APACHE-Coyote/1.1
// ======================================
The redirection command is generated when location in the information, which will first locate the page to the http://xxx.com: 8080/xxx. jsp when using IE, but now use Program Access should be ignored after obtaining the cookie. You can directly access the target page (at least in an ASP or aspx environment )....
Finally, the helpless in the program to complete the cookie to obtain the first visit a http://xxx.com: 8080/xxx. JSP, and then visit the target page. The result is a miracle, and the data is obtained successfully. Of course, the two requests are appended with the obtained session flag.
I don't know the specific cause. It is probably because of the special nature of the Apache server. It may check whether the location command is correctly executed for a session (a session). Finally, I hope someone can give me some advice!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.