It's a little difficult to tell the browser about the anchor after it's made
its request without doing some form of redirect (javascript or otherwise).

How about telling the browser about the anchor ahead of time by including it
in the URL for the form. Then you could dynamically place the anchor tag at
the location of the first error in the form. If there isn't an error, then
don't include the anchor tag in the generated HTML. The browser will
position the page at the top of the screen if if can't find the anchor tag.

> -----Original Message-----
> From: Oleson, Rex [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 18, 2000 5:57 PM
> To: '[EMAIL PROTECTED]'
> Subject: sending user to a anchor on a page.
>
>
> I was wondering if there was any way to send a user to a specific
> portion of
> a page after the action class has executed.
>
> as an example lets say that I have a user registration page. If the user
> inputs some bugus information I would like to return
> them to that exact area of the page that they need to correct the info.
>
> So there is the page
>       userReg.jsp
> The Form class
>       UserRegForm.java
> the Action class
>       UserRegAction.java
>
> what I was thinking for the action.xml doc is something like
>       <action path="/RegisterUser"
>                       actionClass="com.userapp.UserRegAction"
>                       formAttribute="UserRegForm"
>                       formClass="com.userapp.UserRegForm"
>                       inputForm="/RegisterUser/userReg.jsp">
>
>       <forward name="success"  path="/App/ShowInfo.action"/>
>       <forward name="failure"
> path="/RegisterUser/userReg.jsp"/>
>       <forward name="badzip"
> path="/RegisterUser/userReg.jsp#zip"/>
>
>     </action>
>
> where zip is the name of an anchor on userReg.jsp
>
> This does not work though
> all I get is a 404 error and nothing in the webservers output or
> log files.
>
> Any help or suggestions would greatfully appreciated.
> Thank you,
> Rex Oleson
>

Reply via email to