Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I got it!

 
chen juxing
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
}
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this make sense without a context? Probably not...

http://www.coderanch.com/t/355969/Servlets/java/why-new-URLConnection-java-application
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!