开发者

JSF external linking

开发者 https://www.devze.com 2022-12-17 08:47 出处:网络
I was wondering if is it possible to external link - something like domain.tld/jsfview - to a specific jsf view/page.

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


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!


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消