Saludar – el action es un parámetro de navegación

Por 9.99€ al mes tendrás acceso completo a todos los cursos. Sin matrícula ni permanencia.

saludar.jsp
<html>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

Las etiquetas de JSF deben estar dentro de las etiquetas <f:view>, las cuales sulen comenzar inmediatamente después de <body> y terminar inmediatamente antes de </body>
<f:view>
	<h:form>
		<h:outputText value="#{msgs.inicioSaludo}" />
		<h:inputText value="#{SaludarBB.nombre}" />
Las etiquetas de JSF que utilicen el atributo action deben ir dentro de la etiqueta <h:form>
		<h:commandButton action="next" />
	</h:form>
</f:view>
</html>
messages.properties
inicioSaludo =hola, introduce tu nombre
hola= hola
web.xml
<servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
</servlet>   

<servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
</servlet-mapping>
faces-config.xml
<navigation-rule>
	<from-view-id>/saludar.jsp</from-view-id>
	<navigation-case>
	Tendremos un solo <from-view-id> por cada <navigation-rule>
		<from-outcome>next</from-outcome>
		<to-view-id>/pagina2.jsp</to-view-id>
	</navigation-case>
</navigation-rule>
<managed-bean>
	<managed-bean-name>SaludarBB</managed-bean-name>
	<managed-bean-class>com.pablomonteserin.beans.SaludarBB</managed-bean-class>
	<managed-bean-scope>session</managed-bean-scope>
</managed-bean>   
<application>
	<resource-bundle>
	Esto referencia al fichero messages.properties  colocado en com.pablomonteserin
		<base-name>com.pablomonteserin.messages</base-name>
		<var>msgs</var>
	</resource-bundle>
</application>
SaludarBB.java
package com.pablomonteserin.beans;

public class SaludarBB {
	private String nombre;

	public String getNombre() {
		return nombre;
	}

	public void setNombre(String nombre) {
		this.nombre = nombre;
	}
	
}
<f:view>	
	<h:outputText value="#{msgs.hola}" />&nbsp;
	<h:outputText value="#{SaludarBB.nombre}" />
</f:view>

Por 9.99€ al mes tendrás acceso completo a todos los cursos. Sin matrícula ni permanencia.