in creating a JSF my java class with a method to generate random numbers is not working
package com.token;
``import java.util.Random;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean
@SessionScoped
public class cToken {
private String TokenValue;
public String getTokenValue() {
return TokenValue;
}
public void setTokenValue(String TokenValue) {
this.TokenValue = TokenValue;
}
public String myRand(){
String displayThis = null;
//note a single Random object is reused here
Random randomGenerator = new Random();
for (int idx = 1; idx <= 10; ++idx){
int randomInt = randomGenerator.nextInt(100);
displayThis = "" + randomInt;
}
return displayThis;
}
}
This code is what is writren in the java class file cToken for the jsf application that i was writing Kindly look into this and assist me in finding out this code does not wrk
Aucun commentaire:
Enregistrer un commentaire