------- Start of forwarded message -------
Subject: Please Help !! Can't Display ActionMessages
From: "Kam Lung Leung" <[EMAIL PROTECTED]>
Date: Sat, 08 Nov 2003 18:22:07 -0700 (MST)
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Hi,
I am trying to follow the logon example of the struts-example.war. However, I can
not see the error messages print on the logon.jsp. Any suggestion is greatly
appreciated.
<<<< here is the part that display the errors on my logon.jsp >>>>>>
<logic:messagesPresent>
There were errors
<ul>
<font color='red' >
<html:messages id="validatorMsgs" message="true" >
<li> <bean:write name="validatorMsgs"/> </li>
</html:messages>
</font>
</ul>
</logic:messagesPresent>
<<<<< struts-config.xml >>>>>>>
<form-bean name="adminLogonForm"
type="com.wlwa.Infra.WebComponemt.Dispatcher.Forms.AdminLogonForm" />
</form-beans>
<global-forwards>
<forward name="logoff" path="/adminLogoff.do"/>
<forward name="logon"
path="/Infra/WebComponemt/Presentation/AdminLogon.jsp"/>
</global-forwards>
<action path="/adminLogonSubmit"
type="com.wlwa.Infra.WebComponemt.Dispatcher.Actions.AdminLogonAction"
name="adminLogonForm"
scope="session"
validate="true"
input="logon">
<forward name="success" path="/Infra/WebComponemt/Presentation/index.jsp" />
</action>
<<<<< Here is may ActionLogon.java >>>>>
ActionMessages actionsMsgs = new ActionMessages();
// Validate the request parameters specified by the user
String username = (String) PropertyUtils.getSimpleProperty(form, "userName");
String password = (String) PropertyUtils.getSimpleProperty(form, "password");
try {
if (lookUpUser(password, username) == false) {
actionsMsgs.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("adminLogonForm.error.password"));
}
} catch (Exception ex) {
// Report any actionsMsgs we have discovered back to the original form
actionsMsgs.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("adminLogonForm.error.password", ex.toString()));
saveMessages(request,actionsMsgs);
if (log.isDebugEnabled()) {
log.debug("validation of user passwword failed for username:" +username );
log.debug("End of execute ");
}
return (mapping.getInputForward());
} //end try-catch
if (log.isDebugEnabled()) {
log.debug("execute : password validation ended for user : " + username );
}
// Report any actionsMsgs we have discovered back to the original form
if (!actionsMsgs.isEmpty()) {
saveMessages(request, actionsMsgs);
if (log.isDebugEnabled()) {
log.debug("validation of user passwword failed for username:" + username );
log.debug("End of execute ");
}
return (mapping.getInputForward());
}
<<<< server.log >>>>>
DEBUG [org.apache.commons.beanutils.ConvertUtils] Convert string 'kamhoho' to
class 'java.lang.String'
DEBUG [org.apache.commons.beanutils.ConvertUtils] Using converter
[EMAIL PROTECTED]
DEBUG [org.apache.commons.beanutils.BeanUtils]
setProperty([EMAIL PROTECTED],
userName, [tytyty])
DEBUG [org.apache.commons.beanutils.ConvertUtils] Convert string 'tytyty' to
class 'java.lang.String'
DEBUG [org.apache.commons.beanutils.ConvertUtils] Using converter
[EMAIL PROTECTED]
DEBUG [org.apache.struts.action.RequestProcessor] Validating input form
properties
DEBUG [org.apache.struts.action.RequestProcessor] No errors detected, accepting
input
DEBUG [org.apache.struts.action.RequestProcessor] Looking for Action instance
for class com.wlwa.Infra.WebComponemt.Dispatcher.Actions.AdminLogonAction
DEBUG [org.apache.struts.action.RequestProcessor] Returning existing Action
instance
DEBUG [com.wlwa.Infra.WebComponemt.Dispatcher.Action.AdminLogonAction] Begin of
execute
DEBUG [com.wlwa.Infra.WebComponemt.Dispatcher.Action.AdminLogonAction] execute :
password validation ended for user : tytyty
DEBUG [com.wlwa.Infra.WebComponemt.Dispatcher.Action.AdminLogonAction] End of
execute
DEBUG [org.apache.struts.tiles.TilesRequestProcessor]
processForwardConfig(/Infra/WebComponemt/Presentation/index.jsp, false)
DEBUG [org.apache.struts.tiles.TilesRequestProcessor]
'/Infra/WebComponemt/Presentation/index.jsp' - processed as uri
DEBUG [org.apache.struts.action.RequestProcessor]
processForwardConfig(ForwardConfig[name=success,path=/Infra/WebComponemt/Presentation/index.jsp,redirect=false,contextRelative=false])
Kam Lung Leung
System Architect
Wireless Web Access Inc.
(303) 627-9684
------- End of forwarded message -------
Kam Lung Leung
System Architect
Wireless Web Access Inc.
(303) 627-9684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]