|
-
April 29th, 2000, 01:38 AM
#2
Re: Applet Servlet Communication
hai Monica,
place all ur applet related files inside ur publichtml dir inside ur web server and servlet related files inside ur servlets directory and register the servlet inside the web server. the registrasion depends on the server u use.
Then direcly call the applet from the browser using the ip and the applet name
eg: http://localhost:8080/sample.html
which ill refer to the applet in the publichtml dir and the applet ill call the servlet in the servlet directory as need the code u need to include in the applet is as given below :
URL url = new URL(getCodeBase(),"/servlet/SampleServlet");
HttpMessage msg = new HttpMessage(url);
InputStream in = msg.sendGetMessage();
DataInputStream result = new DataInputStream(new BufferedInputStream(in));
String date = result.readLine();
hope u got it.
If u wanted further det. mail me at: [email protected]
bye
bharath
S.V Bharath Reddy
Software Engineer,
Hyderabad.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|