PAGUE 6 MESES
LEVE 12 MESES
GARANTIR DESCONTO

Fórum javax.servlet.ServletException #534790

17/10/2015

0

Olá pessoal!

Estou estudando JSF, mas me deparei com um erro chato aqui.. este:
javax.servlet.ServletException: /WEB-INF/partials/instrutor-info.xhtml @9,54 value="Nome: #{instrutor.nome} ": The class 'java.lang.String' does not have the property 'nome'.

Pesquisei diversos foruns(stackoverflow, GUJ, developer.salesforce), inclusive este aqui, com erros parecidos, ou até igual, mas as soluções não funcionaram.


Vocês tem ideia do que possa ser?


package br.com.k19.modelo;
//This class is the definition of an Instructor.
public class Instrutor {
	
	
	//ATRIBUTTES
	private String nome;
	private String dataNascimento;
	
	
	
	//GETTERS AND SETTERS
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public String getDataNascimento() {
		return dataNascimento;
	}
	public void setDataNascimento(String dataNascimento) {
		this.dataNascimento = dataNascimento;
	}

}





package br.com.k19.controle;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import br.com.k19.modelo.Instrutor;

@ManagedBean
@RequestScoped
public class InstrutorBean implements Serializable {
	//AUTO
	private static final long serialVersionUID = 1L;
	
	
	
	//ATRIBUTTES
	private List<Instrutor> instrutores = new ArrayList<Instrutor>();
	
	
	
	
	//CONSTRUCTORS
	public InstrutorBean(){
		Instrutor rafael = new Instrutor();
		rafael.setNome("Rafael Consentino");
		rafael.setDataNascimento("30/10/1984");
		
		Instrutor marcelo = new Instrutor();
		marcelo.setNome("Marcelo Martins");
		marcelo.setDataNascimento("02/04/1985");
		
		this.instrutores.add(rafael);
		this.instrutores.add(marcelo);
	}
	
	
	
	//GETTERS AND SETTERS
	public List<Instrutor> getInstrutores() {
		return instrutores;
	}

	public void setInstrutores(List<Instrutor> instrutores) {
		this.instrutores = instrutores;
	}
}



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	
	
	<li>
		<h:outputText value = "Nome: #{instrutor.nome} " />
		<br/>
		<h:outputText value="Data de Nasc: #{instrutor.dataNascimento}" />
	
	</li>

</ui:composition>



<ui:composition template="/WEB-INF/templates/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:define name="conteudo">

		<ul>

			<ui:repeat value="#{instrutorBean.instrutores}" var="instrutor">

				<ui:include src="/WEB-INF/partials/instrutor-info.xhtml">

					<ui:param name="instrutor" value=" #" />

				</ui:include>

			</ui:repeat>

		</ul>

	</ui:define>

</ui:composition>



STACKTRACE
Context Path:
/K19-Templates-e-Modularizacao

Servlet Path:
/listagem-de-instrutores.xhtml

Path Info:
null

Query String:
null

Stack Trace
javax.servlet.ServletException: /WEB-INF/partials/instrutor-info.xhtml @9,54 value="Nome: #{instrutor.nome} ": The class 'java.lang.String' does not have the property 'nome'.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
Tarcio Nieri

Tarcio Nieri

Responder

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar