-
1. Re: URL Friendly Links
trippccn Apr 6, 2006 2:47 AM (in response to trippccn)
My bad I jumped the gun... can someone just point me to the FAQ on this subject? I couldn't find it in the Wiki.
chad -
2. Re: URL Friendly Links
mirko27 Apr 6, 2006 2:48 AM (in response to trippccn)<h:outputlink>
<f:param../>
</h:outputlink/> ? -
3. Re: URL Friendly Links
gavin.king Apr 6, 2006 6:47 AM (in response to trippccn)Or, with Seam CVS, try:
<s:link value="#{user.name}" action="#{UserSelect.select}"> <f:param name="id" value="#{user.id}"/> </s:link>
I plan to add a whole new page to the Seam refdoc about this.... -
4. Re: URL Friendly Links
trippccn Apr 7, 2006 12:59 AM (in response to trippccn)
Ok so I got it to work with @Factory, but I can only link back to the same page. Is there a way to link to another JSP page and still access the outjected variable? -
5. Re: URL Friendly Links
mirko27 Apr 7, 2006 1:03 AM (in response to trippccn)s:link element has parameters. It seems to me that default just creates new conversation. You can use
<s:link propgragation="join"/>.
I think this should work. -
6. Re: URL Friendly Links
gavin.king Apr 7, 2006 7:46 AM (in response to trippccn)"TrippCCN" wrote:
Ok so I got it to work with @Factory, but I can only link back to the same page. Is there a way to link to another JSP page and still access the outjected variable?<s:link view-id="/nextPage.xhtml" action="#{myAction.method}" value="Button Label" propagation="true"/>
Note that you have a choice:
* specify view-id, and write a void action method
* don't specify view-id and return an outcome from the action method
* specify view-id, and return null from the action method if you want that view-id to be rendered, or some other outcome if you want a different view-id
Pretty flexible :-) -
7. Re: URL Friendly Links
d1g Apr 7, 2006 12:33 PM (in response to trippccn)Hi. This new Seam link tag solves a few problems I had. Thanks! There is one thing missing from my point of view though. I would like to specify custom urls with this tag.
I have been using url rewriting (in and out) to make make friendly URLs for our Seam based application. E.g /myfolder/something/ gets rewritten to /thing.seam?a=myfolder&b=something.
Would it be possible to add a new attribute to the link tag that enables me to override the detected URL? How about 'link' as the attribute. Here is an example:<s:link value="view" link="#{mycomponent.niceUrl}"/>
We would still be able to use all the other attributes. To prove that this works I coded a change to your HtmlLink class. Here is the segment prior to my change:String url = context.getApplication().getViewHandler().getActionURL(context, viewId); String encodedUrl = context.getExternalContext().encodeActionURL(url)
And this is my version:
String encodedUrl = null; ValueBinding linkValueBinding = getValueBinding("link"); if (linkValueBinding != null) { // link from expression encodedUrl = linkValueBinding.getValue(context).toString(); } if ((encodedUrl == null) && (link != null)) { // plain text links encodedUrl = link; } if (encodedUrl == null) { // just get url from context String url = context.getApplication().getViewHandler().getActionURL(context, viewId); encodedUrl = context.getExternalContext().encodeActionURL(url); }
Clearly I had to do all the extra stuff to add in the 'link' attribute to the tag.
This change works perfectly for me. There may be a better way to do this and I'm not fully up-to-speed on the JSF API. I should probably have encoded the URL and there may be other problems...
Anyway, over to you. Is it possible to add in this functionality? Many thanks. -
8. Re: URL Friendly Links
gavin.king Apr 14, 2006 4:31 PM (in response to trippccn)Add a feature request to JIRA, with a bit more details about how I should go about implementing this.
-
9. Re: URL Friendly Links
trippccn Apr 15, 2006 10:58 PM (in response to trippccn)How do I get the s:link tag to work? I downloaded the nightly build, copied over jboss-seam.jar, and added
<%@ taglib uri="http://jboss.com/products/seam/taglib" prefix="s" %>
But I'm sure I'm missing something... i get the error:taglib cannot be resolved in either web.xml or the jar files deployed with this application
I've never used a nightly build, what am I missing?
Thanks, Chad -
10. Re: URL Friendly Links
lcoetzee Apr 16, 2006 1:38 PM (in response to trippccn)You also need the jboss-seam-ui.jar (which also gets compiled when you build seam from CVS). This jar needs to be packaged in you WAR.
L -
11. Re: URL Friendly Links
trippccn Apr 16, 2006 8:18 PM (in response to trippccn)I compiled from CVS and overwrote the old jboss-seam-ui.jar and still the same error.
17:16:09,328 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /charities/find.jsp(1,1) The absolute uri: http://jboss.com/products/seam/taglib cannot be resolved in either web.xml or the jar files deployed with this application