• Post Reply Bookmark Topic Watch Topic
  • New Topic

not able to create a file from jsp by calling java function  RSS feed

 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
When i call this page from java main() function it is creating file, writing the contents in that

But when i call this from jsp, i is not creating file, but it is printing
1 5(the limit which i passed to the function)
2

is there any restriction like this in jsp?


jsp code

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36441
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajesh,
Does it throw an Exception?

Also, where are you looking for the file? It should be in the server's working directory. It wouldn't be on the client since web pages can't access the client's file system - would you want a web page deleting all your files?
 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Boyarsky ,
It doesn't throws any exception, and file is not created in server

and i am able to see the logs "System.out.println("2");", which i used for testing
 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got it
changing



it's working that means
it was creating file previously also, but where?

can any one help me
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36441
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rajesh Veluchamy:
it's working that means
it was creating file previously also, but where?

The server's working directory. This could be where the java.home variable points. Or it could be somewhere else. It really depends on the server. The easiest way to find out is to do a search for the generated file name.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!