Re: Images question
Matt Raible <lists-T7vlz3gD7BdF/EzeuO4KJwC/[email protected]>
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Message-ID | <[email protected]> |
Are you saying that the "image" attribute doesn't append the contextPath and such? I could probably change the behavior, but then it might be Struts-specific (which is bad thing IMO since Struts Menu supports other frameworks as well). Matt On Dec 30, 2004, at 1:12 PM, Caballero Roque wrote: > Hello everybody, > > Firstly, I'm a newbie in struts-menu so maybe my question is a > bit silly. > > In my current application (made using struts), every jsp page > import another jsp pages that tailor the menu, every option has a image > and a text (link). The jsp pages aren't in the same directory, most of > them are under WEB-INF directory and only the index.jsp is in the > context root of the application. At the beginning I had problem when I > tried to reference the image, for the index.jsp the reference was > img/bullet.jpg, but for one page under WEB-INF/address was > ../../img/bullet.jpg. > > I resolved the problem using the <html:img> Struts tag in this > way (the next is a menu item) > > <tr> > <td><html:img page="/img/flash.gif" width="13" > height="13"></td> > <td><html:link forward="newAddress"><font > color='#FFFFFF'><em><b>New</b></em></font></html:link></td> > </tr> > > And this produce an absolute path to the file like this > > <tr> > <td><img src="/titulars/img/flash.gif" height="13" > width="13"></td> > <td><a href="/titulars/address/NewAddress.do"><font > color='#FFFFFF'><em><b>New</b></em></font></a></td> > </tr> > > Where /titulars is my web context. > > Now I'm trying to migrate my menus to struts-menu and I > configured the menu item in this way > > <Menu name="MenuPrueba" title="TITLE"> > <Item name="indexMenu1" title="OPT_1" > toolTip="...." > forward="newAddress"/> > </Menu> > > This works fine for my Struts forward, but I don't know how to resolve > the problem with the image and the diferent reference if the jsp is > under /WEB-INF or in the root context. I'm looking for the same thing > that the forward attribute does. The resultant URI will carry the > Context Path (if any), Module Prefix (if any), Session ID (if any), and > Servlet Mapping (path mapping or extension mapping). > > Thank you for your time. > > Best regards, > > Roque Caballero > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > struts-menu-user mailing list > struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/struts-menu-user ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt