Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applet to Servlet

Status
Not open for further replies.

mithra

Programmer
May 26, 2000
21
0
0
IN
Hi ..
I would like to call a servlet from an applet .
My Applet will prompt for a username and password (lets say) and when I click submit button , I need to transfer the control to the servlet .
How can I do that ? I need servlet output has to be displayed on teh same screen .
Any one knows about this please help me .
My Applet code is like this ...

public void submit() {
String location = "../servlet/SnoopServlet1";
try {
URL url = new URL(location);
URLConnection con = url.openConnection();
}catch (MalformedURLException mue){
System.err.println(mue.getMessage());
}catch (IOException e) {
System.err.println(e.getMessage());
}catch(Exception e) {
System.out.println("Cannot open connection);
}


But this is not working for me .

Thanks and Regards
 
Take a look at java.applet.Applet.getAppletContext().showDocument(…)

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top