[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-356) Session bean assertions
by Vladimir Ralev (JIRA)
[ http://jira.jboss.com/jira/browse/JBSEAM-356?page=comments#action_12359742 ]
Vladimir Ralev commented on JBSEAM-356:
---------------------------------------
Hi Gavin.
I am looking at this task and there are a few things:
1. Do you think these conditions should be checked after injection (this also makes sense), or immediately after the postconstruct/aroundinvoke?
2. The hibernate validator annotations are can't be bound to method params. Did you mean to fork the hibernate validator in the seam project (say seam.validator)?
3. Method return value check annotation is ambigious - two cases:
@NotNull String getSomething() // getters represent the object state and should be checked (and invoked) on each method call and postconstruct
@NotNull String doSomething() // "doers" should be checked only when they are actually invoked
May be using some heuristics to branch based on ( methodName.beginsWith("get") || methodName.beginsWith("is") ) , but that's not very reliable because someone may still code side-effects in a getter.
I have implemented the postconstruct/aroundinvoke version using the orignal hibernate validator, which would work fine unless you really the method param validation.
> Session bean assertions
> -----------------------
>
> Key: JBSEAM-356
> URL: http://jira.jboss.com/jira/browse/JBSEAM-356
> Project: JBoss Seam
> Issue Type: Feature Request
> Components: Core
> Reporter: Gavin King
>
> For people who like more of a design-by-contract style, we could let you specify Hibernate Validator annotations on the session bean, and check them after @PostConstruct and before and after each business method.
> eg.
> @Stateful
> public class Foo {
> @NotNull private Bar bar;
> @Min(0) int count;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 8 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1151) Embedded plugin Facelets drop values during postback
by Christian Bauer (JIRA)
Embedded plugin Facelets drop values during postback
----------------------------------------------------
Key: JBSEAM-1151
URL: http://jira.jboss.com/jira/browse/JBSEAM-1151
Project: JBoss Seam
Issue Type: Bug
Components: Wiki
Reporter: Christian Bauer
Assigned To: Pete Muir
Priority: Blocker
Pete, as discussed on IM and posted here so we can coordinate what needs to be done:
The wiki includes Facelets manually into the facelet tree when a plugin is encountered during page rendering. This is done in two phases, through a ComponentHandler when the facelet tree is build and through a custom component that renders the HTML for the tree manually. This seems to work fine visually, and the view tree looks OK.
However, if such an included facelet contains a form, on postback of this form the tree is rebuild during RENDER RESPONSE and any invalid component from the earlier VALIDATIONS phase is lost. So we never see entered invalid values in the form again. This can be tested with the "user comment" form on the wiki.
The interesting thing here is that it works perfectly fine for the plugin settings forms, you can see those if you edit a document, and enable the preview and plugin settings checkboxes. These forms are much more complicated than the "user comment" form, so I haven't touched them to find out why it works in that case. The trivial "user comment" form should be easier to debug...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 8 months