Saudações, estou desenvolvendo um servlet de chat onde tenho o método doPost que entre suas diversas rotinas possue:
String[] values = req.getParameterValues("Fontes");
if (values != null) {
int length = values.length;
for (int i=0; i<length; i++) {
this.fonte = "<font face="" + values[i] + ""</font> sss";
getFonte();
O método getFonte est definido como:
public String getFonte(){
return this.fonte;
}
No inicio da classe criei o atributo fonte:
String fonte = “teste”;
O método getFonte chamo em outra servlet criando um objeto da classe onde está o getFonte e depois faço:
“Chat:” + OBJETODACLASSEGETFONTE.getFonte;
Mas está imprimindo “Teste” e não o valor pego em
this.fonte = “<font face=”" + values[i] + “”</font> sss";
getFonte();
Alguém sabe o que tem de errado?
