Multiple forms on a JSF view
[nobr]Hi!
Does somebody knows what I'm doing wrong here?
Look at this very basic example:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test multiple forms</title>
</head>
<body>
<f:view>
<h:form>
<h:outputText value="Field 1: " />
<h:inputText value="#{testMultiform.field1}" /><br>
<h:outputText value="Field 2: " />
<h:inputText value="#{testMultiform.field2}" />
<br>
<h:commandLink value="Test form 1"
action="#{testMultiform.executeForm1}">
</h:commandLink>
</h:form>
<c:import url="footer.jsp"/>
</f:view>
</body>
</html>
and the imported file (footer.jsp) looks like this:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<f:subview id="footer">
<h:form>
<h:commandLink value="Test form 2" action="exe2">
</h:commandLink>
</h:form>
</f:subview>
The example uses two forms components (one included with the c:import JSTL command), each with a commandLink component. I know that JSF permits two forms in a view. However the second commandLink, inside the second form component, is ignored. Could somebody say me the reason?
Thanks!
Christian[/nobr]

