I have a script that disables an Upload component if text is entered into a
TextField component. However, upon submitting after having disabled the
Upload component, I get a Null Pointer Exception. This problem is identical
to one previously noted on the mailing list::::
-------------------------------------------------------------------------------------------------------
In the process of migrating to Tapestry 4 (final), the Upload component
failed with a null pointer exception at line 84 in Upload.java. Top few
lines of the exception stack trace are:
---------------------------
Stack Trace:
org.apache.tapestry.form.Upload.rewindFormComponent(Upload.java:84)
org.apache.tapestry.form.AbstractFormComponent.renderComponent(AbstractFormComponent.java:115)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:617)
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:434)
.....
-----------------------------
I looked through JIRA; I could not locate a report on this specific
error. Anyway, I looked at the source and noticed that the error is
caused by the "file" variable being null when no file is being uploaded.
------------------------------------
IUploadFile file = getDecoder().getFileUpload(getName());
if (HiveMind.isBlank(file.getFileName())) //exception if "file" is null
{
file = null;
}
------------------------
I added a test to check for "file" being null
if (file! = null && HiveMind.isBlank(file.getFileName()))
and the exception went away.
Regards
Sohail Aslam
sohail.aslam AT google mail dot calm
--------------------------------------------------------------------------------------
It seems that this fix was made ::
http://svn.apache.org/viewvc?view=rev&revision=369066
But when I check the latest revision ::
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/Upload.java?view=markup
the fix is no longer there.
_________________________________________________________________
Achetez ce que vous voulez, quand vous voulez sur Sympatico / MSN Magasiner
http://magasiner.sympatico.msn.ca/content/shp/?ctId=101,ptnrid=176,ptnrdata=081805
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]