File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
JSF
Author
Tomahawk file upload problem
vijay k vemula
Greenhorn
Joined: Dec 17, 2008
Posts: 10
posted
Dec 17, 2008 13:38:00
0
Hi All,
Thanks to all for your previous valuable suggestions.
Currently iam working on Tomahawk file upload functionality. Here is the code which i developed
photos_upload.jsp
==================
<h:form id="uploadForm" enctype="multipart/form-data">
<t:inputFileUpload id="fileupload1" size="115" value="#{photosUploadBean.upFile}" accept="image/*" storage="file" required="true" />
<h:commandButton value="#{ClientLabels['PhotosUpload.UploadPhotos']}" action="#{photosUploadBean.upLoad}"/>
I mapped the value attribute of <t:inputFileUpload> to my backing bean property.
PhotosUploadBean.java
=====================
private UploadedFile upFile;
public UploadedFile getUpFile() {
return upFile;
}
public void setUpFile(UploadedFile upFile) {
this.upFile = upFile;
}
public void upLoad() throws
IOException
{
FacesContext
context = FacesContext.getCurrentInstance();
HttpSession
session = (
HttpSession
) context.getExternalContext().getSession(false);
String
emailComments = getEmailComments();
if(upFile!=null)
{
InputStream
stream = upFile.getInputStream();
}
}
The problem iam getting here is my "upFile" property is null when the user clicked on "Upload Photos" button.
Any help will be highly appreciated.Waiting for your earlier response as this of my higher priority.
Thanks
V.Vijay Krishna
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
Dec 17, 2008 14:59:00
0
Is the ExtensionsFilter configured properly? You need to declare it in the web.xml and map it on the servlet-name of the
FacesServlet
. Also see the documentation that come along with Tomahawk.
Code depot of a Java EE / JSF developer
|
JSF / Eclipse / Tomcat kickoff tutorial
|
DAO kickoff tutorial
|
I ♥ Unicode
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: Tomahawk file upload problem
Similar Threads
Uploading files with JSF
Buggy <t:inputFileUpload
File Upload error JSF tomahawk
Retain File Selected in a File Upload Component
File upload
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter