...So i've got my @ApplicationScoped Bean "Application"..:
@ManagedBean(name = "Application")
@ApplicationScoped
public class Application implements Serializable {
private boolean isRunning = false;
private ArrayList<Feed> sentNotifications = new ArrayList<>();
private ArrayList<String> emails = new ArrayList<>(
Arrays.asList("f00@b4r.com", "test@test.com")
);
private LinkedList<String> words = new LinkedList<>(
Arrays.asList("vuln","banana","pizza","bonanza")
);
private LinkedList<String> feeds = new LinkedList<>(
Arrays.asList("http://www.kb.cert.org/vulfeed",
"https://ics-cert.us-cert.gov/advisories/advisories.xml",
"https://ics-cert.us-cert.gov/alerts/alerts.xml")
);
...and want to add a String to ArrayList<String> emails
using the method:
public String addEmail(String email) {
emails.add(email);
return null;
}
The Facelet goes as follows:
<!-- EMAILS -->
<h3>Configured Emails</h3>
<h:form>
<h:inputText value="Email" var="email"/>
<h:commandButton value="Add Email" action="#{Application.addEmail(email)}"/>
</h:form>
<h:form>
<ui:repeat var="email" value="#{Application.emails}">
<tr>
<td>#{email}</td>
<td>
<f:facet name="header">Action</f:facet>
<h:commandLink value="Delete" action="#{Application.rmEmail(email)}"/>
</td>
</tr>
<br></br>
</ui:repeat>
</h:form>
...so when i try to add "blabla@bla.com", this is the Result:
- There is a delete-button shown, but not the String itself?!
- Is the String correctly added - and JSF doesnt rerender the view..?
- ..Or is the String not added correctly?
please help! thanks.