Click here to Skip to main content
15,888,984 members
Home / Discussions / Java
   

Java

 
AnswerRe: project Pin
Richard Andrew x6419-Feb-15 12:25
professionalRichard Andrew x6419-Feb-15 12:25 
AnswerRe: project Pin
Afzaal Ahmad Zeeshan22-Feb-15 6:55
professionalAfzaal Ahmad Zeeshan22-Feb-15 6:55 
Questionwhy calculation(BMI) is not working.... please help me... Pin
Member 1141203417-Feb-15 9:41
Member 1141203417-Feb-15 9:41 
GeneralRe: why calculation(BMI) is not working.... please help me... Pin
harold aptroot17-Feb-15 10:41
harold aptroot17-Feb-15 10:41 
Questionjava Pin
Member 1145378615-Feb-15 5:48
Member 1145378615-Feb-15 5:48 
AnswerRe: java Pin
Richard MacCutchan15-Feb-15 6:11
mveRichard MacCutchan15-Feb-15 6:11 
AnswerRe: java Pin
Richard Andrew x6419-Feb-15 12:26
professionalRichard Andrew x6419-Feb-15 12:26 
Question[SendingMultipartDataPostRequest] Issues with Sending a Post Request with Multi-part form data Pin
B.Sudhir14-Feb-15 12:27
B.Sudhir14-Feb-15 12:27 
Hello...

In my project work I was supposed to automatically login and create a ticket to a support system. here are the steps I planned to follow

1. Get HTML content of login page by using Get method with HttpsURLConnection.
2. Parse HTML content using jSoup library and extract form input elements.
3. Get the names of the attributes of the form and prepare a parameter list with custom data (like user name, Password) and remaining application generated parameters.
4. Now Send a post request to Login page url with the parameter list ( which also will have other paremeters which are not supposed to be changed).
5. After post request successful I receive the HTML content of page which occurs after login via BufferedReader with InputStream Object of HttpsURLConnection.
6. Now I will send a "GET" request to the page which has a Ticket opening form and receive HTML content of the page.
7. Parse HTML content using jSoup library and extract form input elements.
8. Get the names of the attributes and preapare a parameter list (which will have the details of ticket which needs to be updated and submitted to webservice to complete ticket creation) this should be a multipart form data ( I set headers accordingly).
9. Then post it to the ticket creation web service.
10. Process will complete If a ticket gets created.

Currently

I am able to successfully login to the website, get the parameters and set all the attributes and formdata. but I'm stuck with few errors. Currently I'm getting InvalidStateException : Already Connected error.

I am running the code on IntelliJ IDEA 14 Community Edition. Can anyone please help me with this error. and also it would be great if you can correct me if I'm going in wrong direction to get what I'm trying to do here.

Lines - 448 through 453 of the file.
Here is the code.

CompleteProgram.java
Thanks,
Sudhir.

Questionwhy java is called as architectural neutral? Pin
Member 1144945112-Feb-15 22:31
Member 1144945112-Feb-15 22:31 
AnswerRe: why java is called as architectural neutral? Pin
Richard MacCutchan12-Feb-15 22:36
mveRichard MacCutchan12-Feb-15 22:36 
Questionjava netbeans Pin
Member 1144139511-Feb-15 3:23
Member 1144139511-Feb-15 3:23 
QuestionRe: java netbeans Pin
Richard MacCutchan11-Feb-15 21:44
mveRichard MacCutchan11-Feb-15 21:44 
AnswerRe: webbase chat program Pin
Member 1144139512-Feb-15 0:54
Member 1144139512-Feb-15 0:54 
GeneralRe: webbase chat program Pin
Richard MacCutchan12-Feb-15 1:02
mveRichard MacCutchan12-Feb-15 1:02 
AnswerRe: java netbeans Pin
Member 1144139513-Feb-15 4:15
Member 1144139513-Feb-15 4:15 
GeneralRe: java netbeans Pin
Richard MacCutchan13-Feb-15 4:55
mveRichard MacCutchan13-Feb-15 4:55 
QuestionSelenium WebDriver Pin
Member 114387579-Feb-15 1:55
Member 114387579-Feb-15 1:55 
QuestionRe: Selenium WebDriver Pin
Richard MacCutchan9-Feb-15 2:48
mveRichard MacCutchan9-Feb-15 2:48 
QuestionNullPointerException in java Pin
Member 114349697-Feb-15 6:03
Member 114349697-Feb-15 6:03 
AnswerRe: NullPointerException in java Pin
Richard MacCutchan7-Feb-15 22:11
mveRichard MacCutchan7-Feb-15 22:11 
SuggestionRE: JAVA Pin
Sri01106-Feb-15 2:10
Sri01106-Feb-15 2:10 
GeneralRe: RE: JAVA Pin
Richard MacCutchan6-Feb-15 3:00
mveRichard MacCutchan6-Feb-15 3:00 
GeneralRe: RE: JAVA Pin
Akash gods7-Feb-15 5:45
professionalAkash gods7-Feb-15 5:45 
QuestionTime Pin
Member 114289684-Feb-15 21:45
Member 114289684-Feb-15 21:45 
AnswerRe: Time Pin
Afzaal Ahmad Zeeshan5-Feb-15 0:20
professionalAfzaal Ahmad Zeeshan5-Feb-15 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.