You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vinay Nath <vi...@hotmail.com> on 2000/07/31 22:59:32 UTC

a problem getting correct codebase from applet using tomcat

hi all,

when i call getcodebase() method from my applet running on tomcat server i
dont get the correct url.

i have my applet .class in myapp directory under webapps directory.
when i access the applet through
http://127.0.0.1:8080/myapp/applet.html
then instead of getting codebase as http://127.0.0.1:8080/myapp/
i get http://127.0.0.1:8080//myapp/

wht could be wrong.Is this a bug in tomcat.

waiting for reply...

thanks in advance...

Vinay Nath
----- Original Message -----
From: Peder Pedersen <pe...@caput.dk>
To: <to...@jakarta.apache.org>
Sent: Monday, July 31, 2000 9:35 PM
Subject: Apache and Front Servlets


Hi,

I'm migrating a web application from a tomcat set-up to a apache-tomcat
set-up (for the first time!).
The new apache set-up works fine for the standard "examples" web
application.
I have, however, a problem with my own web application that I figure is
because I use a front servlet. So assume my web application is called
"myapp", and the front servlet is bound to "fs". In web.xml we have:

    <servlet>
        <servlet-name>front</servlet-name>
        <servlet-class>com.blablabla.FrontServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>front</servlet-name>
        <url-pattern>/fs/*</url-pattern>
    </servlet-mapping>

One of many tasks for the front servlet is to forward control to a jsp
page of the request url placed in a certain folder ("certainFolder"):
     "myhost/myapp/fs/page.jsp" -> front servlet ->
"myhost/myapp/certainFolder/page.jsp"
This works perfectly for a stand-alone tomcat-setup. But in the
apache-tomcat setup I get an error message:

"Not Found. The requested URL /myapp/fs/page.jsp was not found on this
server."

Now, if I make a dummy folder called "fs" in "myapp" with a dummy file
called "page.jsp" then I get no error and the proper page is shown via
the front servlet (that is, not the dummy one). This leads me to believe
that my tomcat.config included by apache is wrong. If anybody can spot
what I'm missing in the mapping below, you will make me a happy man
again:

Alias /myapp /opt/tomcat/webapps/myapp
<Directory "/opt/tomcat/webapps/myapp">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /myapp/servlet /myapp
<Location /myapp/WEB-INF/ >
    AllowOverride None
    deny from all
</Location>

Thanks in advance,
Peder

Btw: I use Tomcat 3.1 final.