Tomcat configuration question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DaiIchi

    Tomcat configuration question


    I'm using Tomcat in standalone mode. When a URL without a filename is
    entered into the browser (ie. "http://myhost.mydomain .com"), and the
    default path does NOT have an index.html, but rather an index.jsp
    file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
    "Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
    if there is a configuration for tomcat that can stop this behavior,
    i.e., just run index.jsp?


  • PerfectDayToChaseTornados

    #2
    Re: Tomcat configuration question


    "DaiIchi" <daiichi@agentn ews.test.xhome. us> wrote in message
    news:6243sv4542 u8k9u3oqtomlv1r [email protected] om...
    |
    | I'm using Tomcat in standalone mode. When a URL without a filename is
    | entered into the browser (ie. "http://myhost.mydomain .com"), and the
    | default path does NOT have an index.html, but rather an index.jsp
    | file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
    | "Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
    | if there is a configuration for tomcat that can stop this behavior,
    | i.e., just run index.jsp?
    |

    Yes, you can set up the welcome file using web.xml see the dtd

    --
    -P


    Comment

    • DaiIchi

      #3
      Re: Tomcat configuration question

      On Sun, 23 Nov 2003 21:02:59 -0800, DaiIchi
      <daiichi@agentn ews.test.xhome. us> wrote:
      [color=blue]
      >
      >I'm using Tomcat in standalone mode. When a URL without a filename is
      >entered into the browser (ie. "http://myhost.mydomain .com"), and the
      >default path does NOT have an index.html, but rather an index.jsp
      >file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
      >"Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
      >if there is a configuration for tomcat that can stop this behavior,
      >i.e., just run index.jsp?
      >[/color]


      Answer to my own question. I was using Tomcat 4.1.x... and with that
      version, it is impossible. With Tomcat 3, you can use the
      StaticIntercept or useInternal="tr ue". But Tomcat 4 doesn't support
      any such thing.

      You can fix this by modifying the DefaultServlet, but that's about it.

      Rumor has it that this problem was fixed in Tomcat 5. Does anyone
      know if it is?

      Comment

      • DaiIchi

        #4
        Re: Tomcat configuration question

        On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
        <pdtct@emailadd ress.invalid> wrote:
        [color=blue]
        >
        >"DaiIchi" <daiichi@agentn ews.test.xhome. us> wrote in message
        >news:6243sv454 2u8k9u3oqtomlv1 rhr0ia8due@4ax. com...
        >|
        >| I'm using Tomcat in standalone mode. When a URL without a filename is
        >| entered into the browser (ie. "http://myhost.mydomain .com"), and the
        >| default path does NOT have an index.html, but rather an index.jsp
        >| file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
        >| "Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
        >| if there is a configuration for tomcat that can stop this behavior,
        >| i.e., just run index.jsp?
        >|
        >
        >Yes, you can set up the welcome file using web.xml see the dtd
        >http://java.sun.com/j2ee/dtds/web-app_2_2.dtd[/color]

        Thanks, but the issue isn't the welcome file. The problem is that
        Tomcat returns a 302 error to force the browser to redirect to the
        "real" page. And there is no way in Tomcat 4.1 to turn it off.


        Comment

        • Herman Timmermans

          #5
          Re: Tomcat configuration question

          DaiIchi wrote:
          [color=blue]
          > On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
          > <pdtct@emailadd ress.invalid> wrote:
          >[color=green]
          >>
          >>"DaiIchi" <daiichi@agentn ews.test.xhome. us> wrote in message
          >>news:6243sv45 42u8k9u3oqtomlv 1rhr0ia8due@4ax .com...
          >>|
          >>| I'm using Tomcat in standalone mode. When a URL without a filename is
          >>| entered into the browser (ie. "http://myhost.mydomain .com"), and the
          >>| default path does NOT have an index.html, but rather an index.jsp
          >>| file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
          >>| "Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
          >>| if there is a configuration for tomcat that can stop this behavior,
          >>| i.e., just run index.jsp?
          >>|
          >>
          >>Yes, you can set up the welcome file using web.xml see the dtd
          >>http://java.sun.com/j2ee/dtds/web-app_2_2.dtd[/color]
          >
          > Thanks, but the issue isn't the welcome file. The problem is that
          > Tomcat returns a 302 error to force the browser to redirect to the
          > "real" page. And there is no way in Tomcat 4.1 to turn it off.[/color]

          I'm surprised, because I use Tomcat 4.1.29 and when I point my browser to
          http://localhost:8080/myapp then I will get nicely my index.jsp that I have
          defined in my web.xml settings. No hassle with error 302.
          Brgds,
          Herman
          --
          Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
          Anti Spam = remove the "dot" and the "at"
          Registered Linux User #264690

          Comment

          • DaiIchi

            #6
            Re: Tomcat configuration question

            On Thu, 27 Nov 2003 16:55:18 +0100, Herman Timmermans
            <timmermansdot. hermanat@skynet .be> wrote:
            [color=blue]
            >DaiIchi wrote:
            >[color=green]
            >> On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
            >> <pdtct@emailadd ress.invalid> wrote:
            >>[color=darkred]
            >>>
            >>>"DaiIchi" <daiichi@agentn ews.test.xhome. us> wrote in message
            >>>news:6243sv4 542u8k9u3oqtoml v1rhr0ia8due@4a x.com...
            >>>|
            >>>| I'm using Tomcat in standalone mode. When a URL without a filename is
            >>>| entered into the browser (ie. "http://myhost.mydomain .com"), and the
            >>>| default path does NOT have an index.html, but rather an index.jsp
            >>>| file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
            >>>| "Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
            >>>| if there is a configuration for tomcat that can stop this behavior,
            >>>| i.e., just run index.jsp?
            >>>|
            >>>
            >>>Yes, you can set up the welcome file using web.xml see the dtd
            >>>http://java.sun.com/j2ee/dtds/web-app_2_2.dtd[/color]
            >>
            >> Thanks, but the issue isn't the welcome file. The problem is that
            >> Tomcat returns a 302 error to force the browser to redirect to the
            >> "real" page. And there is no way in Tomcat 4.1 to turn it off.[/color]
            >
            >I'm surprised, because I use Tomcat 4.1.29 and when I point my browser to
            >http://localhost:8080/myapp then I will get nicely my index.jsp that I have
            >defined in my web.xml settings. No hassle with error 302.
            >Brgds,
            >Herman[/color]

            If myapp is a directory (not a web application), Tomcat will send a
            302 Error to redirect your browser to
            http://localhost:8080/myapp/index.jsp. This is completely invisible
            to the user, so everything looks fine. The problem really occurs if
            your JSP handles username/password authentication i.e.
            http://username:password@localhost:8080/myapp What happens is that
            Tomcat will send a 302 to redirect the browser to
            http://localhost:8080/myapp/index.jsp ... which the browser
            delightfully does, but upon redirection, the browser doesn't associate
            the "username:passw ord" portion with the new URL (possibly due to
            security issues). So if your index.jsp is handling the authenticate
            protocol, the browser will pop up a diaglog prompting the user for
            username/password instead of just logging in as it should.

            It's a really esoteric error for most people other than me. But other
            issues that arise are that you may want to hide the fact that your
            website implementation is a JSP. The way that tomcat currently works
            is that since the default url (http://localhost:8080/myapp) is
            actually being redirected, your browser won't just show
            "http://localhost:8080/myapp/" it will instead show
            "http://localhost:8080/myapp/index.jsp" .

            Anyway, I did find a solution that works for Tomcat 4.1. I had to
            modify the DefaultServlet. java file to allow internal forwarding
            rather than redirection--and it works just fine. If you want to see
            why I use it, send me an email via my JSP:

            http://daiichi:[email protected]



            Comment

            • Herman Timmermans

              #7
              Re: Tomcat configuration question

              DaiIchi wrote:
              [color=blue]
              > On Thu, 27 Nov 2003 16:55:18 +0100, Herman Timmermans
              > <timmermansdot. hermanat@skynet .be> wrote:
              >[color=green]
              >>DaiIchi wrote:
              >>[color=darkred]
              >>> On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
              >>> <pdtct@emailadd ress.invalid> wrote:
              >>>
              >>>>
              >>>>"DaiIchi" <daiichi@agentn ews.test.xhome. us> wrote in message
              >>>>news:6243sv 4542u8k9u3oqtom lv1rhr0ia8due@4 ax.com...
              >>>>|
              >>>>| I'm using Tomcat in standalone mode. When a URL without a filename is
              >>>>| entered into the browser (ie. "http://myhost.mydomain .com"), and the
              >>>>| default path does NOT have an index.html, but rather an index.jsp
              >>>>| file, Tomcat response with an "HTTP/1.1 302 Moved Temporarily" and a
              >>>>| "Location: http://myhost.mydomain .com/index.jsp" ... I was wondering
              >>>>| if there is a configuration for tomcat that can stop this behavior,
              >>>>| i.e., just run index.jsp?
              >>>>|
              >>>>
              >>>>Yes, you can set up the welcome file using web.xml see the dtd
              >>>>http://java.sun.com/j2ee/dtds/web-app_2_2.dtd
              >>>
              >>> Thanks, but the issue isn't the welcome file. The problem is that
              >>> Tomcat returns a 302 error to force the browser to redirect to the
              >>> "real" page. And there is no way in Tomcat 4.1 to turn it off.[/color]
              >>
              >>I'm surprised, because I use Tomcat 4.1.29 and when I point my browser to
              >>http://localhost:8080/myapp then I will get nicely my index.jsp that I
              >>have
              >>defined in my web.xml settings. No hassle with error 302.
              >>Brgds,
              >>Herman[/color]
              >
              > If myapp is a directory (not a web application), Tomcat will send a
              > 302 Error to redirect your browser to
              > http://localhost:8080/myapp/index.jsp. This is completely invisible
              > to the user, so everything looks fine. The problem really occurs if
              > your JSP handles username/password authentication i.e.
              > http://username:password@localhost:8080/myapp What happens is that
              > Tomcat will send a 302 to redirect the browser to
              > http://localhost:8080/myapp/index.jsp ... which the browser
              > delightfully does, but upon redirection, the browser doesn't associate
              > the "username:passw ord" portion with the new URL (possibly due to
              > security issues). So if your index.jsp is handling the authenticate
              > protocol, the browser will pop up a diaglog prompting the user for
              > username/password instead of just logging in as it should.
              >
              > It's a really esoteric error for most people other than me. But other
              > issues that arise are that you may want to hide the fact that your
              > website implementation is a JSP. The way that tomcat currently works
              > is that since the default url (http://localhost:8080/myapp) is
              > actually being redirected, your browser won't just show
              > "http://localhost:8080/myapp/" it will instead show
              > "http://localhost:8080/myapp/index.jsp" .
              >
              > Anyway, I did find a solution that works for Tomcat 4.1. I had to
              > modify the DefaultServlet. java file to allow internal forwarding
              > rather than redirection--and it works just fine. If you want to see
              > why I use it, send me an email via my JSP:
              >
              > http://daiichi:[email protected][/color]
              OK, I see your point. Thanks for clarifying this - brgds, Herman
              --
              Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
              Anti Spam = remove the "dot" and the "at"
              Registered Linux User #264690

              Comment

              Working...