Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLConnection and Java HttpSession's  RSS feed

 
Kyle Willkomm
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to make a connection over the web to a java application that maintains a session. It seems that using the URLConnection class you must instantiate it with the URL you want to hit. In doing so each new URL you hit the server with seems to get assigned a new session id different from the previos. And so I can not find a way to hit the web application with several requests in a row that are treated as coming from the same session.
 
Guillaume Compagnon
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the java.net.HttpURLConnection class should be convenient.
it is based on a URLConnection but consuming just one socket, so for the webserver, several HttpURLConnection should be on the same session.
could U try and reply to this post to tell if it works ?
"Each HttpURLConnection instance is used to make a single request but the underlying network connection to the HTTP server may be transparently shared by other instances. Calling the close() methods on the InputStream or OutputStream of an HttpURLConnection after a request may free network resources associated with this instance but has no effect on any shared persistent connection. Calling the disconnect() method may close the underlying socket if a persistent connection is otherwise idle at that time. "
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This topic is better suited to the Networking and protocals forum. I'm going to move it there.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are several ways to do this. The first URLConnection will create the session. Servers that follow the specs for Servlets 2.2 start a session by returning a cookie in a header field with the value jsessionid=< id assigned > You can use the methods of the URLConnection to go through any cookies and get this value. For subsequent connects add
;jsessionid=< id assigned >
to the end of the URL and it will be part of the established session. You know the session has expaired when the server returns a new cookie with a new value for jsessionid.
------------------
I Hope This Helps
Carl Trusiak, SCJP2
[This message has been edited by Carl Trusiak (edited September 12, 2001).]
 
Kyle Willkomm
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried passing back jsession id in the url itself, the parameters, and the input stream of the httpconnection object but none seem to be treated by tomcat as a session id. I pass other parameters in and they get picked up by various forms but not the session id. If you can get this to work in actualy code I would be impressed. I will try to paste some of my attempts here.
http.setRequestProperty("Cookie", "JSESSIONID="+h1);
(where h1 is the session id I pulled from the first url hit.)
I tried in the URL http://xxx.xx.com/servlet/context?jsessionid=1928371&other stuff
and passing the key/value pair over the...
http.setDoOutput(true);
buffered = new BufferedOutputStream(http.getOutputStream());
//OutputStreamWriter out = new OutputStreamWriter(buffered, "8859_1");
out = new OutputStreamWriter(buffered);
out.write(key/value);
out.flush();
Sorry for the psuedo code but I have trashed this par tof my program about 10 times now trying different things.
 
Kyle Willkomm
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Full code that attempt to submit in three manners. Attach to url; on input stream; with cookie.
package com.launchnow.prf;
import java.net.*;
import java.io.*;
import java.util.*;
/*
Subclass hits a URL and implements runnable so as to run in its own thread.
I wanted it to use multiple URLs in succession but because of the current
java methods that was not possible. I left in the functionality in case it
one day is.
*/
public class ListURLSubmitter {
private java.lang.String[] m_parameters = null;
private java.lang.String[] m_requestType = null;
private ArrayList[] m_URLList = null;
private StringBuffer m_response = new StringBuffer();

public static void main(String[] args) {
//in a perfect world this would contain URL submission testing code
}

public ListURLSubmitter(ArrayList[] url,java.lang.String[] parameters, java.lang.String[] type) {
m_URLList = url;
m_parameters = parameters;
m_requestType = type;
}
public void submit() {

try{
String h1 = null;

//variables
HttpURLConnection http = null;
OutputStream buffered = null;
OutputStreamWriter out = null;
Reader reader = null;

for ( int i=0; i < m_URLList.length; i++)
{
System.out.println((String)m_URLList[i].get(0)+" "+(String)m_URLList[i].get(1)+" "+((Integer)m_URLList[i].get(2)).intValue()+" "+(String)m_URLList[i].get(3)+"?JSESSIONID="+h1);
URL temp = new URL((String)m_URLList[i].get(0), (String)m_URLList[i].get(1), ((Integer)m_URLList[i].get(2)).intValue(), (String)m_URLList[i].get(3)+"?JSESSIONID="+h1);
http = (HttpURLConnection)temp.openConnection();
http.setRequestProperty("Accept", "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*");
http.setRequestProperty("Referer", "http://lnmmfs02.launch-now.com:8997/lnie/Login.jsp");
http.setRequestProperty("Accept-Language", "en-us");
http.setRequestProperty("Accept-Encoding", "gzip, deflate");
http.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; ACIE55)");
http.setRequestProperty("Host","lnmmfs02.launch-now.com:8997");
http.setRequestProperty("Connection","Keep-Alive");
if (h1 != null)
{
http.setRequestProperty("Cookie", "JSESSIONID="+h1);
//http.setUseCaches(false);
//http = (HttpURLConnection)temp.openConnection();
Map map = http.getRequestProperties();
System.out.println(map.entrySet());

//
//Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
//Referer: http://lnmmfs02.launch-now.com:8997/lnie/MyHome_Header.jsp
//Accept-Language: en-us
//Accept-Encoding: gzip, deflate
//User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; ACIE55)
//Host: lnmmfs02.launch-now.com:8997
//Connection: Keep-Alive
//Cookie: JSESSIONID=elwfgxn9v1
//
}

if (m_requestType[i].equals("POST")) {

http.setDoOutput(true);
http.setAllowUserInteraction(true);
buffered = new BufferedOutputStream(http.getOutputStream());
out = new OutputStreamWriter(buffered, "8859_1");
//out = new OutputStreamWriter(buffered);
out.write("JSESSIONID="+h1+"&"+m_parameters[i]+"&JSESSIONID="+h1);
http.connect();
out.flush();
out.close();

} else {
http.setDoOutput(false);
http.connect();
}

//gives the ability to see the html response from the server
reader = new InputStreamReader(new BufferedInputStream(http.getInputStream()));
int c = 0;
while ( (c = reader.read()) != -1 )
{
m_response.append((char) c);
//System.out.println((char) c);
}

if (h1 == null) {
System.out.println();
System.out.println("Parsing headerfields of response");
int g = 0;
System.out.println();
while (http.getHeaderField(g) != null) {
System.out.println(http.getHeaderField(g));
g++;
}
System.out.println();
h1 = http.getHeaderField(3);

StringBuffer s = new StringBuffer(h1);
h1 = s.substring(11, 21);
}

http.disconnect();
reader.close();

//System.out.println("Session ID print "+http.getHeaderField(h1));
}
} catch (IOException e)
{
System.err.println(e.getMessage());
e.printStackTrace();
}
catch (Exception e)
{
System.err.println(e.getMessage());
e.printStackTrace();
}
}
public String getResponse() {
return m_response.toString();
}
}
package com.launchnow.prf.preorder;
import java.util.*;
import java.net.*;
import com.launchnow.prf.*;
/*subclass hits a URL and implements runnable so as to run in its own thread.
I wanted it to use multiple URLs in succession but because of the current
java methods that was not possible. I left in the functionality in case it
one day is.
*/
public class StressTestPreorder implements Runnable {
/*used to track currect running thread id*/
private Thread thread;

/*for gracefully stopping the thread*/
public void stopRequest() {
if (thread != null)
thread.interrupt();
}

/*main sets up arrray of runnable preorder test threads and run them */
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Usage: java StressTestPreorder -number of users to simulate-");
} else
{
//get the number of hits to make from the command line
int hits = Integer.parseInt(args[0]);
System.out.println("Submitting " + hits + " PreOrders!");

//build an array of threads filled with a reference to a form submission runnable
Thread[] threads = new Thread[hits];
StressTestPreorder form;
for (int j = 0; j < threads.length; j++)
{
//give a runnable a thread and start it on its merry way
form = new StressTestPreorder();
Thread thread = new Thread(form, "StressTestPreorder");
threads[j] = thread;
threads[j].start();
}
}
}
/*run demanded by Runnable interface, launching point for thread*/
public void run () {

thread = Thread.currentThread();
try{
//Double d = new Double(420000 * Math.random());
Double d = new Double(100 * Math.random());
Integer in = new Integer(d.intValue());
String ds = in.toString();
thread.sleep(Long.parseLong(ds));

//URL Array
ArrayList[] m_URL =
{
new ArrayList(4),
new ArrayList(4),
new ArrayList(4)
};
//System.out.println("length "+m_URL.length);
m_URL[0].add("http");m_URL[0].add("lnmmfs02.launch-now.com");m_URL[0].add(new Integer(8097));m_URL[0].add("/lnie/launchnow");
m_URL[1].add("http");m_URL[1].add("lnmmfs02.launch-now.com");m_URL[1].add(new Integer(8097));m_URL[1].add("/lnie/launchnow/Quickstart/enterQuickstart");
m_URL[2].add("http");m_URL[2].add("lnmmfs02.launch-now.com");m_URL[2].add(new Integer(8097));m_URL[2].add("/lnie/launchnow/CSR/submitCSR");
//new URL("http", "lnmmfs02.launch-now.com", 8070, "/lnie/launchnow/CSR/submitCSR")
//new URL("http://lnmmfs02.launch-now.com:8070/lnie/launchnow"),
//new URL("http://lnmmfs02.launch-now.com:8070/lnie/launchnow/Quickstart/enterQuickstart")
//Parameter Array
String[] m_parameters =
{
"Function=MyHome.jsp&userid=zzwillk&password=a",
"",
"map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:body.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:hea der.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=20010831&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&map: body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:bod y.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:header.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=2001083 1&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&map:body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.addressinfo .address.adrNo=&map:body.csrquery.addressinfo.address.roomInfo=&map:body.csrquery.lsiind=null&map:body.csrquery.addressinfo.address.zipcode=55408&map:body.csrquery.addressinfo.addr ess.adrTh=null&map:body.csrquery.addressinfo.address.adrSds=null&map:body.poheader.pon=LN0000001519&map:body.csrquery.addressinfo.address.bldg=null&map:body.csrquery.addressinfo.ad dress.adrSdp=null&map:body.csrquery.addressinfo.address.floorInfo=&map:body.csrquery.addressinfo.address.route=&map:body.csrquery.addressinfo.address.comm=&map:header.tpCode=QST&ma p:header.capability=UNE-P&map:body.csrquery.servind=T&map:body.csrquery.addressinfo.address.adrDlo=&map:body.csrquery.addressinfo.address.adrPr=&map:body.csrquery.addressinfo.addre ss.cala=null&map:body.csrquery.addressinfo.address.state=MN&map:body.poheader.cc=LN&map:body.csrquery.addressinfo.address.adrSn=&map:body.csrquery.addressinfo.address.adrGa=&map:bo dy.csrquery.addressinfo.address.ahn=&NAV=button&map:body.csrquery.addressinfo.address.adrSf=&map:body.csrquery.addressinfo.address.floor=null&map:body.csrquery.ci=C&map:body.csrque ry.addressinfo.address.city=Minneapolis&Submit=Submit&map:body.csrquery.atn3=2332&map:body.csrquery.atn2=234"
};
//"map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:body.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:h eader.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=20010831&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&ma p:body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:b ody.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:header.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=20010 831&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&map:body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.addressin fo.address.adrNo=&map:body.csrquery.addressinfo.address.roomInfo=&map:body.csrquery.lsiind=null&map:body.csrquery.addressinfo.address.zipcode=55408&map:body.csrquery.addressinfo.ad dress.adrTh=null&map:body.csrquery.addressinfo.address.adrSds=null&map:body.poheader.pon=LN0000001519&map:body.csrquery.addressinfo.address.bldg=null&map:body.csrquery.addressinfo. address.adrSdp=null&map:body.csrquery.addressinfo.address.floorInfo=&map:body.csrquery.addressinfo.address.route=&map:body.csrquery.addressinfo.address.comm=&map:header.tpCode=QST& map:header.capability=UNE-P&map:body.csrquery.servind=T&map:body.csrquery.addressinfo.address.adrDlo=&map:body.csrquery.addressinfo.address.adrPr=&map:body.csrquery.addressinfo.add ress.cala=null&map:body.csrquery.addressinfo.address.state=MN&map:body.poheader.cc=LN&map:body.csrquery.addressinfo.address.adrSn=&map:body.csrquery.addressinfo.address.adrGa=&map: body.csrquery.addressinfo.address.ahn=&NAV=button&map:body.csrquery.addressinfo.address.adrSf=&map:body.csrquery.addressinfo.address.floor=null&map:body.csrquery.ci=C&map:body.csrq uery.addressinfo.address.city=Minneapolis&Submit=Submit&map:body.csrquery.atn3=2332&map:body.csrquery.atn2=234"
//"Function=MyHome.jsp&userid=zzwillk&password=a",
//""
String[] m_requestType =
{
"POST",
"GET",
"POST"
};

//SocketURLSubmitter submitter = null;
//for ( int i=0; i < m_URL.length; i++)
//{
//submitter = new SocketURLSubmitter(m_URL[i], m_parameters[i]);
//SocketURLSubmitter submitter = new SocketURLSubmitter(m_URL, m_parameters);
ListURLSubmitter submitter = new ListURLSubmitter(m_URL, m_parameters, m_requestType);
submitter.submit();
//}
//System.out.println("Exiting Runnable StressTestPreorder!");
//kill the thread
stopRequest();
} //catch (MalformedURLException e)
//{
// System.err.println(e.getMessage());
// stopRequest();
//}
catch (InterruptedException e)
{
System.err.println(e.getMessage());
stopRequest();
}
}
}
 
darren jiang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kyle Willkomm:
Full code that attempt to submit in three manners. Attach to url; on input stream; with cookie.
package com.launchnow.prf;
import java.net.*;
import java.io.*;
import java.util.*;
/*
Subclass hits a URL and implements runnable so as to run in its own thread.
I wanted it to use multiple URLs in succession but because of the current
java methods that was not possible. I left in the functionality in case it
one day is.
*/
public class ListURLSubmitter {
private java.lang.String[] m_parameters = null;
private java.lang.String[] m_requestType = null;
private ArrayList[] m_URLList = null;
private StringBuffer m_response = new StringBuffer();

public static void main(String[] args) {
//in a perfect world this would contain URL submission testing code
}

public ListURLSubmitter(ArrayList[] url,java.lang.String[] parameters, java.lang.String[] type) {
m_URLList = url;
m_parameters = parameters;
m_requestType = type;
}
public void submit() {

try{
String h1 = null;

//variables
HttpURLConnection http = null;
OutputStream buffered = null;
OutputStreamWriter out = null;
Reader reader = null;

for ( int i=0; i < m_URLList.length; i++)
{
System.out.println((String)m_URLList[i].get(0)+" "+(String)m_URLList[i].get(1)+" "+((Integer)m_URLList[i].get(2)).intValue()+" "+(String)m_URLList[i].get(3)+"?JSESSIONID="+h1);
URL temp = new URL((String)m_URLList[i].get(0), (String)m_URLList[i].get(1), ((Integer)m_URLList[i].get(2)).intValue(), (String)m_URLList[i].get(3)+"?JSESSIONID="+h1);
http = (HttpURLConnection)temp.openConnection();
http.setRequestProperty("Accept", "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*");
http.setRequestProperty("Referer", "http://lnmmfs02.launch-now.com:8997/lnie/Login.jsp");
http.setRequestProperty("Accept-Language", "en-us");
http.setRequestProperty("Accept-Encoding", "gzip, deflate");
http.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; ACIE55)");
http.setRequestProperty("Host","lnmmfs02.launch-now.com:8997");
http.setRequestProperty("Connection","Keep-Alive");
if (h1 != null)
{
http.setRequestProperty("Cookie", "JSESSIONID="+h1);
//http.setUseCaches(false);
//http = (HttpURLConnection)temp.openConnection();
Map map = http.getRequestProperties();
System.out.println(map.entrySet());

//
//Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*
//Referer: http://lnmmfs02.launch-now.com:8997/lnie/MyHome_Header.jsp
//Accept-Language: en-us
//Accept-Encoding: gzip, deflate
//User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; ACIE55)
//Host: lnmmfs02.launch-now.com:8997
//Connection: Keep-Alive
//Cookie: JSESSIONID=elwfgxn9v1
//
}

if (m_requestType[i].equals("POST")) {

http.setDoOutput(true);
http.setAllowUserInteraction(true);
buffered = new BufferedOutputStream(http.getOutputStream());
out = new OutputStreamWriter(buffered, "8859_1");
//out = new OutputStreamWriter(buffered);
out.write("JSESSIONID="+h1+"&"+m_parameters[i]+"&JSESSIONID="+h1);
http.connect();
out.flush();
out.close();

} else {
http.setDoOutput(false);
http.connect();
}

//gives the ability to see the html response from the server
reader = new InputStreamReader(new BufferedInputStream(http.getInputStream()));
int c = 0;
while ( (c = reader.read()) != -1 )
{
m_response.append((char) c);
//System.out.println((char) c);
}

if (h1 == null) {
System.out.println();
System.out.println("Parsing headerfields of response");
int g = 0;
System.out.println();
while (http.getHeaderField(g) != null) {
System.out.println(http.getHeaderField(g));
g++;
}
System.out.println();
h1 = http.getHeaderField(3);

StringBuffer s = new StringBuffer(h1);
h1 = s.substring(11, 21);
}

http.disconnect();
reader.close();

//System.out.println("Session ID print "+http.getHeaderField(h1));
}
} catch (IOException e)
{
System.err.println(e.getMessage());
e.printStackTrace();
}
catch (Exception e)
{
System.err.println(e.getMessage());
e.printStackTrace();
}
}
public String getResponse() {
return m_response.toString();
}
}
package com.launchnow.prf.preorder;
import java.util.*;
import java.net.*;
import com.launchnow.prf.*;
/*subclass hits a URL and implements runnable so as to run in its own thread.
I wanted it to use multiple URLs in succession but because of the current
java methods that was not possible. I left in the functionality in case it
one day is.
*/
public class StressTestPreorder implements Runnable {
/*used to track currect running thread id*/
private Thread thread;

/*for gracefully stopping the thread*/
public void stopRequest() {
if (thread != null)
thread.interrupt();
}

/*main sets up arrray of runnable preorder test threads and run them */
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Usage: java StressTestPreorder -number of users to simulate-");
} else
{
//get the number of hits to make from the command line
int hits = Integer.parseInt(args[0]);
System.out.println("Submitting " + hits + " PreOrders!");

//build an array of threads filled with a reference to a form submission runnable
Thread[] threads = new Thread[hits];
StressTestPreorder form;
for (int j = 0; j < threads.length; j++)
{
//give a runnable a thread and start it on its merry way
form = new StressTestPreorder();
Thread thread = new Thread(form, "StressTestPreorder");
threads[j] = thread;
threads[j].start();
}
}
}
/*run demanded by Runnable interface, launching point for thread*/
public void run () {

thread = Thread.currentThread();
try{
//Double d = new Double(420000 * Math.random());
Double d = new Double(100 * Math.random());
Integer in = new Integer(d.intValue());
String ds = in.toString();
thread.sleep(Long.parseLong(ds));

//URL Array
ArrayList[] m_URL =
{
new ArrayList(4),
new ArrayList(4),
new ArrayList(4)
};
//System.out.println("length "+m_URL.length);
m_URL[0].add("http");m_URL[0].add("lnmmfs02.launch-now.com");m_URL[0].add(new Integer(8097));m_URL[0].add("/lnie/launchnow");
m_URL[1].add("http");m_URL[1].add("lnmmfs02.launch-now.com");m_URL[1].add(new Integer(8097));m_URL[1].add("/lnie/launchnow/Quickstart/enterQuickstart");
m_URL[2].add("http");m_URL[2].add("lnmmfs02.launch-now.com");m_URL[2].add(new Integer(8097));m_URL[2].add("/lnie/launchnow/CSR/submitCSR");
//new URL("http", "lnmmfs02.launch-now.com", 8070, "/lnie/launchnow/CSR/submitCSR")
//new URL("http://lnmmfs02.launch-now.com:8070/lnie/launchnow"),
//new URL("http://lnmmfs02.launch-now.com:8070/lnie/launchnow/Quickstart/enterQuickstart")
//Parameter Array
String[] m_parameters =
{
"Function=MyHome.jsp&userid=zzwillk&password=a",
"",
"map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:body.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:hea der.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=20010831&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&map: body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:bod y.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:header.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=2001083 1&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&map:body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.addressinfo .address.adrNo=&map:body.csrquery.addressinfo.address.roomInfo=&map:body.csrquery.lsiind=null&map:body.csrquery.addressinfo.address.zipcode=55408&map:body.csrquery.addressinfo.addr ess.adrTh=null&map:body.csrquery.addressinfo.address.adrSds=null&map:body.poheader.pon=LN0000001519&map:body.csrquery.addressinfo.address.bldg=null&map:body.csrquery.addressinfo.ad dress.adrSdp=null&map:body.csrquery.addressinfo.address.floorInfo=&map:body.csrquery.addressinfo.address.route=&map:body.csrquery.addressinfo.address.comm=&map:header.tpCode=QST&ma p:header.capability=UNE-P&map:body.csrquery.servind=T&map:body.csrquery.addressinfo.address.adrDlo=&map:body.csrquery.addressinfo.address.adrPr=&map:body.csrquery.addressinfo.addre ss.cala=null&map:body.csrquery.addressinfo.address.state=MN&map:body.poheader.cc=LN&map:body.csrquery.addressinfo.address.adrSn=&map:body.csrquery.addressinfo.address.adrGa=&map:bo dy.csrquery.addressinfo.address.ahn=&NAV=button&map:body.csrquery.addressinfo.address.adrSf=&map:body.csrquery.addressinfo.address.floor=null&map:body.csrquery.ci=C&map:body.csrque ry.addressinfo.address.city=Minneapolis&Submit=Submit&map:body.csrquery.atn3=2332&map:body.csrquery.atn2=234"
};
//"map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:body.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:h eader.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=20010831&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&ma p:body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.ecckt=&map:body.csrquery.atn1=234&map:body.csrquery.addressinfo.address.bsite=&map:b ody.poheader.tos=2B--&map:body.csrquery.addressinfo.address.bldgInfo=&map:header.mrktCd=MN&map:body.csrquery.addressinfo.address.room=null&map:body.poheader.ccna=314&authdate=20010 831&map:body.csrquery.refnum=&map:body.csrquery.addressinfo.address.box=&map:body.csrquery.name=qw&map:body.csrquery.cuscode=&map:body.csrquery.agauth=Y&map:body.csrquery.addressin fo.address.adrNo=&map:body.csrquery.addressinfo.address.roomInfo=&map:body.csrquery.lsiind=null&map:body.csrquery.addressinfo.address.zipcode=55408&map:body.csrquery.addressinfo.ad dress.adrTh=null&map:body.csrquery.addressinfo.address.adrSds=null&map:body.poheader.pon=LN0000001519&map:body.csrquery.addressinfo.address.bldg=null&map:body.csrquery.addressinfo. address.adrSdp=null&map:body.csrquery.addressinfo.address.floorInfo=&map:body.csrquery.addressinfo.address.route=&map:body.csrquery.addressinfo.address.comm=&map:header.tpCode=QST& map:header.capability=UNE-P&map:body.csrquery.servind=T&map:body.csrquery.addressinfo.address.adrDlo=&map:body.csrquery.addressinfo.address.adrPr=&map:body.csrquery.addressinfo.add ress.cala=null&map:body.csrquery.addressinfo.address.state=MN&map:body.poheader.cc=LN&map:body.csrquery.addressinfo.address.adrSn=&map:body.csrquery.addressinfo.address.adrGa=&map: body.csrquery.addressinfo.address.ahn=&NAV=button&map:body.csrquery.addressinfo.address.adrSf=&map:body.csrquery.addressinfo.address.floor=null&map:body.csrquery.ci=C&map:body.csrq uery.addressinfo.address.city=Minneapolis&Submit=Submit&map:body.csrquery.atn3=2332&map:body.csrquery.atn2=234"
//"Function=MyHome.jsp&userid=zzwillk&password=a",
//""
String[] m_requestType =
{
"POST",
"GET",
"POST"
};

//SocketURLSubmitter submitter = null;
//for ( int i=0; i < m_URL.length; i++)
//{
//submitter = new SocketURLSubmitter(m_URL[i], m_parameters[i]);
//SocketURLSubmitter submitter = new SocketURLSubmitter(m_URL, m_parameters);
ListURLSubmitter submitter = new ListURLSubmitter(m_URL, m_parameters, m_requestType);
submitter.submit();
//}
//System.out.println("Exiting Runnable StressTestPreorder!");
//kill the thread
stopRequest();
} //catch (MalformedURLException e)
//{
// System.err.println(e.getMessage());
// stopRequest();
//}
catch (InterruptedException e)
{
System.err.println(e.getMessage());
stopRequest();
}
}
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!