Re: T3: Upload
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: >>> >>> >>> >>> 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: >>> [EMAIL PROTECTED] : 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 >>> >>> >>> >>> >>> File: >> file="ognl:file" >>> type="file"> >>> >>> >>> >> value="Upload"> >>> >>> >>> >>> 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 > [EMAIL PROTECTED] > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
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: >> >> >> >> 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: >> [EMAIL PROTECTED] : 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 >> >> >> >> >> File: > file="ognl:file" >> type="file"> >> >> >> > value="Upload"> >> >> >> >> 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> > > ---
Re: T3: Upload
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: 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: [EMAIL PROTECTED] : 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 File: 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
.page: 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: [EMAIL PROTECTED] : 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 File: >>> file="ognl:file" type="file"> >>> value="Upload"> 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 >> [EMAIL PROTECTED] >> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > >>> - >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
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 File: 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
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 File: 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
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 >> >> >> >> >> File: > file="ognl:file" >> type="file"> >> >> >> > value="Upload"> >> >> >> >> 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
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 File: 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
I've copied the code from http://tapestry.apache.org/tapestry3/doc/ComponentReference/Upload.html File: 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 >> [EMAIL PROTECTED] >> 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T3: Upload
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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]