File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes servlet with file text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet with file text" Watch "servlet with file text" New topic
Author

servlet with file text

alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
please somebody can help me
when I try to run program that contained file text ( on servlet) the server can not run it .it writes: this program cannot display the webpage. why its happen?
what can I do?
when I wrote programm that does not contain file text, the server works well
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

I don't know what you mean by "file text".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
its mean that the progrram contains file.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

You will find that the number and quality of your answers greatly depends upon the quality of your questions. Yours isn't faring well so far.

I still don't know what you mean. All programs "contain files". If you are not going to take the time to explain what you mean by that, why should anyone volunteer their time to try and help you?
alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
I hope that now you will understand me bettet my programm have to read file
I attached the code:
BufferedReader in = new BufferedReader(new FileReader(
"C:\\Documents and Settings\\Owner\\workspace\\example9\\user.txt"));
String str;
while ((str = in.readLine()) != null) {

StringTokenizer st = new StringTokenizer(str);
while(st.hasMoreTokens()){

if(command.equals("current")){
and I think this code make the problem to the server so its cannot display
the website. if I didnt attach this code the program works well.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

Then I expect there is something wrong with that code. Does it throw any exceptions? And what happens on the client side? Do you see nothing, or some HTTP error code?
alona ariel
Ranch Hand

Joined: Sep 09, 2008
Posts: 36
this is the code that make the problem to the server

if(command.equals("current")){
key=st.nextToken();

(if I dont write this code the server works well)
the server stuck in and after long time it say this program cannot display the webpage.
is it something wrong with it
what I can do?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet with file text