• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

new to servlets, need help !

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
i am new to Servlets and i have made a very simple servlet as follows :

import java.io.*;
import javax.servlet.*;
class serv extends GenericServlet
{
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<B> this is servlet speaking </B>");
pw.close();
}
}
After compiling the above code as given in a book i saved the
'class file' in 'c:\jsdk2.0\examples' and started the 'servletrunner' but when i try to access it through InternetExplorer, i get the message 'page not found'. On the DOS prompt also, where the 'servletrunner' is running, i get message that the servlet could not be found.If it is related to properties file, kindly explain.
plzzzzzzzzz help !!!
 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey
i am replying but me never used servletrunner still you can try
if you have stored your class file TrialServlet.class in any directory let us assume c:\abcd\efgh then you have to start the servlet runner by entering
servletrunner -d c:\abcd\efgh
and then in the browser give the url
http://localhost:8080/servlet/TrialServlet


------------------
IBM Certified WebSphere Application Server V3.5 Specialist
 
Are you here to take over the surface world? Because this tiny ad will stop you!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic