Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Hi.I need help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply 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: 17243
    
    1

"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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Hi.I need help
 
Similar Threads
servlets
Servlet delivery in Tomcat
Applet-servlet communication
How to test my servlet
Servlet connection with Jdbc