First posting, please be gentle.
Techs: Apache Struts, NetBeans, Windows platform (please don't laugh)
My JSP code:
<html:form action="/LoginSubmit" focus="username">
My struts-config.xml code:
<action path="/LoginSubmit" type="bookshelf.controller.action.LoginSubmitAction"
name="loginForm" input="/WEB-INF/pages/about.jsp"
validate="true" scope="request" />
and
<form-bean name="loginForm" type="bookshelf.controller.form.LoginForm" />
I have trimmed and weeded just about everything else from the code but when i run this page (and it does run) I am missing the NAME="loginForm" attribute from the output HTML. What I do get is:
<form method="post"
action="/bookshelf/LoginSubmit.do;jsessionid=054FC19D371D61934151D337CA303102">
<div><input type="hidden" name="org.apache.struts.taglib.html.TOKEN"
value="172f47466ee8c559e4eb18fda37f4688" /></div>
I don't really mind except that the focus="username" parameter on my html:form statement causes a Javascript error, the generated Javascript is attempting to reference the form name "loginForm", ie:
<script type="text/javascript">
var focusControl = document.forms["loginForm"].elements["username"];
if (focusControl.type != "hidden" && !focusControl.disabled) {
focusControl.focus();
}
</script>
So, I know why the Javascript error is happening but I can't find any reason why the struts library isn't adding a NAME attribute to my html form. Can somebody please tell me what struts needs to generate this attribute?