It sounds like you're saying that a goLink should be an action, but an iframe should be a resource? I've always assumed the two should be identical.
The Javadoc for ExternalContext is incredibly unhelpful here. I wish the IBM EG member who contributed that API had made this clear back then! Especially confusing is the text: Portlet: This must be the value returned by the javax.portlet.PortletResponse method encodeURL(url). ... included on *both* encodeActionURL() and encodeResourceURL(). This makes it sound as though the two are required to have exactly the same behavior!?! -- Adam On 6/14/07, Scott O'Bryan <[EMAIL PROTECTED]> wrote:
I agree with Adam. The distinction is NOT post vs. get, rather the distinction is something that's a piece of a page v.s something that's a complete page. So what's the difference. The difference is that the Portal sees action urls as needing to be posted in context of the main page. On an action url, the portal will process all other portlets as well and return a page with markup generated from the portal (not directly from the portlet). With resource urls, the portal doesn't muck with anything. Now Faces somewhat confuses this issue as there is an encode for both the action and the resource URL. I can tell you that, in general, JSR-168 would expect you to encode goLinks as stuff as "action" urls. The encode action url method in 301 is smart enough to figure out whether the resource your trying to reference is a Faces viewId or some other external page. If it's an external url the encoded url will hit that resource directly. If it's a faces page, the bridge will generate an actionUrl that will make a request to the new view id through the bridge. Without encoding this as an action url though, you would loose all of your portal context. There are some instances where you may want to use a resource url (iframes and PPR are a perfect example), but usually links should be action urls. Scott Adam Winer wrote: > I don't see why - what is the difference between > a link to a page and an iframe pointing at that page? > It's exactly the same HTTP request. If <a href> > should use getActionUrl(), then iframe and frame > srcs also should. > > -- Adam > > > On 6/13/07, Jesse Alexander (KSFD 121) > <[EMAIL PROTECTED]> wrote: >> Adam mentions iframe/frame-src attributes... I guess those would >> qualify as resource-url's ? >> >> regards >> Alexander >> >> -----Original Message----- >> From: Martin Marinschek [mailto:[EMAIL PROTECTED] >> Sent: Thursday, June 14, 2007 6:25 AM >> To: MyFaces Development >> Subject: Re: Portlets & <a href="">: resource or action URL? >> >> Definitely encodeActionUrl, yes, from what I read in the portlet spec. >> Obviously the original link implementors thought the distinction was >> about form post versus get - but the distinction is about query >> links/form submissions versus inclusion of resources in the page. >> >> regards, >> >> Martin >> >> On 6/14/07, Adam Winer <[EMAIL PROTECTED]> wrote: >> > Simple (I imagine) question: >> > >> > For a link's "href", should we be calling encodeResourceURL() >> > or encodeActionURL()? >> > >> > I've always assumed these are action URLs. I see other >> > code out there (MyFaces outputLink, for example) that >> > considers these resource URLs. >> > >> > (Whatever answer we arrive at should apply equally to >> > iframe and frame "src" attributes, I believe). >> > >> > -- Adam >> > >> >> >> -- >> >> http://www.irian.at >> >> Your JSF powerhouse - >> JSF Consulting, Development and >> Courses in English and German >> >> Professional Support for Apache MyFaces >> >
