well, I found a solution, but I don't think it's the "cleanest" one:
I added the the following tag
<input-variable name="miniatura" value="" if="!$miniatura"/>
so if the input file isnt filled, $miniatura gets a value.
eventually, because there is a conversion error,
so, instead of using the missingParameterException, I use the
java.lang.IllegalArgumentException, which is catched by actionservlet.
byez.
----- Original Message -----
From: "Borja Martín" <bm...@ho...>
To: <act...@li...>
Sent: Thursday, November 21, 2002 6:45 PM
Subject: [Actionframework-users]
org.actionframework.MissingParameterException
> hi.
> I have a form to upload files, the files are uploaded fine, but the
problem
> comes when the user submits the form with no file selected in the input
> widget, I become the following error:
>
> Conversion error occurred when handling action '/grabarGaleria' (field:
> 'miniatura'): org.actionframework.MissingParameterException: HTTP
parameter
> 'miniatura' - taken from HTML <input> tag of type "File" - does not exist
> (required by action '/grabarGaleria'); nested exception is:
> org.actionframework.MissingParameterException: Parameter 'miniatura' is
not
> defined or the file has a zero length
>
> I thought I could solve it using the on-exception in the xml config file:
> inside the tag <action name="grabarGaleria" ... I put that code:
> <on-exception class="org.actionframework.MissingParameterException"
> show-template="uploadfile.vm" />
> but the on-exception content isn't loaded altough ActionServlet checks
> before if that exception does exist...
>
> (I'm using ActionServlet 0.93.2c)
>
> Thx in advance
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Actionframework-users mailing list
> Act...@li...
> https://lists.sourceforge.net/lists/listinfo/actionframework-users
>
>
|