chen juxing

Greenhorn
+ Follow
since Feb 19, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by chen juxing

To resolve this problem, trim all of the info except "SESSIONID=XXXXXXX". Code should write this way:
HttpURLConnection huc1 = (HttpURLConnection)conn;
huc1.setRequestMethod("GET");
huc1.setDoOutput(true);
huc1.setDoInput(true);
huc1.setUseCaches(false);
huc1.setDefaultUseCaches(false);
huc1.setFollowRedirects(false);
huc1.setInstanceFollowRedirects(false);
if (!cookie.equals("")){
int pos = cookie.indexOf(';');
String session = cookie.substring(0, pos).trim();
huc1.setRequestProperty("cookie",session);
}
21 years ago
Hi,
My java-application client work this way:
first request for book list, then request for infomation of a special book by index. But I find the second request can't store the cookie from first session.
Here is my relative code:
URL url = new URL(URLAdresse);
URLConnection urlConnection = url.Connection();
if (!cookie.equals("")){
urlConnection.setRequestProperty("cookie", cookie);
}
urlConnection.connect();
kindly tell me why, thks!
[ February 20, 2003: Message edited by: chen juxing ]
21 years ago
the code should write this way:
URL url = new URL(URLAdresse);
URLConnection urlConnection = url.openConnection();
if (!cookie.equals("")){
urlConnection.setRequestProperty("cookie", cookie);
}
urlConnection.connect();
Note: I get it from internet-articles, but it's seens that still can't work, I don't know why. if you do, tell me pls!
good luck-)
[ February 20, 2003: Message edited by: chen juxing ]
21 years ago
some demos in http://javaboutique.internet.com/tutorials/Swing/index.html
NOTE: I've a problem in useing it, kindly show me why if you can run it well, thanks!
21 years ago