tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Robbins" <drobb...@drobbins.net>
Subject Re: relative path/context problem
Date Wed, 11 Sep 2002 17:05:36 GMT
I have 1 servlet name EntryBean in a package called phonebook
should web.xml have entries for jsp pages?
here's the whole file

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
  <servlet>
    <servlet-name>EntryBean</servlet-name>
    <servlet-class>phonebook.EntryBean</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>EntryBean</servlet-name>
    <url-pattern>/servlet/phonebook.EntryBean</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>
            30
        </session-timeout>
  </session-config>
  <welcome-file-list>
    <welcome-file>
            index.jsp
        </welcome-file>
    <welcome-file>
            index.html
        </welcome-file>
    <welcome-file>
            index.htm
        </welcome-file>
  </welcome-file-list>
</web-app>



> What servlet mapping(s) do you have setup in web.xml?
> 
> Dave Robbins wrote:
>> Hello All,
>> 
>> I'm seeing some really odd behaviour, I hope someone can tell me what
>> i'm  doing wrong. I've written some jsp/servlet code with Forte 4.0,
>> created a  war file and deployed it on Tomcat 4.0.4. ( I deployed it
>> by putting the  war file in the webapps dir and restarting Tomcat) The
>> war file was  my_stuff.war so the url is 
>> 
>> http://localhost:8080/my_stuff/index.jsp
>> 
>> That works fine. As I started developing a little code I got to a
>> point I  wanted a link back to the entry of the site, I thought
>> 
>> <a href="/index.jsp">Back to Top</a>
>> 
>> would do the job. But this link pointed to
>>   
>> http://localhost:8080/my_stuff/servlet/index.jsp
>> 
>> I was confused so to simplify things I went back to index.jsp and put
>> a  link to itself in the file. When you mouse over the link, the
>> address it  point to is
>> 
>> http://localhost:8080/index.jsp
>> 
>> Shouldn't Tomcat be prepending
>> 
>> http://localhost:8080/my_stuff
>> 
>> onto any link I specify like this
>> 
>> <a href="/somefile.jsp">My Link</a>
>> 
>> I'm playing around with what's called a model 2 architecture where a
>> jsp  page calls a servlet which does some data processing and then
>> forwards the  request to another jsp page and I'm not having any
>> trouble with path's when  I forward the request, just with links in
>> the jsp pages.
>> 
>> what's really maddening is that in playing around with this I've seen
>> it  work correctly and seen it fail. Obviously I'm doing something
>> boneheaded,  any ideas??
>> 
>> Dave
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> To unsubscribe, e-mail:  
>> <mailto:tomcat-user-unsubscribe@jakarta.apache.org> For additional
>> commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
>> 
>> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org> For additional
> commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message