How to get the browsed file path into controller bean using JSF icefaces
Hi All,
I've a requirement as,
1) Need to browse a file from my local system/machine
2) Path of the file from which I browsed need to be stored in a variable in controllerbean.
This thing I've done as below,
1)...
filePathAccess.jsp
< ice:inputFile id="inputFileName" width="600" autoUpload="true" value="#{fileAccessDataBean.inputFileName}"
actionListener="#{fileAccessControllerBean.browse}"
/>
2)...
FileAccessDataBean.java
private String inputFileName;
public String getInputFileName() {
return inputFileName;
}
public void setInputFileName(String inputFileName) {
this.inputFileName = inputFileName;
}
FileAccessControllerBean.java
public class FileAccessControllerBean {
/** latest file uploaded by client. */
private FileInfo currentFile;
FileAccessDataBean fileAccessDataBean = new FileAccessDataBean();
/**
* This method is for gettingsetting browse.
* @param event ActionEvent
*/
public void browse(ActionEvent event) {
InputFile inputFile = (InputFile) event.getSource();
String filePath = null;
LOG.debug("XXX Getting File Info into currentFile..." + inputFile);
currentFile = inputFile.getFileInfo();
LOG.info("XXX current File Name... " + currentFile.getFileName());
filePath = inputFile.getFileInfo().getPhysicalPath();
LOG.info("XXX physical path... " + filePath);
fileAccessDataBean.setInputFileName(inputFile.getFileInfo().getPhysicalPath());
File file = currentFile.getFile();
filePath = file.getAbsolutePath();
LOG.info("XXX absolute path.. " + filePath);
}
}
=========================================================
Browsed file location: C:\Documents and Settings\personInfo.xml
XXX Getting File Info into currentFile... personInfo.xml
XXX current File Name... personInfo.xml
XXX physical path File Name... U:\glassfish.frontend\domains....\personInfo.xml
XXX absolute path.. U:\glassfish.frontend\domains....\personInfo.xml
in the above two logs I'm getting serverpath of the file.. But I want exact browsed path that is C:\Documents and Settings\personInfo.xml
how can I get the path? Is there any other way to browse the file and get the path of the file into controllerbean?
PLEASE HELP ME OUT It's very urgent requirement for me.
View Answers
Related Tutorials/Questions & Answers:
Advertisements
How to get path of a file in iOS?How to
get path of a
file in iOS? Hi
iOS project I have added a
file abg.jpg, Now I want to know the
path of the image
file when installed in iOS.
Pl let's know the code.
Thanks
Hi,
You can use following code
How to get the output of JSP program using BeanHow to
get the output of JSP program
using Bean Hi
Kindly go... program for the above one by
using Bean and i opened the Tomcat webserver... visit the following link:
http://www.roseindia.net/jsp/
using-
bean-counter.shtml
How to get the output of jsp program using BeanHow to
get the output of jsp program
using Bean Hello my Roseindia...;
Next i created JSP program for the above one by
using Bean and i opened..." %>
<HTML>
<HEAD>
<TITLE>Use
Bean Counter Example <
How to get project pathHow to
get project path my problem is,i have one jar
file,in that one xml is their,i am adding this jar
file to my project,my question is
how i can open or
get that xml
path How to get project pathHow to
get project path my problem is,i have one jar
file,in that one xml is their,i am adding this jar
file to my project,my question is
how i can open or
get that xml
path insert rows from browsed file to sql databaseinsert rows from
browsed file to sql database i need to insert rows... the databases
using odbc i can do this. but after browsing and uploaded the
file, content of the
file has to go to database.
how can i insert record into database
How to Store Image using JSFHow to Store Image
using JSF Hi
How to upload images in db.
using jsf. For
jsf photo uploading .. I used this one code for upload image.........
public void save(Registrationbean
bean) {
try {
PreparedStatement
icefacesicefaces I am
using Facelets with
ICEfaces 1.8. I have a
file details.jspx that is called in two different panels on the same page. What I want... details.jspx has one datatable
HOW TO solve these two datatables rendering problem.I
How to store url path in file ?How to store url
path in
file ? Hi,
How to store url
path in
file... = robot.createScreenCapture(new Rectangle(1000,700));
String
file = "C:/xampp...";
This is store phiscal directory but i want store url
path like
icefacesicefaces I am
using Facelets with
ICEfaces 1.8. I have a
file details.jspx that is called in two different panels on the same page. What I want to do is add a binding attribute to the ice ataTable in details.jspx but when I do
PHP Get Absolute Path
This example shows you
how you can
get the absolute
path of a
file. We... can
get the absolute
path of the
file.
ADS_TO_REPLACE_1
Code:
<?php//to know your absolute
path ADS_TO_REPLACE_2
echo realpath(dirname("
JSF Manage Bean JSF Manage
Bean how to register
JSF manage
bean? Please give me an example.
Thanks!
JSF Manage
Bean Example
Java file absolute pathJava
file absolute
path
In this section, you will learn
how to
get the absolute
path of the
file.
Description of code:
If you want to locate a
file without... in the constructor of
File class whose
absolute
path we want to know. Then call
How to get xml file form http port using web serviceHow to
get xml
file form http port
using web service hi
I am suresh i am
using netbeans 6.9 to develop a web service for getting xml from http port... struck with getting xml
file.
How to access xml
file in web service?
Please Help
ICEfaces
ICEfaces
ICEfaces is a standards-compliant extension to
JavaServer Faces (
JSF) for building and deploying rich AJAX applications that
Smooth, incremental page updates with in-place
File path for jar file not found for the template
file.
Also I had tried to
get that
path from user...
File path for jar file Hi Experts,
I have created one eclipse...
path of the template, which is working as per expectation. But I have created
How to change uploaded file root path ?How to change uploaded
file root
path ? I have
file upload php script.
File upload working is good. But I can't find where saving that
file. I think the files saving in mysql directory.
How to change directory to my desired
path Creating Bean Class In JSF using NetBeans Creating
Bean Class In
JSF using NetBeans
... illustrates
how to create the
Bean Class. This is also called
the Backing
Bean... steps are used to create the
bean class in the
JSF
application:-
ADS
Java get Absolute Path
Java
get Absolute
Path
In this section, you will study
how to obtain the absolute
path...
file.getAbsolutePath() returns the absolute
path of the given
file.
ADS
File Path compare in java
File Path Comparison :compareTo
File Path Comparison :compareTo
In this section, we will discuss
how to compare pathname of two
file for the
equality
Java Construct File PathJava Construct
File Path
In this section we will discuss about
how to construct
file path in Java.
A
file path can be constructed manually or by a Java program. It is best
practice to construct a
file path in Java by a Java Program
Problem in getting file path in jsProblem in getting
file path in js hi,
I am
using ofbiz framework ,
How i can
get the
file path in javascript for input type = "
file" and i am
using only firefox not other browser. so please help me it is very important for me
how to create bean using jsp and servlethow to create
bean using jsp and servlet public class SampleBean {
private String fname=null;
private String lname=null;
private int age=0;
private String gender=null;
private String phone=null;
}
Please visit
PHP hide file pathPHP hide
file path PHP to read a
path and convert that to the virtual link
Java example to get the execution path Java example to
get the execution
path
get execution
path
We can
get the execution
path of the system in java by
using the system property. For getting execution
How to upload file using JSP? How to upload
file using JSP? Hi all,
I m the beginner in JSP, I want to upload
file on server in specific folder.
1)page.jsp...
file upload form to the user</TITLE></HEAD>
<
CMS project using JSFCMS project
using JSF Can i use
jsf for CMS project..? If yes pls give some guidelines to
how to start
Getting path name of uploading file in struts 2.8.1Getting
path name of uploading
file in struts 2.8.1 Hai! I am
using struts 2.8.1. I want to upload
file into database with the
path name.
How can I can
get the original
path name of the
file in struts 2.8.1? It only display
How to write to file using FileOutputStreamHow to write to
file using FileOutputStream Hi friends,
Please help me in java program.
How to write to
file using FileOutputStream?
thanks,
Hi,
To write a
file using FileOutputStream, we have to use
How to write to file using FileWriterHow to write to
file using FileWriter hi,
How to write to
file using FileWriter
thanks,
Hi,
To writing in a
file in Java program we... of the FileWriter class can be created
using the following of its constructor i.e. FileWriter
insert date into database using jsfinsert date into database
using jsf Hello
I need a simple example of source code to insert a date into a database
using jsf
what do I have to put in backing
bean and page
jsf ( i need juste a date )
thanks
ModuleNotFoundError: No module named 'file-path' '
file-
path'
How to remove the ModuleNotFoundError: No module named '
file...ModuleNotFoundError: No module named '
file-
path' Hi,
My Python... have to install padas library.
You can install
file-
path python with following
how to get description for each filehow to
get description for each file hi,
how to
get description for each
file using php or java script.....
condtion:two text boxes for each
file
if the user select 10
file to upload........
get the description
Constructing a File Name path construct a
file name
path. By
using the constructing
filename
path it is possible to set dynamic
path, which is helpful for mapping
local
file name... Constructing a
File Name
path
how to get file extension in javahow to
get file extension in java Hi,
I want to
get the
file extension in Java.
how to
get file extension in java?
Thanks
Hi,
Here is sample code to
get file extension in Java:
package examples;
import