You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Romualdo Rubens de Freitas <ro...@sercomtel.com.br> on 2003/04/15 06:41:10 UTC
* * * ActionErrors problem * * *
Hi Folks,
I'm getting troubles with ActionErrors and a strange exception.
This is what I have:
===== struts-config.xml (begin) =====
<form-beans>
<form-bean name="proprietariosForm"
type="com.imovelnaweb.forms.ProprietariosForm"/>
.
.
</form-beans>
.
.
<action-mappings>
.
.
<action path="/saveProprietarios"
type="com.imovelnaweb.actions.ProprietariosSaveAction"
name="proprietariosForm"
scope="request"
input="/jsp/cancelled.jsp">
</action>
.
.
</action-mappings>
.
.
===== struts-config.xml (end) =====
ProprietariosSaveAction is called from proprietarios.jsp that has a
<html:cancel> tag.
===== ProprietariosSaveAction (begin) =====
.
.
if (isCancelled(request)) {
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("cancelled",
"Cancelled by the user."));
saveErrors(request,errors);
return new ActionForward(mapping.getInput());
}
.
.
===== ProprietariosSaveAction (end) =====
===== cancelled.jsp (begin) =====
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<body bgcolor="#FFFF99">
<html:errors/><hr>
<center>
<html:link page="/jsp/mainMenu.jsp">
<b>Main Menu</b>
</html:link>
</center>
</body>
</html:html>
===== cancelled.jsp (end) =====
With the code above I got (cancelled.jsp isn't displayed):
* * * * *
org.apache.jasper.JasperException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
.
.
* * * * *
I'm not using "org.apache.struts.action.MESSAGE" anyway and if I remove
"saveErrors(request,errors);" from ProprietariosSaveAction,
cancelled.jsp is displayed with no msg errors.
Any help ???
My best regards,
Romualdo Rubens de Freitas
mailto:romualdo@sercomtel.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org