You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by RAJ <bs...@gmail.com> on 2015/06/16 00:22:36 UTC

Issues porting application from tomcat 5.0.28 to tomcat 7.0.57

Hi,
Can anyone please help me with the below. I even posted this in struts users group but no reply.

I am facing this issue after porting my application from the existing Tomcat 5.0.28 to the new tomcat 7.0.57. 
I am using Struts version 1.1 is something particular, the app in both the old and new environments work except for a few pages in the new env where when I click on the submit button it is directing to 
http://calculators/CertSsCalculator.do if I see the source of the page I see.

new environment (bombs due to //)
<form name="CalculatorForm" method="post" action="//calculators/Calculator.do" onsubmit="return validateForm();">

old environment (works fine)
<form name="CalculatorForm" method="post" action="/calculators/Calculator.do" onsubmit="return validateForm();">
 
The jsp is the same with no changes
<html:form action="/calculators/Calculator" onsubmit="return validateForm();" >

Has any one see something like this and can suggest what can be tried and totally at a loss.


Thank You
Raj



Re: Issues porting application from tomcat 5.0.28 to tomcat 7.0.57

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Raj,

On 6/16/15 4:15 PM, RAJ wrote:
>> Is there any reason not to simply remove the double-slash?
> 
> We see that in the source of the page. In the jsp its <html:form 
> action="/calculators/Calculator" onsubmit="return validateForm();"

So the action="/calculators/Calculator.do" in the JSP source turns
into this in the HTML?

  action="//calculators/Calculator.do"

Hmm.

One possibility that I can think of.

Are you defining your <Context> in server.xml or just dropping a WAR
file in the webapps/ directory?

If you manually specify the <Context> element somewhere, you might be
explicitly setting the "path" attribute to "/" to force the webapp to
be deployed to the root path. If you're doing this, it's wrong, and
you are paying the price.

First, the "path" of the root web application should be "" (empty
string) and not "/". Second, you should never have to specify the
"path" attribute for a <Context> unless you are doing something you
really shouldn't be doing.

So take a look around and see if I'm right about any of the above.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVgIcIAAoJEBzwKT+lPKRYbiQQAMhZb7Ch9virKJlQu/x7xCFu
TM2oWQaCj3EylvBOIe8YDx31eTmvaCloaWSa/5qGWMCmk5WTRO7ssAOeO1jbs80c
Po7DtJYySoLvHc359pp69XJxlUc5bBYGQ8pPdjPCrpxRChKm0Y+xj80kfns+LNMq
L3/U/09f9Dr2igJw57oEVyPRmreba/LhDJdQM0FHo8RzK/tga9gRyjCqumFdKs7b
qBO1i00MYxcZYHQzbFrkHC4UECJdd8U7gDeaiejrPJljkd4WqNW895BPTfLnYD55
9U1jwTBLy/LbrrbtLMSkuELoOhShaTcwy18y73OROOwMb6a9FY6297M8/ypGBTV3
ziqmQXaXSIz8Cwse0clxQzLUGY0TErgP2Z5fy2mdqRLT60vYK286ot9FC8KBDAeE
R/aPNI/AjLCZJxh/O7wHyoCfUTTv2az3B8Yf4lJGCKNN+kLBU2dm8nPd0lnoDJWz
JYQIf92EWNy4U9E8kGXFT6gnIBa4U7hgh9ASSZ/b6UTO4zMY1fchPBr1tbKZ2yyW
DM8hWpdqRokvIGenWt44QDULPSDO2ZQKxrXNCAaEwkFcGZOgoOqoZ3wVwZ3vm16O
6fqK4A1mbo0k0Z6gP+7N/36qDNzlNeQl5Ptn1qLrzN/moVpsKcdO1XYV4B0TFgTF
tC+r1sXpTbsdhuorspSF
=VD8A
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Issues porting application from tomcat 5.0.28 to tomcat 7.0.57

Posted by RAJ <bs...@gmail.com>.
Hi Christopher,
Thanks for your reply. 
To your question
> Is there any reason not to simply remove the double-slash?

We see that in the source of the page. In the jsp its <html:form action="/calculators/Calculator" onsubmit="return validateForm();"

Thanks
Raj

> On Jun 16, 2015, at 11:53 AM, Christopher Schultz <ch...@christopherschultz.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Raj,
> 
>> On 6/15/15 6:22 PM, RAJ wrote:
>> Can anyone please help me with the below. I even posted this in
>> struts users group but no reply.
>> 
>> I am facing this issue after porting my application from the
>> existing Tomcat 5.0.28 to the new tomcat 7.0.57.
> 
> If you are going to make a jump that far, I'd recommend to continue
> all the way up to Tomcat 8.0.23.
> 
>> I am using Struts version 1.1 is something particular, the app in
>> both the old and new environments work except for a few pages in
>> the new env where when I click on the submit button it is directing
>> to http://calculators/CertSsCalculator.do if I see the source of
>> the page I see.
>> 
>> new environment (bombs due to //) <form name="CalculatorForm"
>> method="post" action="//calculators/Calculator.do" onsubmit="return
>> validateForm();">
>> 
>> old environment (works fine) <form name="CalculatorForm"
>> method="post" action="/calculators/Calculator.do" onsubmit="return
>> validateForm();">
>> 
>> The jsp is the same with no changes <html:form
>> action="/calculators/Calculator" onsubmit="return validateForm();"
>> 
>> Has any one see something like this and can suggest what can be
>> tried and totally at a loss.
> 
> Is there any reason not to simply remove the double-slash?
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJVgFSPAAoJEBzwKT+lPKRY+eUP/1bcjfoRvHDDABW7O5/gAMXn
> /R7vCjdbLGmyVab83OkJ3wtG+dNcf3/IqbIwd5QFw5shBTWOIT/1mnQfu+U9lp2R
> Vh4Nmmm2exfMjtUTU+eAbfTaFRpzFlHvoVRDwms7zWWEKJmN7Mpna9n3GNXAuweb
> 8BX7CEAM6AmGwzUkysOkJsdqds0gMVoUlhKWAS7tEvWPalB9GgEuuotkyqmLol2j
> n+GTUg7ovrJWb+cCA6rzH2T58x8Bh/u8UsbU+T111t2a7cLIEbFLH6c8jqbmTQYU
> w08ZmMqn55rPSXO4cR1Otujqj7whsYeDowZWB8gIIYTSS6oo0jJCNL+CTzDCXdi6
> QDxh3IbMh4CGZYE2UeRlX4i9mX8GOPNxlFsplZoAHgVOSvngk49B3Fe5vuyg8apT
> xo4b03yo2KtJOTXn5I/jNM7Yb9fXACfieCj8a3pJjyKwrqqSH6ADcCzdggPSAJlv
> tpBfCf17mZL4VxHtlbKymeE8oeB8CtUyjZfY0K+y7Eo8mPFv0T9S9o8A2r8WpEqT
> AyZBfZ8cRedtl6VrE/TEZ0i5u6IFmAZt0gyXJWu4jgf7AcSOXzSwt+7937tXk9yd
> c69JX3FjmV2zjgd3loFNWuUOknIokU/R/RskURZdTmoi4dftacyrvE6PNzj89yhr
> HHmtqqEAr6b2lC1cj3wS
> =1+Ka
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

Re: Issues porting application from tomcat 5.0.28 to tomcat 7.0.57

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Raj,

On 6/15/15 6:22 PM, RAJ wrote:
> Can anyone please help me with the below. I even posted this in
> struts users group but no reply.
> 
> I am facing this issue after porting my application from the
> existing Tomcat 5.0.28 to the new tomcat 7.0.57.

If you are going to make a jump that far, I'd recommend to continue
all the way up to Tomcat 8.0.23.

> I am using Struts version 1.1 is something particular, the app in
> both the old and new environments work except for a few pages in
> the new env where when I click on the submit button it is directing
> to http://calculators/CertSsCalculator.do if I see the source of
> the page I see.
> 
> new environment (bombs due to //) <form name="CalculatorForm"
> method="post" action="//calculators/Calculator.do" onsubmit="return
> validateForm();">
> 
> old environment (works fine) <form name="CalculatorForm"
> method="post" action="/calculators/Calculator.do" onsubmit="return
> validateForm();">
> 
> The jsp is the same with no changes <html:form
> action="/calculators/Calculator" onsubmit="return validateForm();"
> >
> 
> Has any one see something like this and can suggest what can be
> tried and totally at a loss.

Is there any reason not to simply remove the double-slash?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVgFSPAAoJEBzwKT+lPKRY+eUP/1bcjfoRvHDDABW7O5/gAMXn
/R7vCjdbLGmyVab83OkJ3wtG+dNcf3/IqbIwd5QFw5shBTWOIT/1mnQfu+U9lp2R
Vh4Nmmm2exfMjtUTU+eAbfTaFRpzFlHvoVRDwms7zWWEKJmN7Mpna9n3GNXAuweb
8BX7CEAM6AmGwzUkysOkJsdqds0gMVoUlhKWAS7tEvWPalB9GgEuuotkyqmLol2j
n+GTUg7ovrJWb+cCA6rzH2T58x8Bh/u8UsbU+T111t2a7cLIEbFLH6c8jqbmTQYU
w08ZmMqn55rPSXO4cR1Otujqj7whsYeDowZWB8gIIYTSS6oo0jJCNL+CTzDCXdi6
QDxh3IbMh4CGZYE2UeRlX4i9mX8GOPNxlFsplZoAHgVOSvngk49B3Fe5vuyg8apT
xo4b03yo2KtJOTXn5I/jNM7Yb9fXACfieCj8a3pJjyKwrqqSH6ADcCzdggPSAJlv
tpBfCf17mZL4VxHtlbKymeE8oeB8CtUyjZfY0K+y7Eo8mPFv0T9S9o8A2r8WpEqT
AyZBfZ8cRedtl6VrE/TEZ0i5u6IFmAZt0gyXJWu4jgf7AcSOXzSwt+7937tXk9yd
c69JX3FjmV2zjgd3loFNWuUOknIokU/R/RskURZdTmoi4dftacyrvE6PNzj89yhr
HHmtqqEAr6b2lC1cj3wS
=1+Ka
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org