FormFile: Catching IllegalArgumentException

2007-06-08 Thread Eric Jain
I have a form with a FormFile field, which works great, except that when someone submits a plain string for this field (e.g. a spammer crawling the site and doing random submissions) I get an ugly stack trace logged... I wonder is there a way to catch this? 2007-06-08 16:04

Re: FormFile: Catching IllegalArgumentException

2007-06-08 Thread Eric Jain
Vincent Lin wrote: Do you have this setting in your form? enctype=multipart/form-data As mentioned, submissions via the form in the web page work fine. The issue is that if someone bypasses the form and POSTs an (invalid) non-multipart request that puts some random string in the parameter

How to forward from one action to another, with modified parameters?

2006-01-07 Thread Eric Jain
If a request for /retrieve.do?id=42 fails (e.g. couldn't find item in database), I'd like to say request.setStatus(HttpServletResponse.SC_NOT_FOUND); request.setAttribute(warning, Not your lucky day.); and forward (not redirect) the request to /search.do?query=42 Can this behavior

Redirection

2006-01-07 Thread Eric Jain
Is there any way I could get an ActionForward to do permanent (301) rather than temporary (302) redirects? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Redirection

2006-01-07 Thread Eric Jain
Mark Lowe wrote: Not sure if i've understood what you're after, but you can just write to the reponse (as you would in a normal servlet) and return null for you action forward. Your webapp configuration will do the rest from there like with any webapp. Yes, that's a solution. On the other hand

Re: Override form action URL

2004-06-03 Thread Eric Jain
If so you can define a dummy action to which your form points. In the dummy just forward to your actual action. In the rendered jsp/html page you will see the dummy action. Thanks, unfortunately the example I gave was somewhat simplified. I'd rather avoid having to configure dozens of dummy