Solved

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

Posted on 2008-10-15
3
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
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.

626 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