Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding parameters in servlets

Status
Not open for further replies.

riksweeney

Programmer
Nov 4, 2002
17
GB
Is it possible to add an anchor to a URL? e.g If a user was expanding a tree of items and it scrolled off the page I'd like to be able to add an anchor to the end of the URL so that it'd jump to the right place instead of the user having to scroll down. Is that possible?
 
Yes, its possible using html (this question is not really to do with j2ee - but more html forum) :

To get to the "part of page" :

<a href=&quot;#1&quot;>half way down the page</a>

and somewhere (half way down the page) :

<A NAME=&quot;1&quot;>

Hello, this is half way down the page

</A>
 
Whoops, I've managed to duplicate this post just above (the browser wasn't working last night so I gave up, seems it posted it anyway). I think you've misunderstood what I meant.

The user clicks on an item in the tree after scrolling down the page, the request goes to the servlet, the servlet adds the items from the database or whatever and redraws the page. The user then has to scroll down the page to see the results and then expands one of the items in the expanded list, the request goes to the servlet etc. I want to add a parameter to the servlet to tell it to jump to that newly expanded branch.

Does this make more sense?
 
what are you using to generate your tree - a Java DOM model to render html, or DHTML, or ...
 
@sedj

I'm using a DOM and then transforming the result using XSL to produce HTML which is then written to the response output. When the user clicks on one of the tree items, javascript sets a couple of form parameters and submits, therefore I'm guessing that I need a way to append the anchor # to the end of the URL in the servlet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top