This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 63349
    
  70

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: 63349
    
  70

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
Sheriff

Joined: Oct 14, 2005
Posts: 19747
    
  10

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
 
It's not a secret anymore!