I have a java/jsp program and am using this statement in my jsp file:
<%@ page import="java.util.*,test.*" %>
But, I have to use some standard html that includes various images (to
get look and feel
the same for each html and/or jsp form). This means that I need to use
this:
<base href="http://www.test.com/">
...
...
(site specific html)
...
...
The problem is that when I use the base href tag, the jsp program
cannot find the
location of the servlet when I do a forms statement such as this:
<form name="form1" method="post" action="servlet/test.SearchName">
the test.SearchName java program is located on our server and after I
press the submit
button, the program cannot find test.SearchName and gives me an error:
Page Not Found
The address you entered is not a functioning page on our site.
...
...
Does anyone know any way around this, either by modifying the jsp
<%@ page import="java.util.*,test.*" %>
statement or modifying the action="servlet/test.SearchName" parameter
of the form
statement?
If I remove the <base href="http://www.test.com/"> statement, of course
everything
works fine and the servlet runs ok. But, I need the <base href, since
that is part
of the html boilerplate code I am supposed to use.
Thanks for any advice on this.
--- Entfred
Paul Davis - 14 Jul 2006 19:54 GMT
You've left out the context of the servlet.
Can the servlet be accessed with:
http://www.test.com/servlet/test.SearchName
?
entfred@hotmail.com - 14 Jul 2006 21:19 GMT
No, it does not work as you have it below.
I just found out there is a JkMount statement in a config file I need
to look at.
> You've left out the context of the servlet.
>
> Can the servlet be accessed with:
> http://www.test.com/servlet/test.SearchName
> ?
Andrew Thompson - 14 Jul 2006 19:59 GMT
entf...@hotmail.com wrote:
> ...I have to use some standard html that includes various images (to
> get look and feel
> the same for each html and/or jsp form). This means that I need to use
> this:
>
> <base href="http://www.test.com/">
...
> If I remove the <base href="http://www.test.com/"> statement, of course
> everything
> works fine and the servlet runs ok. But, I need the <base href, since
> that is part
> of the html boilerplate code I am supposed to use.
<http://www.w3.org/TR/html4/struct/links.html#h-12.4>
"This attribute specifies an absolute URI that acts as
the base URI for resolving relative URIs. "
This should mean that it does *not* act as a base for other
*absolute* URI's. Code your FORM target as an absolute
URI and it should work.
HTH
Andrew T.