I have question regarding uploading file, I'm using Jsf 2.0 and xhtml and I must provide user to create Pdf and in that Pdf to insert image, so I found the contol input and I'm
wondering when user selects image from the comp. the path is displayed in textbox of input control but how can I get that path in my Bean.
If you use the JSF 2.0 remember to use the latest version of tomahawk (1.1.10 or 1.1.11-snapshot)
EDIT: and while using the instructions modify the filter mapping so that it catches calls to jsf pages instead of "shtml".
Joined: Sep 28, 2010
Thanks, I have downloaded myFaces but I cannot see the way to include them into xhtml project,
when I set xmlns:t="http://myfaces.apache.org/tomahawk" I only get inputhtml component, but when I create another jsp page inside same project I can all components inside that page, any reason for that.
JSF is good for a lot of things. But those things are related to HTML forms.
I recommend that you do NOT use JSF to generate the PDF document. Use an ordinary servlet. It's simpler.
Also, it's very bad practice to meddle with jsessionid in your application code. Let the server handle that. For one thing, the server can - and does - change the jsessionid without notifying the application.
An IDE is no substitute for an Intelligent Developer.
Doesn't MyFaces has its own file upload tag? Use that instead of using tomahawk or another tag "just for upload".
In my JSF project back then, I used primefaces. At first I also used tomahawk for upload but it turned out not very good when everything else used primefaces (not just in the backend logic yet the front end is hardly a different).
For primefaces, the backend logic will use the org.primefaces.model.UploadedFile class to indicate the the file is "an upload file".
A friendly reminder, when parsing the file path, beware of the difference in browser. Eg IE gives the full path like C:\..... where Firefox gives the last part only when you do something like UploadedFile#getFileName.