views:

249

answers:

3

I was wondering if is it possible to external link - something like domain.tld/jsfview - to a specific jsf view/page.

I don't want the start page of my jsf app, which would be triggered by

 <navigation-rule>
  <navigation-case>
   <from-outcome>start</from-outcome>
   <to-view-id>/jsf/index.xhtml</to-view-id>
  </navigation-case>
 </navigation-rule>

Tried this config

 <navigation-rule>
  <navigation-case>
   <from-outcome>reminder</from-outcome>
   <to-view-id>/jsf/remind/index.xhtml</to-view-id>
  </navigation-case>
 </navigation-rule>

But I only getting a redirect to my startpage.

I forgot one important thing to mention: The JSF app is running in a portal enviorment with the jboss portlet bridge

+1  A: 

I'm not sure what you mean. Do you mean, you want to link from an external site to a page in your JSF application?

In your example, you could link to /jsf/remind/index.faces (or whatever extension you have the JSF servlet mapped as) and it should load up your page.

Not sure if I have misunderstood you though!

Phill Sacre
You got me right Phil - link to a specific page in my JSF app. Thats my problem: it doesn't load the page. I only get my start page
asrijaal
A: 

I've found the solution due my JSF app is in a portal enviorment used with a portlet bridge, there seems no way to link to a JSF page directly.

I solved my problem with a workaround - sure this may not fit other similiar problems:

I'm using the porlet modes to direct linking the page from outer sources.

 <init-param>
   <name>javax.portlet.faces.defaultViewId.edit</name>
   <value>/jsf/remind/index.xhtml</value>
 </init-param>

Don't get me wrong: If I'm in my JSF app <h:outputLink /> everything works as excepted.

asrijaal
A: 

The init parameters javax.portlet.faces.defaultViewId.[mode] can be used to set the initial view for each mode.

You can probably create a bookmarkable URL to a different view utilising FACES_VIEW_ID_PARAMETER ("_jsfBridgeViewId" - assuming JSR 329; I haven't looked at JSR 301).

McDowell