File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark ""html:base" tag  usage confusion " Watch ""html:base" tag  usage confusion " New topic

"html:base" tag usage confusion

suji pra

Joined: Sep 27, 2002
Posts: 11
I am trying to get my redirections work. I am using both javascript as well as struts <forward> ways to manage navigation.But not able to make redirections work perfectly.If I make my navigations work with javascript window.location.href="/jsp/junk.jsp" it fails for window.location.href="" . Or sometimes the navigations work fine till I use my first javascript navigation and then fails. I tried to use <html:base/> tag and thought I solved the problem .But it wasnt so. Does anyone have good suggestions in this regard ? Thanks in advance.

He is able who thinks he is able.
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
Your javascript should also be calling actions, as opposed to JSP pages directly. You can render the url of an action by using <html:rewrite>.
In other words, your javascript could say something like:
window.location.href='<html:rewrite page="/"/>';
I agree. Here's the link:
subject: "html:base" tag usage confusion
It's not a secret anymore!