You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Holman, Cal" <Ca...@paymentech.com> on 2003/03/05 16:34:17 UTC

RE: Relative link to top of page and Struts

For the more complex solution - I use the <base> tag: 
<base href="http://<%= request.getServerName()%>:<%=
request.getServerPort()%><%=request.getContextPath()%>/">

Which renders: 
<base href="http://www.calandva.com:80/holmansite/">

At the top of the page: <html:link linkName="Top"/>
At the bottom: <html:link
page="/do/family/AutoForward?forward=family.pagedef"
anchor="Top">Top</html:link>

Rendered anchor tag: <a name="Top"></a>
Rendered link tag: <a
href="/holmansite/do/family/AutoForward?forward=family.pagedef#Top">Top</a>

URL on hover:
http://www.calandva.com/holmansite/do/family/AutoForward?forward=family.page
def#Top

Cal 

http://www.calandva.com/            Last update 01/26/03


-----Original Message-----
From: Moyer, Alan L [mailto:MOYERA@polaroid.com]
Sent: Tuesday, February 25, 2003 15:10
To: struts-user@jakarta.apache.org
Subject: RE: Relative link to top of page and Struts

I tried Wendy's suggestion - just used <A HREF="#top">Jump to top of
page</A>

I get the same behavior. Note: The page has struts tags for other, dynamic
reasons. For example, <html:base/>
<html:html>
<html:form>

The browser doesn't seem to understand to just go to the top of the page. I
confess I don't have a complete understanding of what the base tag is doing
for me. It translates onto the HTML page as

<base href="http://localhost/Opal_Struts/admin/jsp/admin_formSelect.jsp">

mousing over the link shows

http://localhost/Opal_Struts/admin/jsp/admin_formSelect.jsp#top

but the server is looking for the action mapping, as I indicated.

Al

-----Original Message-----
From: James Mitchell [mailto:jmitchell@apache.org]
Sent: Tuesday, February 25, 2003 2:20 PM
To: 'Struts Users Mailing List'
Subject: RE: Relative link to top of page and Struts


There seems to be some confusion on your page as to what the URL vs. the
<base> tag is doing.  There are a couple of potential "gotcha"s with
using relative links/anchors with or without the combined html:base tag.

You are better off to go with Wendy's suggestion. (Keep it simple)


--
James Mitchell
Software Engineer/Struts Evangelist




> -----Original Message-----
> From: Wendy Smoak [mailto:Wendy.Smoak@asu.edu]
> Sent: Tuesday, February 25, 2003 2:06 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Relative link to top of page and Struts
>
>
> > Question: Using Struts, how can I get the browser to just
> link to the top
> of
> > the page. I've done this successfully in the past using jsp
> pages without
> > Struts.
>
> I just do use a plain old HTML <A> tag:
>    <A HREF="#top">Jump to top of page</A>
>
> If there's nothing dynamic about it, and it's a link to the
> same page, then
> I don't see a reason to use a Struts tag.
>
> --
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
  
Learn more about Paymentech's payment processing services at www.paymentech.com
THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org