I have a problem and hope someone can assist me so here goes.
I have a website that requires a form login (JSP using POST METHOD). I will like to use JAVA code to actually log in and navigate to a particular page in the website.
I have previously tried apache's common lib -> HttpClient but it was unsuccessful. I am not sure if it is due to my coding errors or not but I could not get it to navigate to the page I want.
When i tried logging in using HttpClient, i printed out the status and it was "200" which means it is OK and i also managed to get the cookie. But when i requested to be redirected to the page i want, it did not go to it because I did a printout of the html coding of that page and it printed out the log in page html coding so it seems i am still stuck at the log in page.
The main task I want to do is very simple, go to a particular page in that website that is password-protected by a JSP form login.
If it is of any help, the website i am trying to log on to is a webserver's console page - TOMCAT. (Http://localhost:8080)
Any help will be much appreciated as this is pretty important to me. Thank you guys in advance.
Question
donchen
Hi guys,
I have a problem and hope someone can assist me so here goes.
I have a website that requires a form login (JSP using POST METHOD). I will like to use JAVA code to actually log in and navigate to a particular page in the website.
I have previously tried apache's common lib -> HttpClient but it was unsuccessful. I am not sure if it is due to my coding errors or not but I could not get it to navigate to the page I want.
When i tried logging in using HttpClient, i printed out the status and it was "200" which means it is OK and i also managed to get the cookie. But when i requested to be redirected to the page i want, it did not go to it because I did a printout of the html coding of that page and it printed out the log in page html coding so it seems i am still stuck at the log in page.
The main task I want to do is very simple, go to a particular page in that website that is password-protected by a JSP form login.
If it is of any help, the website i am trying to log on to is a webserver's console page - TOMCAT. (Http://localhost:8080)
Any help will be much appreciated as this is pretty important to me. Thank you guys in advance.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts