struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Paransky" <>
Subject RE: Question on forwarding/redirecting/href usage...
Date Mon, 21 Jan 2002 19:43:14 GMT
I looked at html:link, and it seems to require using a Map class to pass
parameters to the link.  Seems like a lot of setup, and scriplet code (which
I am not crazy about) just to generate
/school/maintenance.jsp?schoolId=223&context=ready.  Is there an easier way
to do this?

Here is how I imagine the code would look like with the current STRUTS
html:link tag:

<bean:define id="schoolId" name="school" property="id"/>
<bean:define id="contextMode" name="school" property="context"/>

Map map = new HashMap();
map.put("schoolId", schoolId);
map.put("context", contextMode);

<html:link href="/school/maintenance.jsp" name="map" />

I would rather see syntax like this:

<html:link href="/school/maintenance.jsp">
  <html:linkParam id="schoolId" name="school" property="id"/>
  <html:linkParam id="context" name="school" property="context"/>

The map, is a good feature, but it's TOO dynamic in this case.  I could
create my own tag, but I thought I would ask around before re-inventing the


-----Original Message-----
From: neel []
Sent: Monday, January 21, 2002 11:25 AM
To: Struts Users Mailing List
Subject: RE: Question on forwarding/redirecting/href usage...

try using <html:link page="..."></html:link> instead of <a href=""></a>

-- Original Message --

>When I use ActionForward I supply it the Context-relative URI to which
>control should be forwarded.  However, when I want to use <a href="..."
>cannot use the Context-relative URI.  Thus my returnTo= backlink works
>correctly if I use it with the ActionForward, but fails to work when used
>with <a href tag.
>Is there a BEAN/TAG/METHOD that would convert a Context-relative URI to
>something that I can use with an anchor tag?  I guess I could always call
>request.getContext() and prepend that to the URI, however, this will only
>work if the URI is context-relative.  In case URI is page-relative, no
>append is needed.  Is there something in JSP/Servlet/Struts that would
>these checks for me?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message