Skip to content

Commit

Permalink
Issue #2 use CDI annotations instead of soon-to-be-deprecated JSF ann…
Browse files Browse the repository at this point in the history
…otations
  • Loading branch information
stephanrauh committed May 30, 2015
1 parent 224ab68 commit c6894b2
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 314 deletions.
532 changes: 266 additions & 266 deletions pom.xml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main/java/net/bootsfaces/demo/BarcodeBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
*/
package net.bootsfaces.demo;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

/**
* This bean is used by the PrimeFaces barcode demo.
* @author Stephan Rauh, http://www.beyondjava.net
*/
@ViewScoped
@ManagedBean
@Named
public class BarcodeBean {
private String code39 = "1234567890128";
private String protocol = "http://";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/bootsfaces/demo/CarBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

package net.bootsfaces.demo;

import javax.faces.bean.ManagedBean;
import javax.inject.Named;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/** A simple bean for demo purposes. */
@javax.faces.bean.RequestScoped
@ManagedBean
@javax.enterprise.context.RequestScoped
@Named
public class CarBean {
@NotNull
private String brand=null;
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/net/bootsfaces/demo/ClockBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;

/**
* @author Stephan Rauh, http://www.beyondjava.net
*/
@ManagedBean
@Named
@RequestScoped
public class ClockBean implements Serializable {
private static final long serialVersionUID = 5497787734011747081L;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/net/bootsfaces/demo/DateBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@

import java.io.Serializable;
import java.util.Date;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
*
* @author TheCoder4eu
*/
@ManagedBean(name = "dateBean")
@Named
@RequestScoped
public class DateBean implements Serializable {
private Date adate;
private static final long serialVersionUID = -7642332089180105956L;
private Date adate;
private Date bdate;
private Date cdate;
private Date ddate;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/net/bootsfaces/demo/InformBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
*/

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
*
* @author TheCoder4eu
*/
@ManagedBean
@Named
@RequestScoped
public class InformBean implements Serializable {
private String firstname;
private static final long serialVersionUID = 3776366707374123185L;
private String firstname;
private String familyname;

public String getFirstname() {
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/net/bootsfaces/demo/ItemBean.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
package net.bootsfaces.demo;

/**
* Managed Bean for Items
* @author Thecoder4.eu
*/

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.enterprise.context.RequestScoped;
import javax.faces.model.ArrayDataModel;
import javax.faces.model.DataModel;
import javax.inject.Named;

/**
* Data Model Bean for Items
* @author Thecoder4.eu
*/
@ManagedBean
@Named
@RequestScoped
public class ItemBean {

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/net/bootsfaces/demo/LoremIpsumBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
*/

import java.util.StringTokenizer;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import javax.enterprise.context.RequestScoped;
import javax.faces.model.ArrayDataModel;
import javax.faces.model.DataModel;
import javax.inject.Named;

/**
* Data Model Bean for Items
* @author Thecoder4.eu
*/
@ManagedBean
@Named
@RequestScoped
public class LoremIpsumBean {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/bootsfaces/demo/PollDemoBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.util.Date;

import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.event.ActionEvent;
import javax.inject.Named;

@RequestScoped
@ManagedBean
@Named
public class PollDemoBean {

private int counter=0;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/bootsfaces/demo/SemaphoreBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
import java.util.List;
import java.util.Map;

import javax.faces.bean.ManagedBean;
import javax.inject.Named;
import javax.validation.constraints.NotNull;

/** A simple bean for demo purposes. */
@javax.faces.bean.RequestScoped
@ManagedBean
@javax.enterprise.context.RequestScoped
@Named
public class SemaphoreBean {
@NotNull
private String color = null;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/bootsfaces/demo/SettingsBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

package net.bootsfaces.demo;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/** A simple bean for demo purposes. */
@RequestScoped
@ManagedBean
@Named
public class SettingsBean {
private int value1;
private int value2;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/net/bootsfaces/demo/TestBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@
*/

import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

/**
*
* @author TheCoder4eu
*/
@ManagedBean(name = "testBean")
@Named
@RequestScoped
public class TestBean implements Serializable {
private int val1=78;
private static final long serialVersionUID = -332002335165889800L;
private int val1=78;
private int val2=87;
private int val3=34;
private int val4=43;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ComponentSystemEvent;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

@ManagedBean
@Named
@ViewScoped
public class SoccerTeamBean implements Serializable {
private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;

import javax.inject.Named;

import org.primefaces.context.RequestContext;
import org.primefaces.event.SelectEvent;

@ManagedBean
@Named
public class CalendarView {

private Date date1;
Expand Down
5 changes: 5 additions & 0 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<!--param-value>Production</param-value -->
<param-value>Development</param-value>
</context-param>
<!-- deactivate the magic of AngularFaces which would prevent us from rendering BootsFaces messages -->
<context-param>
<param-name>clientSideMessages</param-name>
<param-value>false</param-value>
</context-param>
<!-- The BootsFaces_USETHEME context-param controls the loading of the bootstrap-theme.css -->
<!-- The default is false, when set to true the bootstrap-theme.css will be loaded -->
<context-param>
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/applayout/navbartop.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<b:navLink value="Check box" outcome="/forms/checkBox" />
<b:navLink value="Combobox (SelectOneMenu)" outcome="/forms/selectOneMenu" />
<b:navLink value="Poll" outcome="/forms/poll" iconAwesome="refresh" />
<b:navLink value="Messages" outcome="/forms/messages" iconAwesome="refresh" />
</b:dropMenu>
<b:dropMenu value="Bootstrap Widgets">
<b:navLink value="Alerts" outcome="/bootstrap/alerts" icon="warning-sign" />
Expand Down

0 comments on commit c6894b2

Please sign in to comment.