Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Himai Minh

Linking to file in WEB-INF

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone! i am new to Java EE programming and have successfully deployed a java application for the first time! The application works fine when im testing on my local machine, but when i get the app online, it fails to locate a .txt file that is included in the WEB-INF folder. I am not too knowledgable about deploying java to the web, and im using my uncles web hosting service. He uses Plesk to manage this many websites, and his server has Tomcat 7.x. To get my java app on my domain, i simply give Plesk a .war file and everything else is done automatically.

This code works for me when i am on my local machine:

ItemIO is looking to accomplish this:

Once the app goes online, im not really sure what source i should be specifying. to create this File object. Any help or ideas would be greatly appreciated.

I would like to avoid the solution of putting the .txt in a directory that is accessible by the public.

Posts: 67537
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
Welcome to the Ranch.

You haven't really said what your specific issue is. Do you get an error message? if so, please include it in a reply.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic