You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by lightbulb432 <ve...@hotmail.com> on 2007/05/16 17:35:00 UTC

DEFAULT_SUFFIX with outputLink

What does javax.faces.DEFAULT_SUFFIX do? I was under the impression that when
I have an h:outputLink pointing to something that ends in the DEFAULT_SUFFIX
(e.g. xhtml), the link gets output not with “.xhtml”, but with “.jsf”, for
example, if the servlet mapping to the Faces Servlet ends in that.

However, that doesn’t seem to work with my h:outputLink. I hope I don’t have
to output it with h:commandLink to get it to work, because h:commandLink
uses JavaScript (which I can’t use)…is there some other way to make this
work, or perhaps I’m misunderstanding something?

Thanks. 
-- 
View this message in context: http://www.nabble.com/DEFAULT_SUFFIX-with-outputLink-tf3765321.html#a10644237
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: DEFAULT_SUFFIX with outputLink

Posted by Bryan Basham <bb...@stillsecure.com>.
Hi,

I just started using this config parameter.

What I have discovered is that this is used when a JSF request
is being processed (not an h:outputLink but an h:form).  The
request URL ends in .jsf but the actually JSP file ends in .jsp
so the normal behavior is for JSF to lookup the view by changing
the request URL/URI from xyz.jsf to xyz.jsp.  Now suppose that
you want to use pure XML for the JSP pages; therefore, you might
want to use the .jspx extension.  This config param allows you to
tell JSF to convert xyz.jsf to xyz.jspx.

Make sense?

BTW, once you change this suffix, then *all* of your JSF view
files *must* use this suffix.  So, for example, you cannot mix .jsp
and .jspx files in JSF processing.  I imagine it would be possible
to create a special ViewHandler which makes the right choice
for changing the suffix, but after a few hours of hacking I gave up.
Has anyone else solved this particular problem?

Cheers,
Bryan

lightbulb432 wrote:
> What does javax.faces.DEFAULT_SUFFIX do? I was under the impression that when
> I have an h:outputLink pointing to something that ends in the DEFAULT_SUFFIX
> (e.g. xhtml), the link gets output not with “.xhtml”, but with “.jsf”, for
> example, if the servlet mapping to the Faces Servlet ends in that.
>
> However, that doesn’t seem to work with my h:outputLink. I hope I don’t have
> to output it with h:commandLink to get it to work, because h:commandLink
> uses JavaScript (which I can’t use)…is there some other way to make this
> work, or perhaps I’m misunderstanding something?
>
> Thanks. 
>