We have been developing a web application in JSF using Netbeans 6.9.1. It is about shopping. Therefore, many a times we have to deal with images. Images need to be uploaded into MySql database. Doing so, requires some mechanism to browse image files but we found that JSF does not support file browse directly. we could have used HTML file browse <input type="file".../>
but for that we need to obtain the external context from Servlet to access it's value in JSF managed bean from request parameters.
HttpServletRequest request=(HttpServletRequest)FacesContext
.getCurrentInstance().getExternalContext().getRequest();
which may not be one of the convenient, suggested and best methods I think [ and also, it may not be the approach to mix HTML with JSF components] and if we were to use HTML file browse, we would have to maintain it's view state which is utmost important in JSF and HTML file browse by nature doesn't maintain it's view state and also, we can only obtain the file name from HTML file browse. In many circumstances, it is essential to obtain the absolute file path. Is it possible to retrieve the absolute file path from HTML file browse and make it maintain it's view state? Which approach should we follow?