neharob / prettyfaces

Automatically exported from code.google.com/p/prettyfaces
0 stars 0 forks source link

Support parent URLMapping action and query parameters being inherited by children #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. In a "root" managed bean, place a URLMapping as well as a URLAction.
2. In a "child" managed bean, place a URLMapping with parentId attribute 
specifying the "root" managed bean.

What is the expected output? What do you see instead?
The root URLAction is not called by child managed bean.

What version of PrettyFaces are you using? 
Latest snapshot: 3.1.1
On what server and version, version of JSF, and other relevant technologies? 
Tomcat + jsf 1.2

Original issue reported on code.google.com by bal...@gmail.com on 17 Nov 2010 at 4:43

GoogleCodeExporter commented 9 years ago
As stated in the docs, this is not a supported feature at the moment. If you 
wish to inherit actions, you should write a ConfigurationPostProcessor (and 
consider contributing it to the PrettyFaces codebase.)

Please see the docs here: 
http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/Configuration.html#confi
g.mapping.parents

http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/Extensions.html#Configur
ationPostProcessor

We would like to support this feature, but there needs to be more control over 
which actions are inherited because it is not usually desirable in most 
situations. Individual actions need to be inheritable or un-inheritable, and 
control of this needs to be clear.

Original comment by lincolnb...@gmail.com on 18 Nov 2010 at 10:28

GoogleCodeExporter commented 9 years ago

Original comment by lincolnb...@gmail.com on 15 May 2011 at 6:36

GoogleCodeExporter commented 9 years ago
We should do this for query parameters as well.

Original comment by chkalt on 12 Jul 2011 at 9:43

GoogleCodeExporter commented 9 years ago
Hey all,

I just implemented inheritance for query parameters and URL actions. By now it 
should be available in the current snapshots.

Unfortunately I haven't noticed Lincolns comment regarding the enhanced control 
for inheritance of URL actions until now. The just committed code simply 
inherits all actions of a parent mapping to the child mapping. I also think 
that users will expect this behavior so it will be OK for now.

How should we make this configurable? We could add an attribute to the action 
element like this:

<url-mapping id="parent">
  <pattern value="/parent" />
  <view-id value="/parent.jsf" />
  <action inheritable="false">#{myBean.parentAction}</action>
</url-mapping>

<url-mapping id="child" parentId="parent">
  <pattern value="/child"/>
  <view-id value="/child.jsf" />
</url-mapping>

In this example the child mapping won't inherit the action from the parent. I 
think the default should be "true". 

What do you think?

Original comment by chkalt on 16 Jul 2011 at 7:21

GoogleCodeExporter commented 9 years ago
lets just default to include everything. we can add finer control if something 
becomes an issue :) i think i was a little over excited about this when i 
thought it up.

Original comment by lincolnb...@gmail.com on 18 Jul 2011 at 2:35

GoogleCodeExporter commented 9 years ago
Hey there!

As people seemed to be confused by actions being inherited per default, I did 
some more work on this. I added a new attribute named "inheritable" to the URL 
actions. The default value of this attribute is false which means, that child 
mappings won't inherit the action. If you want an action to be inherited, 
simply set the attribute to true.

I think this is fine! I added this feature to the master branch and backported 
it to 3.x (which was very easy).

Christian

Original comment by chkalt on 2 Oct 2011 at 1:50