0

Hi,

I have deployed my folder called Library in web apps tomcat5.5, i can find my folder in the tomcat manager, but when i click its showing this error: requested source in not available (Library)
As i am new to this i dont know how to proceed please help me out.


i given my code below.
in folder library
i have created 2 more folder WEB-INF and html file
In WEB-INF- src,classes,web.xml

so in html file the fallowing code is written
<html>
<head><title>Login Page</title></head>
<body>
<form method=get action="/servlets/login">
<table>
 <tr>
  <td>Name: </td>
  <td><input type="text" Name="name"></td>
</tr>
 <tr>
 <td>Password:</td>
 <td><input type="password" Name="password"></td>
 </tr>
 <tr>
 <td><input type ="submit" value="submit"></td>
 <td>&nbsp;</td>
 </tr>
 </table>
 </body>
 </html>

in src file the following code is written

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class valid extends httpservlet
{
   public void doGet(HttpServletRequest res, HttpservletResponse res)throws IOException, ServletException
	{
	   res.setcontent type("text/html");
	   PrintWriter out = res.getWriter();
	   String name = req.getParameter("name");
	   String password = req.getParameter("password");
	   out.println("<html>");
	   out.println("<head>");
	   out.println("<title> login page </title>");
	   out.println("<body>");
	   out.println("Name "+ name);
	   out.println("<br>");
	   out.println("your password is " + password );
	   out.println("</body>");
	   out.println("</html>");
	   out.close();
	} //end of service

} //end of class

in web.xml the fallowing code is written

<web-app>
<servlet>
<servlet-name>firstservlet</servlet-name>
<servlet-class>valid</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>firstservlet</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
</web-app>
2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by stephen84s
0

That happens because when you click on your web application directly from tomcat, it goes to the ROOT of your web application and unless you have a set a welcome page in your web.xml ( or enabled directory listing) you are bound to get that error.

So to actually display your html page in your browser you would have to type "http://localhost:8080/<webappfolder>/<htmlpage>"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.