Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
endX challenge 2 63
HTTPSessionBindingListernter not configured in deployment descriptor 2 39
Windows 10 and JDK 7 7u85 4 33
eclipse with Angularjs2.0 3 17
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 last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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.

867 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

12 Experts available now in Live!

Get 1:1 Help Now