[forge-issues] [JBoss JIRA] (FORGE-1595) Being able to create an empty JSF backing bean

Antonio Goncalves (JIRA) issues at jboss.org
Tue May 6 15:28:56 EDT 2014


     [ https://issues.jboss.org/browse/FORGE-1595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Goncalves reassigned FORGE-1595:
----------------------------------------

    Assignee: Antonio Goncalves


> Being able to create an empty JSF backing bean
> ----------------------------------------------
>
>                 Key: FORGE-1595
>                 URL: https://issues.jboss.org/browse/FORGE-1595
>             Project: Forge
>          Issue Type: Sub-task
>          Components: Scaffold
>    Affects Versions: 2.0.0.Final
>            Reporter: Antonio Goncalves
>            Assignee: Antonio Goncalves
>            Priority: Minor
>             Fix For: 2.x Future
>
>
> At the moment the only way to generate JSF backing beans is with scaffolding. To save time and help the developer in creating new backing beans, it would be good to have a command such :
> {code}
> faces-new-bean --named MyBean
> {code}
> This will create a {{MyBean}}, of scope request, under the {{view}} package. You could also give a different sub-package with :
> {code}
> faces-new-page --named MyBean --targetPackage view.admin
> {code}
> This will create the page under {{view/admin/MyBean.java}}. 
> {code}
> @Named
> @RequestScoped
> public class MyBean {
> }
> {code}
> Then, depending on the scope, the generated code would be different (e.g. implements Serializable for most of the other stateful scopes)
> {code}
> faces-new-bean --named MyBean --scoped Conversation
> {code}
> This would generate the following code
> {code}
> @Named
> @ConversationScoped
> public class MyBean implements Serializable {
>   @Inject
>   private Conversation conversation;
>   public String begin() {
>     conversation.begin();
>   }
>   public String end() {
>     conversation.end();
>   }
> }
> {code}
> PS : I'm on holidays skiing, and the internet connection is really bad. So I could search for similar JIRAs if they existed



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the forge-issues mailing list