Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2007, 03:06 AM
Authorized User
 
Join Date: Jun 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default plse help me out??????

I am using :::
jdk 1.5
tomcat 5.0.28
.........................................
my servlet program:::::
...................

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("Hello World");
}
}

.................................................. .

save it in::::
d:\java program\Helloworld.java
........................................

at command prompt i typed::::
D:\java program>javac Helloworld.java
I got the error::::
..............................................

class Helloworld is public, should be delared in a file named Helloworld.java
.................................

what should i do now????

help me out???



 
Old September 12th, 2007, 11:16 PM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

Check your file name there might be a spelling mistake, it should be save with same name as your public class "Helloworld.java"


- Rakesh
 
Old September 20th, 2007, 09:22 PM
Authorized User
 
Join Date: Oct 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mrafaqi Send a message via Yahoo to mrafaqi
Default

Hi ! I can see here that there is a difference in your class name and the path you provided to save file ('w' is not capitalized'). So if it is really so, just change it. Hopefully, it will work.

ALI_R









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.