I have the following code and whatever I do my web browser does not render any submit button.
I am using eclipse with Glassfish.
The problem is also that somehow when I try my examples fast , the server sometimes hangs around and browser is in the waiting mode for minutes without any error or anything.
Sometimes it does give the page away and it works perfect.
Why is the button not shown and my server is so unstable?
<h:head><title>JSF 2: Using @ManagedBean</title>
<link href="./css/styles.css"
rel="stylesheet" type="text/css"/>
</h:head>
<h:body>
<div align="center">
<table class="title">
<tr><th>JSF 2: Using @ManagedBean</th></tr>
</table>
<p/>
<fieldset>
<legend>Random Results Page</legend>
<h:form>
Press button to get one of three possible results pages.
<br/>
<h:commandButton value="Go to Random Page" action="#{navigator.choosePage}" />
</h:form>
</fieldset>
</div>
package coreservlets;
import javax.faces.bean.*;
@ManagedBean
@ApplicationScoped
public class Navigator {
private String[] resultPages =
{ "page1", "page2", "page3" };
public String choosePage() {
return(RandomUtils.randomElement(resultPages));
}
}