Solved

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

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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 171
eclipse with Angularjs2.0 3 64
servlet and mdb, jms error 1 54
how to debug htl and js pages 8 53
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.

679 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