Help...da erro de pagina 404 ...em jsf 1.2

Olá,

já debugei entra no metodo mais não chama a pagina xhtml e não da erro …

Não sei o que pode ser…
na pagina abaixo quando clico no botão Adicionar Pergunta professor
pergunta_professor_listar.xhtml entra no metodo mais não chama a proxima pagina
que é pergunta_professor_editar.xhtml

Não entendi…e não d erro ???


<div style="padding: 10px; text-align: right;">
<t:commandButton value="Adicionar Pergunta Professor" action="#{perguntaProfessorMB.preIncluir}" />
<t:commandButton  title="Limpar" tabindex="1" styleClass="botaoComun" value="Limpar" id="F2"/>

<t:commandButton  title="Pesquisar" tabindex="2" styleClass="botaoComun" value="Pesquisar" id="F3"/>

</div>

<rich:panel  styleClass="richPanelStyleClass" bodyClass="richPanelBodyClass" headerClass="richPanelHeaderClass">
<rich:dataTable  width="100%" summary="Lista de perguntaProfessorMB.perguntaProfessor" styleClass="richDataTableStyleClass" value="#{perguntaProfessorMB.listPerguntaProfessor}" headerClass="richDataTableHeaderClass" rowClasses="richDataTableRowClassFirst, richDataTableRowClassSecond" columnClasses="richDataTableColumnClass" var="element" rowKeyVar="row" id="elementList">
<rich:column >
<f:facet  name="header">
<t:outputText  value=" "/>
</f:facet>
<t:outputText  styleClass="outputText" value="#{row+1}"/>
</rich:column>
<rich:column >
<f:facet  name="header">
<t:outputText  value="Pergunta do Professor"/>
</f:facet>
<t:outputText  styleClass="outputText" value="#{element.pergunta}"/>
</rich:column>
<rich:column >
<f:facet  name="header">
<t:outputText  value="Alterar"/>
</f:facet>
<a4j:commandLink  title="Alterar" tabindex="3" value="Alterar" action="#{perguntaProfessorMB.preAlterar}">
<f:setPropertyActionListener  target="#{perguntaProfessorMB.perguntaProfessor}" value="#{element}"/>
</a4j:commandLink>
</rich:column>
<rich:column >
<f:facet  name="header">
<t:outputText  value="Excluir"/>
</f:facet>
<a4j:commandLink  title="Excluir" tabindex="4" value="Excluir" action="#{perguntaProfessorMB.preExcluir}">
<f:setPropertyActionListener  target="#{perguntaProfessorMB.perguntaProfessor}" value="#{element}"/>
</a4j:commandLink>
</rich:column>
</rich:dataTable>
</rich:panel>

</h:form>

</ui:define>

</ui:composition>

</html>

se alguém puder me ajudar agradeço…

abs

<navigation-rule>
    <!--RegraPerguntaProfessor-->
    <navigation-case>
      <from-outcome>pergunta_professor_listar</from-outcome>
      <to-view-id>/private/pages/pergunta_professor_listar.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>pergunta_professor_editar</from-outcome>
      <to-view-id>/private/pages/pergunta_professor_editar.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>pergunta_professor_visualizar</from-outcome>
      <to-view-id>/private/pages/pergunta_professor_visualizar.xhtml</to-view-id>
    </navigation-case>
  </navigation-rule>
    <managed-bean>
    <managed-bean-name>perguntaProfessorMB</managed-bean-name>
    <managed-bean-class>ao.edu.imag.avalia.view.managedbean.PerguntaProfessorMB</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>
 
public class PerguntaProfessorMB extends AbstractManagedBean {
	@Injection
	private IPerguntaProfessorBC perguntaProfessorBC;
	private PerguntaProfessor perguntaProfessor = new PerguntaProfessor();
	private PagedResultDataModel<PerguntaProfessor> listPerguntaProfessor;

	public IPerguntaProfessorBC getPerguntaProfessorBC() {
		return this.perguntaProfessorBC;
	}

	public void setPerguntaProfessorBC(IPerguntaProfessorBC arg0) {
		this.perguntaProfessorBC = arg0;
	}

	public PerguntaProfessor getPerguntaProfessor() {
		return this.perguntaProfessor;
	}

	public void setPerguntaProfessor(PerguntaProfessor arg0) {
		this.perguntaProfessor = arg0;
	}

	public PagedResultDataModel<PerguntaProfessor> getListPerguntaProfessor() {
		return this.listPerguntaProfessor;
	}

	public void setListPerguntaProfessor(PagedResultDataModel<PerguntaProfessor> arg0) {
		this.listPerguntaProfessor = arg0;
	}

	public String incluir() {
		try {
			perguntaProfessorBC.incluir(perguntaProfessor);
			for (IMessage imsg : WebMessageContext.getInstance().getMessages()) {
			addMessage(imsg);
			}
			} catch (ApplicationRuntimeException e) {
			addMessage(e.getObjectMessage(), e);
			}
			WebMessageContext.getInstance().clear();
		
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_EDITAR;
	}

	public String alterar() {
		try {
			perguntaProfessorBC.alterar(perguntaProfessor);
			for (IMessage imsg : WebMessageContext.getInstance().getMessages()) {
			addMessage(imsg);
			}
			} catch (ApplicationRuntimeException e) {
			addMessage(e.getObjectMessage(), e);
			} WebMessageContext.getInstance().clear();
		
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_EDITAR;
	}

	public String excluir() {
		
		try {
			perguntaProfessorBC.excluir(perguntaProfessor);
			atualizaListaPerguntaProfessor();
			for (IMessage imsg : WebMessageContext.getInstance().getMessages()) {
			addMessage(imsg);
			}
			} catch (ApplicationRuntimeException e) {
			addMessage(e.getObjectMessage(), e);
			} WebMessageContext.getInstance().clear();
			
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_LISTAR;
	}

	public String listar() {
		atualizaListaPerguntaProfessor();
		
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_LISTAR;
	}

	public String filtrar() {
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_LISTAR;
	}

	public String preIncluir() {
		perguntaProfessor = new PerguntaProfessor();
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_EDITAR;
	}

	public String preAlterar() {
		try{
			perguntaProfessor = perguntaProfessorBC.buscar(perguntaProfessor);
			}catch (ApplicationRuntimeException e) {
			addMessage(e.getObjectMessage(), e);
			} 
		return AliasNavigationRule.ALIAS_PERGUNTA_PROFESSOR_EDITAR;
	}

public class AliasNavigationRule {
	public static final String ALIAS_PERGUNTA_ALUNO_LISTAR = "pergunta_aluno_listar";
	public static final String ALIAS_PERGUNTA_ALUNO_EDITAR = "pergunta_aluno_editar";
	public static final String ALIAS_PERGUNTA_ALUNO_VISUALIZAR = "pergunta_aluno_visualizar";
	
	
	public static final String ALIAS_PERGUNTA_PROFESSOR_LISTAR = "pergunta_professor_listar";
	public static final String ALIAS_PERGUNTA_PROFESSOR_EDITAR = "pergunta_professor_editar";
	public static final String ALIAS_PERGUNTA_PROFESSOR_VISUALIZAR = "pergunta_professor_visualizar";
}

posta seu facesconfig.xml inteiro, provavelmente o problema é nele…


<faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" version="1.2">
  <!-- Facelets Configuration-->
  <application>
    <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
  </application>
  <!-- 
	<managed-bean>
		<managed-bean-name></managed-bean-name>
		<managed-bean-class></managed-bean-class>
		<managed-bean-scope></managed-bean-scope>
	</managed-bean>
	...
	 -->
  <!-- 
	<navigation-rule>
		<navigation-case>
			<from-outcome></from-outcome>
			<to-view-id></to-view-id>
		</navigation-case>
		...
	</navigation-rule>
	-->
  <navigation-rule>
    <!--RegraPerguntaAluno-->
    <navigation-case>
      <from-outcome>pergunta_aluno_listar</from-outcome>
      <to-view-id>/private/pages/pergunta_aluno_listar.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>pergunta_aluno_editar</from-outcome>
      <to-view-id>/private/pages/pergunta_aluno_editar.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>pergunta_aluno_visualizar</from-outcome>
      <to-view-id>/private/pages/pergunta_aluno_visualizar.xhtml</to-view-id>
    </navigation-case>
  </navigation-rule>
  <managed-bean>
    <managed-bean-name>perguntaAlunoMB</managed-bean-name>
    <managed-bean-class>ao.edu.imag.avalia.view.managedbean.PerguntaAlunoMB</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
  </managed-bean>
</faces-config>

Está faltando algumas coisas no seu arquivo de configuração do faces:

Ve se isso lhe ajuda:


/private/nome_da_sua_pagina_com o botão adicionar
pergunta_professor_editar
/private/pagina_que_a_aplicaçao_irá

Espero ter ajudado.