Applets with Servlet or jsp
Can you call a servlet or jsp from within a applet? Or should one just connect back to the server using a Socket connection. Thanks Alexis Bose === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: Applets with Servlet or jsp
The only possible way that I see is the same way one would call a servlet/jsp from within an applett using the http (hyper text transfer protocol). There are tons of programs which to similiar things (such as Tik , a TCL script which querries different news sites to gather news headers). This way I dont think that servlet/jsp are the only ones you could use. Any CGI would serve this purpose. Now if security of others accessing your servlet/jsp is important I would also setup that your applet sends in the get http header some unique name that would identify it from all the rest (netscape / ie/ mosaic/ lynx/ kfm/mozzila/opera... and others) I remember seeing one applet use a Netscape Server on NT connecting to CGI that was an .exe file. It was some applet based store system, that used cgi to connect to DB (back when RMI didnt exist). Hopefully this is what you seek for... -Original Message- From: CN User [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 10, 1999 17:01 To: [EMAIL PROTECTED] Subject: Applets with Servlet or jsp Can you call a servlet or jsp from within a applet? Or should one just connect back to the server using a Socket connection. Thanks Alexis Bose == = To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: Applets with Servlet or jsp
A code fragment that might help you is below: (where applet parameter icodeURL is something like http://yourserver/servlet/servletname and you import java.net and java.io) boolean getInformixAC() { URL icodeURL = null; times=1; Notes.setText("" ); if(skip == 0) { URLiname = getParameter("icodeURL"); if (URLiname == null) URLiname = "http://mcars007:80/cgi-bin/echo1.cgi"; icodeStr = new String( URLiname ); Parse_pro_bcs(); } skip++; try { sel_stmt = icodeStr + "skip=" + skip; icodeURL = new URL(sel_stmt); } catch( MalformedURLException e) { setBackground(Color.green); return false; } String irbuf; String URLiname; try { InputStream iistream = icodeURL.openStream(); DataInputStream idstream = new DataInputStream(new BufferedInputStream(iistream)); while((irbuf = idstream.readLine()) != null) { try { parseData(irbuf); } catch( Exception e) { setBackground(Color.red); return false; } } } catch(IOException e) { setBackground(Color.blue); return false; } return true; } -Original Message- From: CN User [SMTP:[EMAIL PROTECTED]] Sent: Thursday, June 10, 1999 2:01 PM To: [EMAIL PROTECTED] Subject: Applets with Servlet or jsp Can you call a servlet or jsp from within a applet? Or should one just connect back to the server using a Socket connection. Thanks Alexis Bose == = To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
Re: Applets with Servlet or jsp
Elliot Rusty Harold has a fabulous book on Java network programming. I shows examples of how to do this. You can do something like applet.getAppletContext.showDocument(url) to replace the current page with something else. If you want the current page to remain, but go get info from the server and display it within your applet, you have 2 options. 1. Use sockets (java.net.socket). 2. Use java.net.HttpURLConnection. Ed Livin' La Vida Loca -Original Message- From: Adam [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 10, 1999 05:30 PM To: [EMAIL PROTECTED] Subject: Re: Applets with Servlet or jsp The only possible way that I see is the same way one would call a servlet/jsp from within an applett using the http (hyper text transfer protocol). There are tons of programs which to similiar things (such as Tik , a TCL script which querries different news sites to gather news headers). This way I dont think that servlet/jsp are the only ones you could use. Any CGI would serve this purpose. Now if security of others accessing your servlet/jsp is important I would also setup that your applet sends in the get http header some unique name that would identify it from all the rest (netscape / ie/ mosaic/ lynx/ kfm/mozzila/opera... and others) I remember seeing one applet use a Netscape Server on NT connecting to CGI that was an .exe file. It was some applet based store system, that used cgi to connect to DB (back when RMI didnt exist). Hopefully this is what you seek for... -Original Message- From: CN User [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 10, 1999 17:01 To: [EMAIL PROTECTED] Subject: Applets with Servlet or jsp Can you call a servlet or jsp from within a applet? Or should one just connect back to the server using a Socket connection. Thanks Alexis Bose == = To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". == = To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JSP-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".