Aehm, 
<script>
document.location.href = document.location.href+'#errors'; 
</script>
At the bottom of your document?

I mean, you should remind yourself, that an anchor in your document has
nothing to do with the forward.
It's like renaming the class file if you need to call method B() of the
object instead of method A().

The jsp always contains the whole html source, an anchor is only a directive
for the browser, where to position it's viewport.
Another possibility is to send a redirect instead of adding a javascript
one-liner (haven't tested this one line, but it should work).

Regards
Leon


> -----Ursprüngliche Nachricht-----
> Von: Jim Coble [mailto:[EMAIL PROTECTED] 
> Gesendet: Donnerstag, 21. April 2005 23:17
> An: user@struts.apache.org
> Betreff: Possible to go to named anchor via ActionForward?
> 
> 
> I have a JSP page in my application that consists of several 
> lines of explanatory text (a screen's worth or so) followed 
> by a form.  When the user submits the form, the ActionForm 
> validate method is called and, if there are errors, the user 
> is returned to the same JSP page where html:errors displays 
> the relevant error messages between the initial explanatory 
> text and the beginning of the form.  All this works fine.
> However, when the JSP page redisplays in this validation 
> error scenario, I'd like the browser page to jump to the 
> error messages.
> 
> Here is what I tried that did not work.
> Within the JSP page ...
> <a name="errors"><html:errors/></a>
> In struts-config action mapping, for the "input" attribute of 
> the "action"
> element ...
> input="/flts/reservationlab.jsp#errors"
> 
> When I submit the form with a required field missing, I get ...
> The requested resource (/flts/reservationlab.jsp#errors) is 
> not available.
> 
> Is there any way I can set up an action mapping so that, if 
> control is redirected back to the "input" JSP page, I can 
> make it so that the browser jumps to a named anchor tag 
> ("errors" in this particular case)?
> 
> Thanks.
> --Jim
> 
> ==================================
> Jim Coble
> Senior Technology Specialist
> Center for Instructional Technology
> Email: [EMAIL PROTECTED]
> Voice: 919-660-5974  Fax: 919-660-5923
> Box 90198, Duke University
> Durham, NC 27708-0198
> ==================================
> 
> 
> ---------------------------------------------------------------------
> 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