Hi, I´m having problems with the <html:form> tag in struts 1.27
I´ve made a simple JSP:
My struts-config.xml is:
But the rendered HTML code of this JSP is as follow:
Note that the form name property isn´t rendered. And in struts 1.2.x the name property is not valid anymore. The correct behavior should be the form name property coming from the actionmapping in struts-config.xml, but its not happening. What I do wrong?
I´ve made a simple JSP:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<%@ taglib uri="[URL unfurl="true"]http://struts.apache.org/tags-html"[/URL] prefix="html" %>
<%@ taglib uri="[URL unfurl="true"]http://struts.apache.org/tags-bean"[/URL] prefix="bean" %>
<html:html xhtml="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Simple Form</title>
</head>
<body>
<html:form action="simple.do">
<html:text property="user" />
<html:submit value="Submit" />
</html:form>
</body>
</html:html>
My struts-config.xml is:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"[URL unfurl="true"]http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">[/URL]
<struts-config>
<form-beans>
<form-bean
name="simple"
type="simple.SimpleForm" />
</form-beans>
<global-exceptions>
</global-exceptions>
<global-forwards>
</global-forwards>
<action-mappings>
<action
path="/simple"
type="simple.SimpleAction"
name="simple"
scope="session"
input="/simple_form.jsp"
unknown="false"
validate="false" >
<forward name="go" path="/simple_form.jsp"/>
</action>
</action-mappings>
</struts-config>
But the rendered HTML code of this JSP is as follow:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] lang="pt-BR" xml:lang="pt-BR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Simple Form</title>
</head>
<body>
<form method="post" action="/test-struts/simple.do">
<input type="text" name="user" value="" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
Note that the form name property isn´t rendered. And in struts 1.2.x the name property is not valid anymore. The correct behavior should be the form name property coming from the actionmapping in struts-config.xml, but its not happening. What I do wrong?