943,553 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 619
  • JSP RSS
Sep 2nd, 2009
0

ERRor:Requested Source not available

Expand Post »
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
html Syntax (Toggle Plain Text)
  1.  
  2. so in html file the fallowing code is written
  3. <html>
  4. <head><title>Login Page</title></head>
  5. <body>
  6. <form method=get action="/servlets/login">
  7. <table>
  8. <tr>
  9. <td>Name: </td>
  10. <td><input type="text" Name="name"></td>
  11. </tr>
  12. <tr>
  13. <td>Password:</td>
  14. <td><input type="password" Name="password"></td>
  15. </tr>
  16. <tr>
  17. <td><input type ="submit" value="submit"></td>
  18. <td>&nbsp;</td>
  19. </tr>
  20. </table>
  21. </body>
  22. </html>
in src file the following code is written
java Syntax (Toggle Plain Text)
  1. import java.io.*;
  2. import javax.servlet.*;
  3. import javax.servlet.http.*;
  4. public class valid extends httpservlet
  5. {
  6. public void doGet(HttpServletRequest res, HttpservletResponse res)throws IOException, ServletException
  7. {
  8. res.setcontent type("text/html");
  9. PrintWriter out = res.getWriter();
  10. String name = req.getParameter("name");
  11. String password = req.getParameter("password");
  12. out.println("<html>");
  13. out.println("<head>");
  14. out.println("<title> login page </title>");
  15. out.println("<body>");
  16. out.println("Name "+ name);
  17. out.println("<br>");
  18. out.println("your password is " + password );
  19. out.println("</body>");
  20. out.println("</html>");
  21. out.close();
  22. } //end of service
  23.  
  24. } //end of class
in web.xml the fallowing code is written
xml Syntax (Toggle Plain Text)
  1. <web-app>
  2. <servlet>
  3. <servlet-name>firstservlet</servlet-name>
  4. <servlet-class>valid</servlet-class>
  5. </servlet>
  6. <servlet-mapping>
  7. <servlet-name>firstservlet</servlet-name>
  8. <url-pattern>/login</url-pattern>
  9. </servlet-mapping>
  10. </web-app>
Similar Threads
Reputation Points: 7
Solved Threads: 0
Junior Poster
ishlux is offline Offline
145 posts
since Jun 2008
Sep 2nd, 2009
0

Re: ERRor:Requested Source not available

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>"
Featured Poster
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
stephen84s is offline Offline
1,316 posts
since Jul 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JSP Forum Timeline: Xml validation disabled
Next Thread in JSP Forum Timeline: xml mapping in tomcat 5.5





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC