Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing classes save in shared/classes

 
pratibha khamkar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am write the class in ..../appl1/classes
public class Ser1 extends HttpServlet
{
public void doGet(HttpServletRequest rq, HttpServletResponse rs) throws ServletException, IOException
{
rs.setContentType("text.html");
PrintWriter out = rs.getWriter();
out.println("<html><body>"+
"<form method= \"POST\" ACTION= \"Shr\">"+
"<input type = submit value = \"Ok\">"+
"</form>"+
"</body></html>");
}

}

and

the Shr.class is in shared/classes


Error is
HTTP Status 404 - /appl1/Shr

type Status report

message /appl1/Shr

description The requested resource (/appl1/Shr) is not available.
Apache Tomcat/4.1.31
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your post, I can't tell where you've actually put your class file.
Classes belong in the WEB-INF/clases directory.

tomcat/webapps/your_app/WEB-INF/classes/your_package/your_class

Also post the parts of your web.xml file that hold the servlet entry and the servlet mapping for this servlet as well as the URL you're using when trying to hit it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic