wood burning stoves 2.0*
The moose likes Servlets and the fly likes Hi.I need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Hi.I need help" Watch "Hi.I need help" New topic
Author

Hi.I need help

Lakshmi siri
Ranch Hand

Joined: Feb 06, 2004
Posts: 44
Hi,iam new to servlets.Iam practicing servlets in websphere.To run the following program, iam using
url = http://localhost:8080/servlet/hello
to run the program.
While running this program through url, iam getting a dialogbox "connect to localhost"
which has username and password.
I didn't understand.
Iam not getting output of the program.
How i get the output.
program:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Hello extends HttpServlet
{
public void doget(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
PrintWriter out=null;
res.setContentType("text/html");
out=res.getWriter();
out.println("<html>");
out.println("<head><title>Sample</title></head>");
out.println("<body>");
out.println("<BIG>Hello World</BIG>");
out.println("</body>");
out.println("</html>");
}
}

Thanks for your help
--Lakshmi
Sadanand Murthy
Ranch Hand

Joined: Nov 26, 2003
Posts: 382
Do you have web.xml? If so, does it have login-config element & security-role elements defined in it?


Ever Existing, Ever Conscious, Ever-new Bliss
Lakshmi siri
Ranch Hand

Joined: Feb 06, 2004
Posts: 44
Hi,
Thanks for your response.Web.xml doesn't have userID & Password.
--Lakshmi
Mehmet Tahir DEDE
Greenhorn

Joined: Feb 15, 2004
Posts: 2
I advice you to use an other server. Tomcat is nice!...


Mehmet,
Micheal Lau
Greenhorn

Joined: Feb 02, 2004
Posts: 25
Yes, for new comer, I think Tomcat is better


SCJP, SCWCD, SCBCD
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

"Lakshmi"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it
here.
Thanks! and welcome to the JavaRanch!
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hi.I need help