Women in Technology

Hear us Roar



Article:
  Deploying Web Applications to Tomcat
Subject:   problem with accessing servlets in subfolders
Date:   2003-05-25 21:06:41
From:   anonymous2
hi,
i am not able to access servlet classes within the sub folders..


ie /tomcat/webapps/examples/WEB-INF/classes/cal


i can access all the files present in classes but not in it's sub directories.


and i have one more problem, i have to give the following in URL in order to execute a servlet


http://localhost:8888/examples/servlet/CookieExample


and this does not work if i don't give servlet in the URL.


it would be of great help if someone could give me the details of how to access subfolder or about the context path settings.


thanking u in advance

Full Threads Newest First

Showing messages 1 through 5 of 5.

  • problem with accessing servlets in subfolders
    2003-05-26 02:33:42  anonymous2 [View]

    Do you have your directory structure under classes declared as a package in your java class?

    In your example, you should have the classes under cal being devlared as a package called cal.

    I hope this helps. Good luck.
    • problem with accessing servlets in subfolders
      2003-05-26 03:38:32  anonymous2 [View]

      hi,

      thank u for the reply.

      yes, the package is declared in the java program. even then i am not able to run the built in examples of tomcat and in all the examples, packages has been declared.

      is there anything to do with web.xml where u have to add <servlet-mapping>.

      thanking u

      santy (santosh_b_p@yahoo.com)
  • problem with accessing servlets in subfolders
    2003-11-23 11:51:13  anonymous2 [View]

    Take a look at my comment...it seems I am not the only one with problems. You have to reference the servlet with

    "/web-app-dir/servlet/servletname"

    rather than "/servlet/servletname"

    Otherwise Tomcat won't look in your /classes subfolder.

    -Chris (coldfusion78_AT_yahoo.com)
    • problem with accessing servlets in subfolders
      2005-03-04 23:34:27  BajuRam [View]

      hi Chris,
      thanx for your response.
      I did the things you have suggested, but its not working. The server is'nt responding for the classes present in the subfolders of the default directory for classes.

      The default URL for Tomcat would be like this http://localhost:8080/examples/servlet/home for the home.class file present in c:\Program Files\Apache Tomcat 4.0\webapps\examples\web-inf\classes\. I want to access the classfile present in c:\Program Files\Apache Tomcat 4.0\webapps\examples\web-inf\classes\home\a\a1\a11 through the URL http://localhost:8080/examples/servlet/home/a/a1/a11.
      Thank u Chris for all the concern.
      bye n take care.
    • how to set a path in servlets
      2008-06-04 19:40:34  vineela1289 [View]

      please tell me how to set a path .