Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hi.I need help  RSS feed

 
Lakshmi siri
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 382
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have web.xml? If so, does it have login-config element & security-role elements defined in it?
 
Lakshmi siri
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your response.Web.xml doesn't have userID & Password.
--Lakshmi
 
Mehmet Tahir DEDE
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I advice you to use an other server. Tomcat is nice!...
 
Micheal Lau
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, for new comer, I think Tomcat is better
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!