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?
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.
An IDE is no substitute for an Intelligent Developer.
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
<a href="http://www.samjdalton.com" target="_blank" rel="nofollow">Sam Dalton</a>,<br />Co-author of [http://www.amazon.com/exec/obidos/tg/detail/-/1590592255/qid=1068633302//ref=sr_8_xs_ap_i0_xgl14/104-4904002-9274339?v=glance&s=books&n=507846]Professional JSP 2.0[/URL] (October 2003)<br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1861007701/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional SCWCD Certification</a><br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/186100561X/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional Java Servlets 2.3</a>