Feature Requests item #829859, was opened at 2003-10-24 21:52
Message generated for change (Comment added) made by nymbyl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=536616&aid=829859&group_id=73068
Category: main taglib
Group: v 1.0-b1
Status: Open
Resolution: None
Priority: 5
Submitted By: Marcelo Vanzin (vanza)
Assigned to: Nobody/Anonymous (nobody)
Summary: Context-aware links
Initial Comment:
I've found no way to easily make the table tag to
create links relative to the current app's context.
Since the context of our app changes (each developer
has his own webapp, and the final webapp has yet
another different context name), there's no way to
hardcode the value.
Also, is there a way to not include all the params to
the current request in the created links? All my data
is in the session, so I don't need all those params.
----------------------------------------------------------------------
Comment By: Rob Nelson (nymbyl)
Date: 2003-11-13 04:21
Message:
Logged In: YES
user_id=908064
I found a way to do this - which is consistant with Struts - it
requires just adding a few lines (and recompiling everything).
The basic idea is that the struts <html:link> tag takes "href"
or "page" attributes - the "page" one being context-aware.
To make the displaytag do this - I just added the attribute to
the tag - and added a few lines of code to deal with it in the
Tag Processor (org.displaytag.tags.ColumnTag):
Changes:
File: ../org/displaytag/tags/ColumnTag:
I added a String variable page (along with the get and set
methods) and then added this to the doEndTag() function
(around line 660 or so):
<pre>
if ((mHref != null || page != null) && mParamId != null)
{
Href lColHref = null;
if(mHref != null) {
lColHref = new Href(mHref);
}
else {
HttpServletRequest request =
(HttpServletRequest)pageContext.getRequest();
String context = request.getContextPath();
lColHref = new Href(context + page);
}
...
</pre>
File: displaytag.tld
the column tag needs this added:
<attribute>
<name>page</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
then to use:
<display:column page="/$context/file.jsp" etc...
renders a context-aware link. There's probably a better way,
but it only takes 5 minutes and saves a lot of headaches.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=536616&aid=829859&group_id=73068
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel