You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeremy Nix <Je...@sfsltd.com> on 2003/05/06 22:41:50 UTC

Advanced Struts html:img tag question

I'm not sure if this is advanced, but it sure perked my insterest.
Currently I have a static navigation bar that is displayed as plain text
links.  I wanted to add a little design into the page and use buttons
that highlight as you mouse over them.  So, in a normal html page it
would look like this:

<html>
...
<a href="..."><img src="..." onmouseover="call javascript to change
image" onmouseout="call javascript to change image back"></a>
...
</html>

At first glance, the problem seems simple since all that is needed is to
convert to the struts html tags, but 1 problem exists...and that is in
regards to application context.  I'm using the <html:base/> tag within
my document to define my application context so that all of my images,
links, etc... are relative to the application root.  For instance, one
of my images is: <html:img page="/images/logo_small.gif"/>.  So, my
delima revolves around the idea that I'm allowing Struts to determine
the full pathing for my image...but for the events (onmouseover,
onmouseout), how would I be able to allow struts to determine the
pathing information?  

Ex...
<html:html>
<html:base/>
...
<html:link page="..."/>
	<html:img page="this image will be correct" onmouseout="not sure
how to define this image" onmouseover"same here"/>
</html:link>
...
</html:html>


_________________
Jeremy Nix
Senior Application Developer
Southwest Financial Ltd.
Jeremy.Nix@sfsltd.com
(513) 621-6699 ext 1158


Re: Advanced Struts html:img tag question

Posted by Gareth Andrew <ga...@ntlworld.com>.
<html:rewrite> may help.

http://jakarta.apache.org/struts/userGuide/struts-html.html#rewrite

Gareth.

Jeremy Nix wrote:

>I'm not sure if this is advanced, but it sure perked my insterest.
>Currently I have a static navigation bar that is displayed as plain text
>links.  I wanted to add a little design into the page and use buttons
>that highlight as you mouse over them.  So, in a normal html page it
>would look like this:
>
><html>
>...
><a href="..."><img src="..." onmouseover="call javascript to change
>image" onmouseout="call javascript to change image back"></a>
>...
></html>
>
>At first glance, the problem seems simple since all that is needed is to
>convert to the struts html tags, but 1 problem exists...and that is in
>regards to application context.  I'm using the <html:base/> tag within
>my document to define my application context so that all of my images,
>links, etc... are relative to the application root.  For instance, one
>of my images is: <html:img page="/images/logo_small.gif"/>.  So, my
>delima revolves around the idea that I'm allowing Struts to determine
>the full pathing for my image...but for the events (onmouseover,
>onmouseout), how would I be able to allow struts to determine the
>pathing information?  
>
>Ex...
><html:html>
><html:base/>
>...
><html:link page="..."/>
>	<html:img page="this image will be correct" onmouseout="not sure
>how to define this image" onmouseover"same here"/>
></html:link>
>...
></html:html>
>
>
>_________________
>Jeremy Nix
>Senior Application Developer
>Southwest Financial Ltd.
>Jeremy.Nix@sfsltd.com
>(513) 621-6699 ext 1158
>
>
>  
>



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