Solved

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

Posted on 2008-10-15
3
203 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 27

Accepted Solution

by:
rrz earned 500 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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 …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now