Hi Weigen,
Servlet engines generally look for class files according to standard java
package naming conventions, except that usually $SERVER_ROOT/servlets and
$SERVER_ROOT/classes are special distinguished directories. So if you want
to have your UserServlet in directory Admin, you should put it into package
Admin and then call it as /servlet/Admin.UserServlet (not /servlets/...).
Also, since the convention is to name packages using lowercase letters, it
would be admin rather than Admin.
There is a good article which explains classpath issues at
http://www.meangene.com/java/classpath.html
<http://www.meangene.com/java/classpath.html>
Petr
----------
From: Weigen Jin [SMTP:[EMAIL PROTECTED]]
Sent: Monday, 22 March, 1999 10:09 PM
To: [EMAIL PROTECTED]
Subject: how can I redirect to servlets located in sub-directories
?
Hello,
I am using Apache1.3.4 / Apache Jserv 1.0b1.
I have problem to use links to redirect from one servlet to
another
servlet which is located in sub-directory, for examples
My first servlet (DefaultServlet) is under directory
htdocs/servlets/
In DefaultServlet I provide a link to a servlet called
UserServlet
which connects to database and list all users. as follows
.......
out.println("<td bgcolor=\"#003868\"
valign=\"top\"><p
align=\"center\">" +
"<a href=\"" +
response.encodeUrl("/servlets/Admin/UserServlet") +
"\">" +
"<img src=\"/images/app.gif\" border = \"0\"
width=\"79\" height=\"53\" " +
"alt=\"/images/user.gif\"></a></p>" );
........
If I put the UserServlet and DefaultServlet in the same
directory(
htdocs/servlets), the link works.
However, if I put UserServlet under a subdirectory
htdocs/servlets/Admin, I got this message.
Not Found
The requested URL /servlets/Admin was not found on
this
server.
Apache/1.3.4 Server at weigen Port 80
Please somebody explain to me what is wrong. Are there some
specific
configurations in zone, jserv and servlet.properties I missed ?
Thanks !
Weigen
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
of the message "signoff SERVLET-INTEREST".
Archives:
http://archives.java.sun.com/archives/servlet-interest.html
Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html