• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hyperlinks to the same page

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, could someone please help me with this, I'm tearing my hair out!
I'm trying to link to another part of a JSP page using the normal HTML method, ie
<a href="#test">jump to test</a>
<a name="test">jumped</a>
But as the page is produced by a servlet and a JSP, the link is pointing to http://..../ServletName#test, which is reloading the whole page and making it really slow. Does anyone know how to make it stay on the same page? Maybe using JavaScript?
Thanks for your help, Adam
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
finally remembered how to do this. You need to set the following meta tag in the header of your page:
<base href="http://localhost:8100/yourapp/locationofyourjsp">
that will resolve the links correctly
 
reply
    Bookmark Topic Watch Topic
  • New Topic