File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi.I need help

 
Lakshmi siri
Ranch Hand
Posts: 44
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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: 17276
6
IntelliJ IDE Mac Spring
  • 0
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic