HTML and CSS Reference
In-Depth Information
The user will be able to select the type of text to generate (Text Type), how the output is formatted (Output Tag),
how much generated text should be outputted (Count), and the minimum and maximum number of words in each
chunk of generated text (Min words and Max words). Clicking the “Generate” button will invoke the component and
generate the text based on the values in the input controls.
We will need a managed bean to keep the values in the input controls. The managed bean can be seen in
Listing 6-10.
Listing 6-10.—Session-Scoped Managed Bean for Keeping the Values of the Input Controls
package com.apress.projsf2html5.chapter6.beans;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
@Named(value = "example")
public class Example implements Serializable {
private String textType = "gibberish";
private String outputTag = "p";
private Integer count = 10;
private Integer minWords = 5;
private Integer maxWords = 10;
public String getTextType() {
return textType;
public void setTextType(String textType) {
this.textType = textType;
public String getOutputTag() {
return outputTag;
public void setOutputTag(String outputTag) {
this.outputTag = outputTag;
public Integer getCount() {
return count;
public void setCount(Integer count) {
this.count = count;
Search WWH ::

Custom Search