Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need to provide a dialog box for the user to select a file in jsp

Posted on 2008-10-15
3
Medium Priority
?
231 Views
Last Modified: 2010-05-18
i have a jsp file [which executes a XSL transformation] and need to provide a dialog box so that the user can select the input xml file on which the xsl transformation can be done. How to do it jsp? And the file which will be selected will be in the server...
0
Comment
Question by:emsenthil
3 Comments
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 22718650
You can follow this to upload the file http://www.devsphere.com/mapping/docs/guide/upload.html
0
 

Author Comment

by:emsenthil
ID: 22718717
Hi, Thanks for your reply.
But, I need the user to select the file which is in the server itself by providing a navigation box... I don want the user to upload the file.
0
 
LVL 28

Accepted Solution

by:
rrz earned 1500 total points
ID: 22721972
You could use something like the following code. If you want it in a pop-up, then we could add javascript to do that.
<%@ page import="java.util.*,java.io.*" %>
<html>
<body>
Selected file is ${param.file}
<form>
<%
  File dir = new File(application.getRealPath("/xmlFiles"));
  String[] fileList = dir.list();
  for(int i =0 ; i<fileList.length ; i++){
      out.print("<input type='radio' name='file' value='" + fileList[i] + "'/>" + fileList[i]);
  }
%>
<input type="submit"/>
</form>
</body>
</html>

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question