Mufaddal,
You can set location.hash='myNamedTarget' once the page has finished loading
into the browser.  See attached.

-john.


-----Original Message-----
From: Mufaddal Khumri [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 6:07 PM
To: Tomcat Users List
Subject: Re: Need an Idea - appending #tag after someurl.jsp ?


I set a request attribute before forwarding the request to JSP.  Does 
anybody have some javascript that would allow me to jump to a an anchor 
within that page ?

On Jan 15, 2004, at 3:55 PM, Hume, John - NA US HQ Delray wrote:

> Is the servlet doing a RequestDispatcher.forward or HTTP redirecting?  
> It
> seems a response.sendRedirect (HTTP redirect) would work, assuming 
> your JSP
> doesn't need the data from the form POST request.  If it DOES need to 
> share
> the request with the servlet, then I believe the HTML form action will 
> have
> to include the #tag.
>
> The other way to go would be JavaScript in the JSP that looks at a 
> request
> parameter or something else in the URI, which doesn't strike me as 
> pretty,
> but others may like.  Note that JavaScript won't see request 
> parameters that
> you add in a RequestDispatcher.forward, so here again the form (if 
> it's a
> GET) or form action (if it's a POST) would have to include something 
> for the
> JS to see.
>
> -john.
>
>
> -----Original Message-----
> From: Mufaddal Khumri [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 15, 2004 5:45 PM
> To: Tomcat Users List
> Subject: Need an Idea - appending #tag after someurl.jsp ?
>
>
> hi,
>
> I have a page called First.jsp. I have a <a name='tag'> on it. When i
> submit a form to a servlet, the servlet needs to forward me to
> First.jsp#tag. Problem is i get the following message when i try to do
> this:
>
> type: Status report
> message: /First.jsp#tag
> description: The requested resource (/First.jsp#tag) is not available.
>
> if it were: First.html#tag it would have worked, but for a jsp .. Any
> Ideas to get the same effect?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to