473,659 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?
Jul 17 '05 #1
6 12133

"DaiIchi" <da*****@agentn ews.test.xhome. us> wrote in message
news:62******** *************** *********@4ax.c 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
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd
--
-P
Jul 17 '05 #2
On Sun, 23 Nov 2003 21:02:59 -0800, DaiIchi
<da*****@agentn ews.test.xhome. us> wrote:

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?

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?

Jul 17 '05 #3
On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
<pd***@emailadd ress.invalid> wrote:

"DaiIchi" <da*****@agentn ews.test.xhome. us> wrote in message
news:62******* *************** **********@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


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.
Jul 17 '05 #4
DaiIchi wrote:
On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
<pd***@emailadd ress.invalid> wrote:

"DaiIchi" <da*****@agentn ews.test.xhome. us> wrote in message
news:62****** *************** ***********@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


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.


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
Jul 17 '05 #5
On Thu, 27 Nov 2003 16:55:18 +0100, Herman Timmermans
<ti************ ********@skynet .be> wrote:
DaiIchi wrote:
On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
<pd***@emailadd ress.invalid> wrote:

"DaiIchi" <da*****@agentn ews.test.xhome. us> wrote in message
news:62***** *************** ************@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


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.


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


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:ma**@agentnews.test.xhome.us

Jul 17 '05 #6
DaiIchi wrote:
On Thu, 27 Nov 2003 16:55:18 +0100, Herman Timmermans
<ti************ ********@skynet .be> wrote:
DaiIchi wrote:
On Mon, 24 Nov 2003 19:38:01 -0000, "PerfectDayToCh aseTornados"
<pd***@emailadd ress.invalid> wrote:
"DaiIchi" <da*****@agentn ews.test.xhome. us> wrote in message
news:62**** *************** *************@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.


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


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:ma**@agentnews.test.xhome.us

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
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5921
by: Steve Adams | last post by:
Hi, I have a JSP application on Tomcat that performs XSL transformations on an XML file using the xtags-1.0 taglib. Basically, I have an 'edit' page that displays a table of entities from my XML file. Each row has a link to a 'delete' page that removes the row from the XML file itself and then forwards back to the edit page to display the updated table. My problem is that the deleted row is displayed when the edit page reloads. A copy...
0
3280
by: Kevin Sagon | last post by:
I am running a J2EE Web App under Tomcat 4.1 with Apache 2.0 proxying requests. Everything is configured and working appropriately however I ran into a problem after configuring J2EE Form Authentication. I have a security constraint restricting access to the application so that when I attempt to access the app I am redirected to the login page. This works as expected both when accessing the application via the Apache proxy or hitting...
5
6461
by: Tom Martin | last post by:
I'm a Java Web developer NEWBIE that has inherited a website that fails every 2 hours due to poor connection pooling between Tomcat 4.0.6 and mySQL. In efforts to resolve this problem, I've created another replica DEVELOPMENT website and upgraded it to Tomcat 4.1.27. I was told this version of Tomcat supports Database Connection Pooling (DBCP) better than previous versions. I followed the instructions as listed at:...
4
754
by: Subhodini Fernandes | last post by:
A very basic question about Tomcat 3.3.1 configuration - We have an application setup on Tomcat. Daily the service needs to be taken down for backup purpose for 1 hour and we need Tomcat to display a page which says that the system is unavailable as it is being backed up. Can someone please tell me how to achieve this ? Thanks, Subho.
0
3673
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the mysql- connector-java-2.0.14-bin.jar in commons/lib. The application runs normally, and usually about once or twice a day I get this exception org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server configuration denies access to data...
4
13595
by: Edward V. Berard | last post by:
People, I am having problems developing Java applications on a Mac using Eclipse, MyEclipse, and Tomcat 5.5+. My current configuration: Mac OS X (10.4.5) Eclipse (3.1+) MyEclipse (4.0+)
0
2705
ak1dnar
by: ak1dnar | last post by:
Hi Guys, I am using a virtual private server which runs Linux OS in it. On the server Apache and Tomcat has installed and to the best of my knowledge mod_jk also installed and working perfectly. In other words Apache is on Port and 80 and Tomcat is on 8080. but when I type http://mydomain.com/MyWebContext/a_file_name.jsp I can see the jsp pages inside tomcat webapps Dir, and If I need to access my phpmyadmin app which is inside Apache doc...
0
4199
by: Arun21084 | last post by:
Hi, Recently I installed an application HP SIP(Service Information Portal) on a Windows 2000 server.The application comes along with an installation of Tomcat 5.0.19. Already there was an Apache 2 running on the server used by other application. Once after installation of the product(HP SIP), I tried to restart the Tomcat 5.0.19 process using below methods(errors reported below respectively) 1) services.msc console Could not start...
0
2808
rsrinivasan
by: rsrinivasan | last post by:
Hi all, I already posted the same question in this forum. But i did not get any solution for this. I am using tomcat4.1. This is my tomcat context configuration in server.xml file. <Context path="/tri" docBase="tri" debug="0" reloadable="true" crossContext="true" swallowOutput="false"> <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_examples_log." suffix=".txt" timestamp="true"/> ...
0
5846
by: amie2008 | last post by:
Hi Folks, I need urgent help with tomcat-apache configuration for load balancing using the mod_proxy module. I have been trying to achieve this configuration: 2 tomcat instances load balanced by front end apache server. I am trying to use the mod_proxy module available with apache. I have successfully loaded the module in httpd.conf file and placed workers.properties file in conf directory. But any changes i make to the httpd.conf...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8747
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.