• 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

redirect to another page (not the beggining)

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys:

I was wondering if any of you knows how to redirect to another page of the web application (well this is simple)
The problem I have is: I don´t want to display that page from the beggining, but from, lets say, a different intermediate point.

Thanks in advance!
 
Lucas Grijander
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I have thought how to do it: using anchors, a request variable with the name of the appropriate anchor and javascript in the jsp checking if the variable is not null or empty; in this case use javascript to focus on the suitable anchor...

What I want is if anybody can help me with some CODE!!!

thanks!
 
Lucas Grijander
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
something like this:

In the Action, I set:
request.setAttribute( "anchor", "nameOfAnchor");

Then at the bottom of the JSP (so it won't execute until the page has
finished loading) I have:
<c:if test="${anchor ne null}">
<script>
document.location = "#<cut value="${anchor}"/>";
</script>
</c:if>

I dont know how to set an anchor in a jsp to reference it from my javascript code...
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Then at the bottom of the JSP (so it won't execute until the page has
finished loading) I have:


Hmm - this sounds a little suspect. Putting JavaScript at the base of a page doesn't determine when it will be run. You should use an event.

Also, I'm not following why you would do this in JavaScript. Can you explain?
 
Grow your own food... or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic