| Author |
I need to call a HtML file in c drive from my jsp
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hi .,
Please tell me if this is possible .
I need to call a HTML file which is in C drive from my jsp running under server .
Thanks in advance .
|
Save India From Corruption - Anna Hazare.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
What do you mean by call?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Means i need to show that HTML content which is in C drive . It is a simple HTML page .
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
So, all you need to do is forward to it from your JSP?
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
Yes Paul . Please tell me the solution
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Have a read of the documentation for <jsp:forward />.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
I tried with this <jsp:forward > but its not working an dalso i tried with
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
What happened when you tried? "Its not working" doesn't give us much to work with; you need to TellTheDetails otherwise we can't help.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
I mean to ask is this possible to access client files from server ??
To your question
I got different exceptions when used different ways :
when used RequestDispatcher.include or forward i got NullPoilterException at Rd.include(request,response);
Used response.sendRedirect the browser used to show a default page of windows(the page we will get when internet is not accessable)
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
I mean to ask is this possible to access client files from server ??
Not this way. You can only redirect to stuff on the server. If you want to "call" an HTML file from the server you will need to first get the client to upload it.
Seems like a wierd thing to be trying. Why do you want to do this?
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Thanks paul ,
Our requirement is that we are getting some data/ reports from database and it is kept in the form of HTML files stored on to the client drive . so we need to access it .( I can't answer more queries on this as i am not an architect , just developing what my Manager wishes)
Please tell me if this task is possible using an HttpClient or an java.net package ) anything is okay to achieve this .
( sorry for the late reply as we don't have access to internet at work, just post questions from a different machine when it is free )
|
 |
Vikas Kapoor
Ranch Hand
Joined: Aug 16, 2007
Posts: 1374
|
|
|
Ravi whatever you are trying looks odd. What do you store on client side? Actually, why do you need to store anything on client side? Please describe the situation.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
As i already said . I need to do this .Please tell me if there is any way to achive this task .
|
 |
Abhi Roy
Greenhorn
Joined: Jun 23, 2009
Posts: 22
|
|
|
use jsp:include...
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
|
Thanks i will try and inform you the status .
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Abhi Roy wrote:use jsp:include...
This will not work if the include exists on the client
Our requirement is that we are getting some data/ reports from database and it is kept in the form of HTML files stored on to the client drive . so we need to access it .( I can't answer more queries on this as i am not an architect , just developing what my Manager wishes)
So, this data is stored in the database, but you have been asked to access it once it has been downloaded on to the client's machine?! Why not just access it directly from the database? I would speak to your architect - that requirement is just plain crazy. A bit of discussion with your architect might be a good thing, it sounds like this needs clarification.
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Paul .This project has not got an architect .
What the manager thinks that has to be done .
Anyway jsp:include also not working . But i have managed it calling explorer.exe and it somehow worked .
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
You have managed to call explore.exe on the client? How?
|
 |
 |
|
|
subject: I need to call a HtML file in c drive from my jsp
|
|
|