• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

applet in webserver

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai friends,
iam using javawebserver 2.0.i want to add an applet .class file in the webserver in order to access a servlet.
as given in the book i added the .class file in the public_html directory of jws.when i give the address in the browser iam getting 'class: not found error. why is this so?
anybody help me? please.your answer makes a lot in my project.
reply me as soon as possible.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
it's great that u r doing a project
if u show me your code, i can tell u or discuss the problem with u.
The problem should be in init method.
so make your collars tight for the project.
and don't get disappointed.
 
a kumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dear patil
thanks for your response and here is the code of the applet that you have asked.
import java.net.*;
import java.applet.*;
import java.awt.*;
import java.io.*;
public class MesApplet extends Applet {
TextArea responseField;
public void init() {
responseField = new TextArea();
}
public void start() {
try {
URL url = new URL("http://192.168.1.3/servlets/DisplayServlet");
URLConnection con=url.openConnection();
con.setUseCaches(false);
con.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
InputStream in = con.getInputStream();
StringBuffer response = new StringBuffer();
int chr;
while ( ( chr = in.read() )!=-1)
response.append( (char) chr);
in.close();
responseField.setText(response.toString() );
} catch(Exception e) {
responseField.setText(e.toString() );
}
}
}

another problem is that the webserver is not started if i give httpd in win'2000.
 
reply
    Bookmark Topic Watch Topic
  • New Topic