On Tue, 26 Aug 2003, Rune Peter Bjørnstad wrote:
I've compared the logfiles of my application and the validator example
application in the case of a failed validation.
- In my case, the situation described in my previous mail occurs.
- In the example application, the following messages are logged:
Validation failed, returning to '/registration.jsp'
Delegating via forward to '/registration.jsp'
The second message I do not get in my application. examining the source
ResourceProcessor.java reveals:
// Save our error messages and return to the input form if possible
if (log.isDebugEnabled()) {
log.debug(" Validation failed, returning to '" + input + "'");
}
request.setAttribute(Globals.ERROR_KEY, errors);
if (moduleConfig.getControllerConfig().getInputForward()) {
ForwardConfig forward = mapping.findForward(input);
processForwardConfig( request, response, forward);
} else {
internalModuleRelativeForward(input, request, response);
}
with:
protected void internalModuleRelativeForward(
String uri,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
// Construct a request dispatcher for the specified path
uri = moduleConfig.getPrefix() + uri;
// Delegate the processing of this request
// FIXME - exception handling?
if (log.isDebugEnabled()) {
log.debug(" Delegating via forward to '" + uri + "'");
}
doForward(uri, request, response);
}
This leads me to the conclusion that my application and the example
application reacts differently to the boolean check:
moduleConfig.getControllerConfig().getInputForward()
Can anyone shed some light on this?
Kind regards,
Rune Bjørnstad
> Hi,
>
> I've got a bizarre problem regarding form validation. A simple form is
> validated, and when failing this validation I get a blank html page with
> the following source: <html><body></body></html>
>
> The last message in the log is:
>
> Validation failed, returning to '/upload.jsp'
>
> I've read in another thread that somone else experienced the same thing.
> The solution in this case was to use a different commons-validation.jar.
>
> I'm using exactly the same jars as the validation example application.
> Still with the same result.
>
> Why am I not receiving the original form, like in the validation example?
>
> I've included the following files for review:
>
> - upload.jsp // The file containing the html.
> - web.xml
> - struts-config.xml
> - validation.xml
> - UploadBean.java
>
> Any help would be greatly appreciated!
>
> Kind regards
>
> Rune Bjørnstad
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]