aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes   show user credentials in target jsp  which all are from swing form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "  show user credentials in target jsp  which all are from swing form" Watch "  show user credentials in target jsp  which all are from swing form" New topic
Author

show user credentials in target jsp which all are from swing form

siva perumal
Greenhorn

Joined: Jun 19, 2009
Posts: 1
Hi

I have to open target jsp in iexploere along with user credentials which are from swing application by clicking submit in swing .

I need to show the user credentials in my target jsp Which user credentials are coming from swing login form .


I have used java.net URL to send the HTTP request to my target jsp from my swing window . this swing window has user name , password fields , Actually HTTP request are sending fine i am able to print those user name in my target jsp . but i unable to open target jsp in internet explorer along with user name .


here my code for ref:

String data = URLEncoder.encode("username", "UTF-8") + "=" + URLEncoder.encode("hi", "UTF-8");
data += "&" + URLEncoder.encode("password", "UTF-8") + "=" + URLEncoder.encode("hru", "UTF-8");

// Send data

URL url = new URL("http://12.14.12.1:1212/Applicffation1-ViewCofffntroller-context-root/targetjsp.jsp");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();

// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {

}

rt.exec("C:/Program Files/Internet Explorer/IEXPLORE.EXE http://12.14.12.1:1212/Applicffation1-ViewCofffntroller-context-root/targetjsp.jsp");

wr.close();
rd.close();


thanks in advance
siva
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: show user credentials in target jsp which all are from swing form
 
Similar Threads
Help with (Http)URLConnection!
HTTPS Post Request through the URL
error while submitting an http web request
post request to url
Communicate with the server without a browser.