You return an instance of ActionForward at the end of the
perform method. In the configuration file, an action can go to a
certain
location by doing the equivalent of <jsp:forward .../> or by doing a
redirection (setting the Location header).
But i think the default is using the "forward" method, so it
should work (i'm using the same code posted here and it works).
If getInput() returns a path to another action, then check your config
file to see if the associated mapping has the redirect attribute set to
"true" (redirection)
If getInput returns a path to a jsp file, make sure this jsp file does
not do a response.sendRedirect(...)
One way to tell if there is redirection: check if the url in your
browser is the same that the url you send the form for processing after
you've clicked on the form's submit button. if the url is not the same,
then there is a redirection occurring.
Keep me posted if you find the problem.
Andre
-----Original Message-----
From: Marcel Andres [mailto:[EMAIL PROTECTED]]
Sent: September 10, 2001 12:00 PM
To: struts-user
Subject: RE: Does <html:errors> not work proper?
Hi Kim & Andre
Yes, the errors (in my case just one error) are defined in the
ApplicationResources.properties. But what do you mean Andre, with
"redirection"? I think that after the command "return (new
ActionForward(mapping.getInput()));", I return control to the struts
"ActionServlet", and so, don't have any control on what happens next? Am
I wrong?
Marcel
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 5:47 PM
To: [EMAIL PROTECTED]
Subject: RE: Does <html:errors> not work proper?
One possibility is that there's a redirection occuring somewhere.
Since error bean is stored in request scope, it would be lost after a
redirection
(a new request).
Andre Paradis
-----Original Message-----
From: MacKellar, Kimberly [mailto:[EMAIL PROTECTED]]
Sent: September 10, 2001 11:33 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Does <html:errors> not work proper?
Are all of your errors defined in the ApplicationResources.properties?
Kim MacKellar
-----Original Message-----
From: Marcel Andres [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 10:06 AM
To: struts-user
Subject: Does <html:errors> not work proper?
Hi there
Like most of you, I am using the <html:errors>-tag to show errors on the
JSP
page. My problem is, that I don't get any message on the JSP page. I do
the
following check before I return to the form:
if (!errors.empty()) {
saveErrors(request, errors);
return (new ActionForward(mapping.getInput()));
}
When I check the values, "errors.empty()" it is set to false, and the
value for "errors.size()" is 1.
On the JSP, I am using a template with header, main, and footer. In the
header I declared this:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
....
<!----- Handling the Errors ----->
<table border="0" cellspacing="0" cellpadding="0" width="100%"
height="18">
<tr>
<font class="error">
<html:errors/>
</font>
</tr>
</table>
Any comments would be appreciated.
Marcel