Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

path problem in tomcat

Thread view: 
db - 27 Jun 2006 14:48 GMT
Hallo@all

I got a problem with Tomcat. I am developping a web service based on
jsf, and using tomcat as container.

My problem is if i start Tomcat in Eclipse, the default root path is
D:\Programme\Apache Software Foundation\Tomcat 5.5\webapps\myproject

however if i start tomcat through tomcat configuration directly, the
default root path changed to D:\Programme\Apache Software
Foundation\Tomcat 5.5\

Since in my program there are files are written and read, the path is
important. And i need to debug the code under eclipse. I can not change
the pathes each time when i switched back to eclipse.

I hope u understand what i mean. That must be a configure problem, but
i just can not figure it out.

I know the answer may be only several words, but plz dont save them, i
need them urgently!

Thanks!

db
db - 28 Jun 2006 17:30 GMT
no one replies me, i am so poor~~~

mei ren hui da, wo hao ke lian T_T

db
Juha Laiho - 28 Jun 2006 20:29 GMT
"db" <adherent@gmail.com> said:
>I got a problem with Tomcat. I am developping a web service based on
>jsf, and using tomcat as container.
[quoted text clipped - 5 lines]
>default root path changed to D:\Programme\Apache Software
>Foundation\Tomcat 5.5\

Please clarify what you mean by "default root path"? Just "current
directory"/"default directory", or something else?

If you just mean that the default directory changes, then I have an
easy answer: don't use the default directory for anything.

>Since in my program there are files are written and read, the path is
>important. And i need to debug the code under eclipse. I can not change
>the pathes each time when i switched back to eclipse.

I think you could use ServletContext.getRealPath() to properly handle
different directory layouts; see:
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#
getRealPath(java.lang.String
)
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)

db - 29 Jun 2006 10:36 GMT
what i mean is if i attach a piece of code inside the bean, like
....getRuntime().exec("pwd") to show the current path, the result is
different with start tomcat from eclipse or start it directly.

thanks for replying

db
Juha Laiho - 29 Jun 2006 16:24 GMT
"db" <adherent@gmail.com> said:
>what i mean is if i attach a piece of code inside the bean, like
>....getRuntime().exec("pwd") to show the current path, the result is
>different with start tomcat from eclipse or start it directly.

Yep, in that case you'd be much better off with picking the paths
in the way I described.
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.