How to be able to use a custom bean?


I would like to use my own Bean instead of FileManageActionsBean, in create_file.xhtml. I get the error “Target Unreachable”

What should I do to get through this?



0 votes

1 answers



Think to set a precedence higher than the default one.

See here in @Install / precedence section. You must see in logs a line like :

2013-06-14 07:19:49,517 INFO  [org.jboss.seam.Component] Component: authorizedApplicationsActions, scope: CONVERSATION, type: JAVA_BEAN, class: your.package.YourClassActionsBean.

But this is a bad idea, prefer to create your own bean with your own name and inject the FileManagerACtionsBean. You risk to move the application unstable if you are not about what you do.

0 votes

Before to replace any bean, I simply created a bean, and radio boxes <h:selectOneRadio id="choix" layout="lineDirection" value="Seam.Component.getInstance('CompressedFileManageActions').options" > …</h:selectOneRadio>

And I have in my public class CompressedFileManageActionsBean extends FileManageActionsBean implements Serializable

with getters and setters : public int getOptions() … public void setOptions(int options) … int options = 2;

I get no error, but the radio is not initialized (while it was when I set directly the value in the radio input).