• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

createNewFile() on linux hosting

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nice to meet you.
I've a strange problem while creating a simple 'hello.txt' in a jsp page.
Here the code:

....

....

I obtain no errors but 'hello.txt' doesn't exists on my linux remote server (Tomcat 6.0 - container).

Any suggestion?
Thanks a lot

Dany
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ignoring the fact that you shouldn't be putting Java code in a JSP page...

"hello.txt" is a relative file path which makes no sense in the context of a web app.

Where in the file hierarchy do you want it to go? For example, "/hello.txt" will place it at the root of the web app context.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"dani dani", please check your private messages for an important administrative matter.
 
Danilo Cosenza
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Ignoring the fact that you shouldn't be putting Java code in a JSP page...

"hello.txt" is a relative file path which makes no sense in the context of a web app.

Where in the file hierarchy do you want it to go? For example, "/hello.txt" will place it at the root of the web app context.



Thanks Bear.
Doesn't work too (tested some hours ago).
It's possible i've not a permission to write files in the root of my webapp?
When i tested this function on my locale pc (windows - tomcat 6.0), all works fine.
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If permission is not an issue print your fileName value in your log so that you can find the cause of the issue.
 
Danilo Cosenza
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Venkat Sadasivam wrote:If permission is not an issue print your fileName value in your log so that you can find the cause of the issue.



Thanks for reply.
I'm not able to do that.
I've tried to store an exel file on server using Apache Poi.




test.xls doesn't appear in /var/www/html but no errors occurred.

 
Danilo Cosenza
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SOLVED

By clicking on html folder on server, i'v changed the permission to write on it.
All works fine and an excel file is visible.

 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic