473,507 Members | 13,917 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 12116

"DaiIchi" <da*****@agentnews.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
--
-P
Jul 17 '05 #2
On Sun, 23 Nov 2003 21:02:59 -0800, DaiIchi
<da*****@agentnews.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
StaticInterceptor useInternal="true". 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, "PerfectDayToChaseTornados"
<pd***@emailaddress.invalid> wrote:

"DaiIchi" <da*****@agentnews.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, "PerfectDayToChaseTornados"
<pd***@emailaddress.invalid> wrote:

"DaiIchi" <da*****@agentnews.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, "PerfectDayToChaseTornados"
<pd***@emailaddress.invalid> wrote:

"DaiIchi" <da*****@agentnews.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


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:password" 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, "PerfectDayToChaseTornados"
<pd***@emailaddress.invalid> wrote:
"DaiIchi" <da*****@agentnews.test.xhome.us> wrote in message
news:62********************************@4ax.co m...
|
| 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:password" 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
5899
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...
0
3271
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...
5
6449
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...
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...
0
3652
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...
4
13585
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
2697
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...
0
4165
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...
0
2776
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. ...
0
5838
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...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
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...
0
7481
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...
1
5039
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...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.