Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamic link for internet and intranet

 
mark fritschen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I use a dynamic include for my top "header" (by header I mean many urls that pertain to either internal or external users) of my web page, and I use
String agent = request.getRemoteAddr();
......
to get either a intranet header or internet header,
but, if inside the body I have a link that I want to go to either internet or genet users when it is clicked.
What would be the best way to do this?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there's no absolute answer for that, since your "intranet" can be implemented as a WAN over the Internet. In practice, depending on how things are mapped, you might be able to test the incoming ip address, or failing that, the domain name of the incoming request.
 
Sam Dalton
Author
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a custom tag that you pass the URLs to (to intranet URL and the internet URL).
This URL can test the ip address and output the correct URL for the user. Better still put the URL in a scripting variable and use that on the page.
For more help on Tags and Scripting variables, check ot the JavaOne presentations on my website (www.samjdalton.com)
S
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic