Accesing a File outside Web Application

Hi All

I am designing a inter network search application using lucene.. While this process i came across a scenario i am displaying the searched file path to the user to acces it.. But in my Jsp i am not able to access any file out side my web application.. I think some sort of security is maintained by browser or JDK Itself..... can any one help me how to by pass this security and acccess the file outside webapp.. a simple statement like this

I am using Tomcat 5 for this...

There is no way i can bring the files inside webapp as it is an search application and should be able to get files from anywhere..

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Search Results</title>

</head>

<body bgcolor="grey">

<form name="search">

<table align="center" cellpadding="0" cellspacing="0" border="1">

<tr>

<td>

<center>

<ahref="C:\Lucene\src\com\tu\lucene\Xmldatareader.java">

C:\Lucene\src\com\tu\lucene\Xmldatareader.java

</a>

</td>

</tr>

</table>

</form>

</body>

</html>

Thanks in Advance

[1338 byte] By [sunildm4ua] at [2007-11-26 17:47:19]
# 1

It doesn't work the way you are expecting it to work.

Searching only works for documents that are available under the root context that means whatever is under http://host/ .

This is a Lucene related question. Subscribe to the Lucene User Mailing List : http://lucene.apache.org/java/docs/mailinglists.html#Java%20User%20List and post your question to the list.

appy77a at 2007-7-9 4:59:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Obviously the client can't access any file not in the web application.

The common solution is to have a servlet that loads the requested file (using standard File I/O) and then send it via the ServletOutputStream.

The user is only accessing the web application.

The Web app is responsible for finding the file (whereever it is) and returning it.

Putting it in java code means you can put appropriate security around it.

Hope this helps,

evnafets

evnafetsa at 2007-7-9 4:59:37 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...