Hello!
First, sorry for my poor english, but I'm a german...
I'm using Struts 1.0.2 and my problem is described as the following:
-- my inputData.jsp: ---------------------------------------------------------
<%@ page import="org.apache.struts.action.Action"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<jsp:useBean id="transportDataObj"
scope="request"
class="com.orga.emc.pronto.web.dataobj.TransportDataObj"/>
<bean:define id="languageID" name="transportDataObj"
property="languageID"/>
<bean:define id="updateStatus" name="transportDataObj"
property="updateStatus"/>
<html:html locale="false">
<head>
<title>
<bean:message key="inputData.title.text"/>
</title>
</head>
<body>
<html:errors />
<!-- check the update Status -->
<% if (updateStatus.equals("0")) { // meaning GENDER %>
<bean:message key="gender.body.text" />
<html:form action="/updateRegistration.do" method="GET">
<bean:message key="gender.form.text"/>
<html:text property="gender"/>
<html:hidden property="languageID" value="<%= (String)languageID %>"
/>
<html:hidden property="updateStatus" value="<%= (String)updateStatus
%>" />
<html:submit value="Submit"/>
</html:form>
<% } // end-if GENDER ... %>
</body>
</html:html>
-- my UpdateRegistrationForm.java --------------------------------------------
<snip/ >
public ActionErrors validate ( ActionMapping mapping, HttpServletRequest
request ) {
ActionErrors loErrors = new ActionErrors();
Locale locale = null;
int flowStatus = UNDEFINED_INT;
try {
flowStatus = new Integer(updateStatus).intValue();
} catch (NumberFormatException e) {
}
if(Logger.isDebugOn) {
Logger.info("UpdateRegistrationForm", "updateStatus is: "+updateStatus);
}
// validate according to the actual updateStatus...
switch(flowStatus) {
case(GENDER):
if(gender.length() < ProntoProperties.getAsInt(GENDER_MIN_LENGTH, 1)
||
gender.length() > ProntoProperties.getAsInt(GENDER_MAX_LENGTH, 1))
{
loErrors.add("UpdateRegistrationForm", new
ActionError("invalid.input.gender"));
}
break;
default:
break;
}
if(loErrors.empty() == false) {
HashMap langHashmap =
ProntoProperties.getHashMapByPrefix(LANGUAGES_MAPPING);
locale = new
Locale(((String)langHashmap.get(languageID)).toLowerCase());
if(locale == null) locale = Locale.ENGLISH;
request.getSession().setAttribute(Action.LOCALE_KEY, locale);
request.setAttribute("transportDataObj", new
TransportDataObj(languageID, updateStatus));
}
return(loErrors);
}
}
---------------------------------------------------------------------------------------
In each case a validation error appears, my output html is like this:
<html lang="de">
<head>
<title>
</title>
</head>
<body>
null
Wrong input for gender <br>
null
<!-- check the update Status -->
<snip/ >
Why is there twice a null???
Can anybody help me?
Best regards
J�rg B�sner
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>