You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Nazmul Bhuiyan <Na...@nz.fujitsu.com> on 2007/09/28 00:43:27 UTC

T3: Upload

I'm getting an error when trying the Upload component example in
http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.

Unable to resolve expression 'listeners.formSubmit' for
org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
binding: ExpressionBinding[UploadPage listeners.formSubmit cachedValue=null] 

I've modified the listener.formSubmit to listeners.formSubmit according to
Nick and still getting the error.

Nick's answer for same issue in this forum:
http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542

Is there anything missed?

Thanks

Naz
-- 
View this message in context: http://www.nabble.com/T3%3A-Upload-tf4531396.html#a12931369
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by andyhot <an...@di.uoa.gr>.
Perhaps you've misplaced the .java and the .html files
and they can't find each other ? Are you sure your .java is really used?

Nazmul Bhuiyan wrote:
> If you click on the link I've provided you will see the code. I've copied the
> code from there. This is from my Upload.html and formSubmit is as below:
>
>     private IUploadFile file;
>     private File serverFile;
>
>     public IUploadFile getFile() { return file; }
>
>     public void setFile(IUploadFile value) {
>         file = value;
>     }
>     public void formSubmit(IRequestCycle cycle) { 
>         InputStream fis = file.getStream(); 
>         FileOutputStream fos = null;
>          
>         try { 
>             fos = new FileOutputStream(new  File(file.getFileName()));
>             byte[] buffer = new byte[1024];  
>             while (true) {            
>                 int length = fis.read(buffer);  
>                 if (length <  0) {
>                     break;
>                 }
>                 fos.write(buffer, 0, length);               
>             }
>             fis.close();
>             fos.close();
>             serverFile = new File(file.getFileName());
>
>         } catch (IOException ioe) {
>             ioe.printStackTrace();            
>         } finally {
>             if (fis != null) {
>                 try { fis.close(); } catch (IOException ioe) {}
>             }   
>             if (fos != null) {
>                 try { fos.close(); } catch (IOException ioe) {}
>             }
>         }
>     }
>
>
> Nick Westgate wrote:
>   
>> Ok. Is this in a page or a component?
>> And your Java code? Do you have a formSubmit listener?
>>
>> Cheers,
>> Nick.
>>
>>
>> Nazmul Bhuiyan wrote:
>>     
>>> I've copied the code from
>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>>>
>>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>> <table bgcolor="#c0c0c0" cellpadding="4">
>>> 	<tr>
>>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>>> type="file"></input></td>
>>> 	</tr>
>>> 	<tr>
>>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>>> 	</tr>
>>>
>>>
>>> Thanks
>>>
>>> Naz
>>>
>>>
>>> Nick Westgate wrote:
>>>       
>>>> Please post the (relevant parts of) the code.
>>>>
>>>> Cheers,
>>>> Nick.
>>>>
>>>>
>>>> Nazmul Bhuiyan wrote:
>>>>         
>>>>> I'm getting an error when trying the Upload component example in
>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>>
>>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>>> cachedValue=null] 
>>>>>
>>>>> I've modified the listener.formSubmit to listeners.formSubmit according
>>>>> to
>>>>> Nick and still getting the error.
>>>>>
>>>>> Nick's answer for same issue in this forum:
>>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>>
>>>>> Is there anything missed?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Naz
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>         
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>>     
>
>   

-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nazmul Bhuiyan <Na...@nz.fujitsu.com>.
The example code working now after removing the following line of code:
public static final Format SIZE_FORMAT = NumberFormat.getNumberInstance();

I'm not exactly sure what's wrong with this line of code.

Thanks a lot.

Naz


Nazmul Bhuiyan wrote:
> 
> I've removed that deprecated method from my page.
> 
> I'm running this example page as part of my original project. And running
> from inside Eclipse. All other pages working ok. That's how I normally
> test any example before using into my real page.
> 
> In the example code there is no .page file. Is my .page file ok?
> 
> Thanks
> 
> Naz
> 
> 
> Nick Westgate wrote:
>> 
>> I've tested the example code on the page. It works with the exception
>> of file.isTruncated(), which has been deprecated, I presume.
>> 
>> So the rest of the code, ie the code you post below, does work.
>> 
>> It must be a configuration issue. Are you running this example page
>> in isolation, or is it part of a larger project? Are you running
>> from inside Eclipse? If not, how is Tomcat started?
>> 
>> Cheers,
>> Nick.
>> 
>> 
>> Nazmul Bhuiyan wrote:
>>> .page:
>>> <page-specification class="com.fujitsu.efi.web.pages.test.UploadPage">
>>> </page-specification>
>>> 
>>> The .page file was missed spelled but after correcting the file name I'm
>>> getting the following error:
>>> 
>>> Could not load class UploadPage from WebappClassLoader delegate: false
>>> repositories: /WEB-INF/classes/ ----------> Parent Classloader:
>>> org.apache.catalina.loader.StandardClassLoader@1428ea : UploadPage
>>> 
>>> 
>>> But com.fujitsu.efi.web.pages.test.UploadPage class exists in
>>> WEB-INF/classes directory.
>>> 
>>> Thanks
>>> 
>>> Naz
>>> 
>>> 
>>> Nick Westgate wrote:
>>>> What about your .page file?
>>>>
>>>> Cheers,
>>>> Nick.
>>>>
>>>>
>>>> Nazmul Bhuiyan wrote:
>>>>> If you click on the link I've provided you will see the code. I've
>>>>> copied
>>>>> the
>>>>> code from there. This is from my Upload.html and formSubmit is as
>>>>> below:
>>>>>
>>>>>     private IUploadFile file;
>>>>>     private File serverFile;
>>>>>
>>>>>     public IUploadFile getFile() { return file; }
>>>>>
>>>>>     public void setFile(IUploadFile value) {
>>>>>         file = value;
>>>>>     }
>>>>>     public void formSubmit(IRequestCycle cycle) { 
>>>>>         InputStream fis = file.getStream(); 
>>>>>         FileOutputStream fos = null;
>>>>>          
>>>>>         try { 
>>>>>             fos = new FileOutputStream(new  File(file.getFileName()));
>>>>>             byte[] buffer = new byte[1024];  
>>>>>             while (true) {            
>>>>>                 int length = fis.read(buffer);  
>>>>>                 if (length <  0) {
>>>>>                     break;
>>>>>                 }
>>>>>                 fos.write(buffer, 0, length);               
>>>>>             }
>>>>>             fis.close();
>>>>>             fos.close();
>>>>>             serverFile = new File(file.getFileName());
>>>>>
>>>>>         } catch (IOException ioe) {
>>>>>             ioe.printStackTrace();            
>>>>>         } finally {
>>>>>             if (fis != null) {
>>>>>                 try { fis.close(); } catch (IOException ioe) {}
>>>>>             }   
>>>>>             if (fos != null) {
>>>>>                 try { fos.close(); } catch (IOException ioe) {}
>>>>>             }
>>>>>         }
>>>>>     }
>>>>>
>>>>>
>>>>> Nick Westgate wrote:
>>>>>> Ok. Is this in a page or a component?
>>>>>> And your Java code? Do you have a formSubmit listener?
>>>>>>
>>>>>> Cheers,
>>>>>> Nick.
>>>>>>
>>>>>>
>>>>>> Nazmul Bhuiyan wrote:
>>>>>>> I've copied the code from
>>>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>>>>>>>
>>>>>>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>>>>> <table bgcolor="#c0c0c0" cellpadding="4">
>>>>>>> 	<tr>
>>>>>>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>>>>>>> type="file"></input></td>
>>>>>>> 	</tr>
>>>>>>> 	<tr>
>>>>>>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>>>>>>> 	</tr>
>>>>>>>
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Naz
>>>>>>>
>>>>>>>
>>>>>>> Nick Westgate wrote:
>>>>>>>> Please post the (relevant parts of) the code.
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Nick.
>>>>>>>>
>>>>>>>>
>>>>>>>> Nazmul Bhuiyan wrote:
>>>>>>>>> I'm getting an error when trying the Upload component example in
>>>>>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>>>>>>
>>>>>>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>>>>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>>>>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>>>>>>> cachedValue=null] 
>>>>>>>>>
>>>>>>>>> I've modified the listener.formSubmit to listeners.formSubmit
>>>>>>>>> according
>>>>>>>>> to
>>>>>>>>> Nick and still getting the error.
>>>>>>>>>
>>>>>>>>> Nick's answer for same issue in this forum:
>>>>>>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>>>>>>
>>>>>>>>> Is there anything missed?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> Naz
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T3%3A-Upload-tf4531396.html#a13006992
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nazmul Bhuiyan <Na...@nz.fujitsu.com>.
I've removed that deprecated method from my page.

I'm running this example page as part of my original project. And running
from inside Eclipse. All other pages working ok. That's how I normally test
any example before using into my real page.

In the example code there is no .page file. Is my .page file ok?

Thanks

Naz


Nick Westgate wrote:
> 
> I've tested the example code on the page. It works with the exception
> of file.isTruncated(), which has been deprecated, I presume.
> 
> So the rest of the code, ie the code you post below, does work.
> 
> It must be a configuration issue. Are you running this example page
> in isolation, or is it part of a larger project? Are you running
> from inside Eclipse? If not, how is Tomcat started?
> 
> Cheers,
> Nick.
> 
> 
> Nazmul Bhuiyan wrote:
>> .page:
>> <page-specification class="com.fujitsu.efi.web.pages.test.UploadPage">
>> </page-specification>
>> 
>> The .page file was missed spelled but after correcting the file name I'm
>> getting the following error:
>> 
>> Could not load class UploadPage from WebappClassLoader delegate: false
>> repositories: /WEB-INF/classes/ ----------> Parent Classloader:
>> org.apache.catalina.loader.StandardClassLoader@1428ea : UploadPage
>> 
>> 
>> But com.fujitsu.efi.web.pages.test.UploadPage class exists in
>> WEB-INF/classes directory.
>> 
>> Thanks
>> 
>> Naz
>> 
>> 
>> Nick Westgate wrote:
>>> What about your .page file?
>>>
>>> Cheers,
>>> Nick.
>>>
>>>
>>> Nazmul Bhuiyan wrote:
>>>> If you click on the link I've provided you will see the code. I've
>>>> copied
>>>> the
>>>> code from there. This is from my Upload.html and formSubmit is as
>>>> below:
>>>>
>>>>     private IUploadFile file;
>>>>     private File serverFile;
>>>>
>>>>     public IUploadFile getFile() { return file; }
>>>>
>>>>     public void setFile(IUploadFile value) {
>>>>         file = value;
>>>>     }
>>>>     public void formSubmit(IRequestCycle cycle) { 
>>>>         InputStream fis = file.getStream(); 
>>>>         FileOutputStream fos = null;
>>>>          
>>>>         try { 
>>>>             fos = new FileOutputStream(new  File(file.getFileName()));
>>>>             byte[] buffer = new byte[1024];  
>>>>             while (true) {            
>>>>                 int length = fis.read(buffer);  
>>>>                 if (length <  0) {
>>>>                     break;
>>>>                 }
>>>>                 fos.write(buffer, 0, length);               
>>>>             }
>>>>             fis.close();
>>>>             fos.close();
>>>>             serverFile = new File(file.getFileName());
>>>>
>>>>         } catch (IOException ioe) {
>>>>             ioe.printStackTrace();            
>>>>         } finally {
>>>>             if (fis != null) {
>>>>                 try { fis.close(); } catch (IOException ioe) {}
>>>>             }   
>>>>             if (fos != null) {
>>>>                 try { fos.close(); } catch (IOException ioe) {}
>>>>             }
>>>>         }
>>>>     }
>>>>
>>>>
>>>> Nick Westgate wrote:
>>>>> Ok. Is this in a page or a component?
>>>>> And your Java code? Do you have a formSubmit listener?
>>>>>
>>>>> Cheers,
>>>>> Nick.
>>>>>
>>>>>
>>>>> Nazmul Bhuiyan wrote:
>>>>>> I've copied the code from
>>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>>>>>>
>>>>>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>>>> <table bgcolor="#c0c0c0" cellpadding="4">
>>>>>> 	<tr>
>>>>>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>>>>>> type="file"></input></td>
>>>>>> 	</tr>
>>>>>> 	<tr>
>>>>>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>>>>>> 	</tr>
>>>>>>
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Naz
>>>>>>
>>>>>>
>>>>>> Nick Westgate wrote:
>>>>>>> Please post the (relevant parts of) the code.
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Nick.
>>>>>>>
>>>>>>>
>>>>>>> Nazmul Bhuiyan wrote:
>>>>>>>> I'm getting an error when trying the Upload component example in
>>>>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>>>>>
>>>>>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>>>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>>>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>>>>>> cachedValue=null] 
>>>>>>>>
>>>>>>>> I've modified the listener.formSubmit to listeners.formSubmit
>>>>>>>> according
>>>>>>>> to
>>>>>>>> Nick and still getting the error.
>>>>>>>>
>>>>>>>> Nick's answer for same issue in this forum:
>>>>>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>>>>>
>>>>>>>> Is there anything missed?
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> Naz
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T3%3A-Upload-tf4531396.html#a12987390
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nick Westgate <ni...@key-planning.co.jp>.
I've tested the example code on the page. It works with the exception
of file.isTruncated(), which has been deprecated, I presume.

So the rest of the code, ie the code you post below, does work.

It must be a configuration issue. Are you running this example page
in isolation, or is it part of a larger project? Are you running
from inside Eclipse? If not, how is Tomcat started?

Cheers,
Nick.


Nazmul Bhuiyan wrote:
> .page:
> <page-specification class="com.fujitsu.efi.web.pages.test.UploadPage">
> </page-specification>
> 
> The .page file was missed spelled but after correcting the file name I'm
> getting the following error:
> 
> Could not load class UploadPage from WebappClassLoader delegate: false
> repositories: /WEB-INF/classes/ ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@1428ea : UploadPage
> 
> 
> But com.fujitsu.efi.web.pages.test.UploadPage class exists in
> WEB-INF/classes directory.
> 
> Thanks
> 
> Naz
> 
> 
> Nick Westgate wrote:
>> What about your .page file?
>>
>> Cheers,
>> Nick.
>>
>>
>> Nazmul Bhuiyan wrote:
>>> If you click on the link I've provided you will see the code. I've copied
>>> the
>>> code from there. This is from my Upload.html and formSubmit is as below:
>>>
>>>     private IUploadFile file;
>>>     private File serverFile;
>>>
>>>     public IUploadFile getFile() { return file; }
>>>
>>>     public void setFile(IUploadFile value) {
>>>         file = value;
>>>     }
>>>     public void formSubmit(IRequestCycle cycle) { 
>>>         InputStream fis = file.getStream(); 
>>>         FileOutputStream fos = null;
>>>          
>>>         try { 
>>>             fos = new FileOutputStream(new  File(file.getFileName()));
>>>             byte[] buffer = new byte[1024];  
>>>             while (true) {            
>>>                 int length = fis.read(buffer);  
>>>                 if (length <  0) {
>>>                     break;
>>>                 }
>>>                 fos.write(buffer, 0, length);               
>>>             }
>>>             fis.close();
>>>             fos.close();
>>>             serverFile = new File(file.getFileName());
>>>
>>>         } catch (IOException ioe) {
>>>             ioe.printStackTrace();            
>>>         } finally {
>>>             if (fis != null) {
>>>                 try { fis.close(); } catch (IOException ioe) {}
>>>             }   
>>>             if (fos != null) {
>>>                 try { fos.close(); } catch (IOException ioe) {}
>>>             }
>>>         }
>>>     }
>>>
>>>
>>> Nick Westgate wrote:
>>>> Ok. Is this in a page or a component?
>>>> And your Java code? Do you have a formSubmit listener?
>>>>
>>>> Cheers,
>>>> Nick.
>>>>
>>>>
>>>> Nazmul Bhuiyan wrote:
>>>>> I've copied the code from
>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>>>>>
>>>>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>>> <table bgcolor="#c0c0c0" cellpadding="4">
>>>>> 	<tr>
>>>>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>>>>> type="file"></input></td>
>>>>> 	</tr>
>>>>> 	<tr>
>>>>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>>>>> 	</tr>
>>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> Naz
>>>>>
>>>>>
>>>>> Nick Westgate wrote:
>>>>>> Please post the (relevant parts of) the code.
>>>>>>
>>>>>> Cheers,
>>>>>> Nick.
>>>>>>
>>>>>>
>>>>>> Nazmul Bhuiyan wrote:
>>>>>>> I'm getting an error when trying the Upload component example in
>>>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>>>>
>>>>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>>>>> cachedValue=null] 
>>>>>>>
>>>>>>> I've modified the listener.formSubmit to listeners.formSubmit
>>>>>>> according
>>>>>>> to
>>>>>>> Nick and still getting the error.
>>>>>>>
>>>>>>> Nick's answer for same issue in this forum:
>>>>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>>>>
>>>>>>> Is there anything missed?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Naz
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nazmul Bhuiyan <Na...@nz.fujitsu.com>.
.page:
<page-specification class="com.fujitsu.efi.web.pages.test.UploadPage">
</page-specification>

The .page file was missed spelled but after correcting the file name I'm
getting the following error:

Could not load class UploadPage from WebappClassLoader delegate: false
repositories: /WEB-INF/classes/ ----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1428ea : UploadPage


But com.fujitsu.efi.web.pages.test.UploadPage class exists in
WEB-INF/classes directory.

Thanks

Naz


Nick Westgate wrote:
> 
> What about your .page file?
> 
> Cheers,
> Nick.
> 
> 
> Nazmul Bhuiyan wrote:
>> If you click on the link I've provided you will see the code. I've copied
>> the
>> code from there. This is from my Upload.html and formSubmit is as below:
>> 
>>     private IUploadFile file;
>>     private File serverFile;
>> 
>>     public IUploadFile getFile() { return file; }
>> 
>>     public void setFile(IUploadFile value) {
>>         file = value;
>>     }
>>     public void formSubmit(IRequestCycle cycle) { 
>>         InputStream fis = file.getStream(); 
>>         FileOutputStream fos = null;
>>          
>>         try { 
>>             fos = new FileOutputStream(new  File(file.getFileName()));
>>             byte[] buffer = new byte[1024];  
>>             while (true) {            
>>                 int length = fis.read(buffer);  
>>                 if (length <  0) {
>>                     break;
>>                 }
>>                 fos.write(buffer, 0, length);               
>>             }
>>             fis.close();
>>             fos.close();
>>             serverFile = new File(file.getFileName());
>> 
>>         } catch (IOException ioe) {
>>             ioe.printStackTrace();            
>>         } finally {
>>             if (fis != null) {
>>                 try { fis.close(); } catch (IOException ioe) {}
>>             }   
>>             if (fos != null) {
>>                 try { fos.close(); } catch (IOException ioe) {}
>>             }
>>         }
>>     }
>> 
>> 
>> Nick Westgate wrote:
>>> Ok. Is this in a page or a component?
>>> And your Java code? Do you have a formSubmit listener?
>>>
>>> Cheers,
>>> Nick.
>>>
>>>
>>> Nazmul Bhuiyan wrote:
>>>> I've copied the code from
>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>>>>
>>>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>>> <table bgcolor="#c0c0c0" cellpadding="4">
>>>> 	<tr>
>>>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>>>> type="file"></input></td>
>>>> 	</tr>
>>>> 	<tr>
>>>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>>>> 	</tr>
>>>>
>>>>
>>>> Thanks
>>>>
>>>> Naz
>>>>
>>>>
>>>> Nick Westgate wrote:
>>>>> Please post the (relevant parts of) the code.
>>>>>
>>>>> Cheers,
>>>>> Nick.
>>>>>
>>>>>
>>>>> Nazmul Bhuiyan wrote:
>>>>>> I'm getting an error when trying the Upload component example in
>>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>>>
>>>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>>>> cachedValue=null] 
>>>>>>
>>>>>> I've modified the listener.formSubmit to listeners.formSubmit
>>>>>> according
>>>>>> to
>>>>>> Nick and still getting the error.
>>>>>>
>>>>>> Nick's answer for same issue in this forum:
>>>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>>>
>>>>>> Is there anything missed?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Naz
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T3%3A-Upload-tf4531396.html#a12970887
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nick Westgate <ni...@key-planning.co.jp>.
What about your .page file?

Cheers,
Nick.


Nazmul Bhuiyan wrote:
> If you click on the link I've provided you will see the code. I've copied the
> code from there. This is from my Upload.html and formSubmit is as below:
> 
>     private IUploadFile file;
>     private File serverFile;
> 
>     public IUploadFile getFile() { return file; }
> 
>     public void setFile(IUploadFile value) {
>         file = value;
>     }
>     public void formSubmit(IRequestCycle cycle) { 
>         InputStream fis = file.getStream(); 
>         FileOutputStream fos = null;
>          
>         try { 
>             fos = new FileOutputStream(new  File(file.getFileName()));
>             byte[] buffer = new byte[1024];  
>             while (true) {            
>                 int length = fis.read(buffer);  
>                 if (length <  0) {
>                     break;
>                 }
>                 fos.write(buffer, 0, length);               
>             }
>             fis.close();
>             fos.close();
>             serverFile = new File(file.getFileName());
> 
>         } catch (IOException ioe) {
>             ioe.printStackTrace();            
>         } finally {
>             if (fis != null) {
>                 try { fis.close(); } catch (IOException ioe) {}
>             }   
>             if (fos != null) {
>                 try { fos.close(); } catch (IOException ioe) {}
>             }
>         }
>     }
> 
> 
> Nick Westgate wrote:
>> Ok. Is this in a page or a component?
>> And your Java code? Do you have a formSubmit listener?
>>
>> Cheers,
>> Nick.
>>
>>
>> Nazmul Bhuiyan wrote:
>>> I've copied the code from
>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>>>
>>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>>> <table bgcolor="#c0c0c0" cellpadding="4">
>>> 	<tr>
>>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>>> type="file"></input></td>
>>> 	</tr>
>>> 	<tr>
>>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>>> 	</tr>
>>>
>>>
>>> Thanks
>>>
>>> Naz
>>>
>>>
>>> Nick Westgate wrote:
>>>> Please post the (relevant parts of) the code.
>>>>
>>>> Cheers,
>>>> Nick.
>>>>
>>>>
>>>> Nazmul Bhuiyan wrote:
>>>>> I'm getting an error when trying the Upload component example in
>>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>>
>>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>>> cachedValue=null] 
>>>>>
>>>>> I've modified the listener.formSubmit to listeners.formSubmit according
>>>>> to
>>>>> Nick and still getting the error.
>>>>>
>>>>> Nick's answer for same issue in this forum:
>>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>>
>>>>> Is there anything missed?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Naz
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nazmul Bhuiyan <Na...@nz.fujitsu.com>.
If you click on the link I've provided you will see the code. I've copied the
code from there. This is from my Upload.html and formSubmit is as below:

    private IUploadFile file;
    private File serverFile;

    public IUploadFile getFile() { return file; }

    public void setFile(IUploadFile value) {
        file = value;
    }
    public void formSubmit(IRequestCycle cycle) { 
        InputStream fis = file.getStream(); 
        FileOutputStream fos = null;
         
        try { 
            fos = new FileOutputStream(new  File(file.getFileName()));
            byte[] buffer = new byte[1024];  
            while (true) {            
                int length = fis.read(buffer);  
                if (length <  0) {
                    break;
                }
                fos.write(buffer, 0, length);               
            }
            fis.close();
            fos.close();
            serverFile = new File(file.getFileName());

        } catch (IOException ioe) {
            ioe.printStackTrace();            
        } finally {
            if (fis != null) {
                try { fis.close(); } catch (IOException ioe) {}
            }   
            if (fos != null) {
                try { fos.close(); } catch (IOException ioe) {}
            }
        }
    }


Nick Westgate wrote:
> 
> Ok. Is this in a page or a component?
> And your Java code? Do you have a formSubmit listener?
> 
> Cheers,
> Nick.
> 
> 
> Nazmul Bhuiyan wrote:
>> I've copied the code from
>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
>> 
>> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
>> <table bgcolor="#c0c0c0" cellpadding="4">
>> 	<tr>
>> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
>> type="file"></input></td>
>> 	</tr>
>> 	<tr>
>> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
>> 	</tr>
>> 
>> 
>> Thanks
>> 
>> Naz
>> 
>> 
>> Nick Westgate wrote:
>>> Please post the (relevant parts of) the code.
>>>
>>> Cheers,
>>> Nick.
>>>
>>>
>>> Nazmul Bhuiyan wrote:
>>>> I'm getting an error when trying the Upload component example in
>>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>>
>>>> Unable to resolve expression 'listeners.formSubmit' for
>>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>>> cachedValue=null] 
>>>>
>>>> I've modified the listener.formSubmit to listeners.formSubmit according
>>>> to
>>>> Nick and still getting the error.
>>>>
>>>> Nick's answer for same issue in this forum:
>>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>>
>>>> Is there anything missed?
>>>>
>>>> Thanks
>>>>
>>>> Naz
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T3%3A-Upload-tf4531396.html#a12934608
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Ok. Is this in a page or a component?
And your Java code? Do you have a formSubmit listener?

Cheers,
Nick.


Nazmul Bhuiyan wrote:
> I've copied the code from
> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html
> 
> <form jwcid="@Form" listener="ognl:listeners.formSubmit">
> <table bgcolor="#c0c0c0" cellpadding="4">
> 	<tr>
> 		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
> type="file"></input></td>
> 	</tr>
> 	<tr>
> 		<td colspan="2"><input type="submit" value="Upload"></input></td>
> 	</tr>
> 
> 
> Thanks
> 
> Naz
> 
> 
> Nick Westgate wrote:
>> Please post the (relevant parts of) the code.
>>
>> Cheers,
>> Nick.
>>
>>
>> Nazmul Bhuiyan wrote:
>>> I'm getting an error when trying the Upload component example in
>>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>>>
>>> Unable to resolve expression 'listeners.formSubmit' for
>>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>>> cachedValue=null] 
>>>
>>> I've modified the listener.formSubmit to listeners.formSubmit according
>>> to
>>> Nick and still getting the error.
>>>
>>> Nick's answer for same issue in this forum:
>>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>>>
>>> Is there anything missed?
>>>
>>> Thanks
>>>
>>> Naz
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nazmul Bhuiyan <Na...@nz.fujitsu.com>.
I've copied the code from
http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html

<form jwcid="@Form" listener="ognl:listeners.formSubmit">
<table bgcolor="#c0c0c0" cellpadding="4">
	<tr>
		<td colspan="2">File:&nbsp;<input jwcid="@Upload" file="ognl:file"
type="file"></input></td>
	</tr>
	<tr>
		<td colspan="2"><input type="submit" value="Upload"></input></td>
	</tr>


Thanks

Naz


Nick Westgate wrote:
> 
> Please post the (relevant parts of) the code.
> 
> Cheers,
> Nick.
> 
> 
> Nazmul Bhuiyan wrote:
>> I'm getting an error when trying the Upload component example in
>> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
>> 
>> Unable to resolve expression 'listeners.formSubmit' for
>> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
>> binding: ExpressionBinding[UploadPage listeners.formSubmit
>> cachedValue=null] 
>> 
>> I've modified the listener.formSubmit to listeners.formSubmit according
>> to
>> Nick and still getting the error.
>> 
>> Nick's answer for same issue in this forum:
>> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
>> 
>> Is there anything missed?
>> 
>> Thanks
>> 
>> Naz
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T3%3A-Upload-tf4531396.html#a12934189
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T3: Upload

Posted by Nick Westgate <ni...@key-planning.co.jp>.
Please post the (relevant parts of) the code.

Cheers,
Nick.


Nazmul Bhuiyan wrote:
> I'm getting an error when trying the Upload component example in
> http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html.
> 
> Unable to resolve expression 'listeners.formSubmit' for
> org.apache.tapestry.html.BasePage@14a0698[UploadPage]. 
> binding: ExpressionBinding[UploadPage listeners.formSubmit cachedValue=null] 
> 
> I've modified the listener.formSubmit to listeners.formSubmit according to
> Nick and still getting the error.
> 
> Nick's answer for same issue in this forum:
> http://www.nabble.com/Form-upload-and-download-tf2236396.html#a6201542
> 
> Is there anything missed?
> 
> Thanks
> 
> Naz

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org