This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"html:base" tag usage confusion

 
suji pra
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="DisplayJunk.do" . 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.
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="/displayJunk.do"/>';
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic