This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes html:base and named anchors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:base and named anchors" Watch "html:base and named anchors" New topic
Author

html:base and named anchors

Andles Jurgen
Ranch Hand

Joined: Mar 18, 2002
Posts: 67
I am using a page that dynamically creates links to named anchors in the same page. When I added the struts html:base tag to the page it stopped them from working. Probarbly because the html:base tag is causing the browser to fully qulaify my supposedly page relative named anchors? (such as #top and so on.)
What is the best way to get round this??
TIA
Andles
Andles Jurgen
Ranch Hand

Joined: Mar 18, 2002
Posts: 67
Could somebody please answer this post if at all possible - still having no luck figuring it out.
Basically I am have built a list of links dynamically that looks like this when viewing the html source:
<a href="#1">Question 1 blah blah </a>
<a href="#2">Question 2 blah blah </a>
and so on ...
(it's an FAQ page with answers linking to questions with named anchors.)
The problem is that, when using html:base, the browser tries to resolve the links from the base path, so the browser no longer see them as simple named anchors.
Any help at all would be much appreciated.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: html:base and named anchors