Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

html and jsp clashing

Thread view: 
entfred@hotmail.com - 14 Jul 2006 19:39 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.