File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes Jar file generation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "Jar file generation" Watch "Jar file generation" New topic
Author

Jar file generation

Xinsheng Chen
Greenhorn

Joined: May 28, 2008
Posts: 7
I am generating a jar file for my portlet development. I need to read a text file for data. I can hard-code the absolute path of the file on my laptop and the code runs fine. But the jar will eventually be deployed onto the application server. How could I specify the path of the text file so that my jar file will work on both my laptop and the application server?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

Could a resource reference in the web module do the trick for you?

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
Jonas X. Yuan
author
Ranch Hand

Joined: May 18, 2008
Posts: 108
Hi,

In Liferay, we can refer any contents as

/package-name/path/filename

in Tomcat /webapps/...


Books: Liferay Portal 6.1 Systems Development
Xinsheng Chen
Greenhorn

Joined: May 28, 2008
Posts: 7
This helps.

Thank you, Jonas!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Jar file generation
 
Similar Threads
Deploy on Tomcat
Host not found using pscp
File not found as class resource in jar...
javax.swing.text package
Applet loads from i dont know where