Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2007, 04:28 PM
Member
 
Join Date: Dec 2007
Posts: 2
jeffpoulsen is on a distinguished road
echo of pwd
Hello All,

Happy to become a member. I have a problem with a script I use to generate an expandable menu for folders that I use on a website. I need to inject the pwd or cwd into the path for the links to the file. Below is the line that handles this. I have put **** where I need the working directory placed.

href="view_file.php?file=****/<!--#echo var='relurl'-->"><!--#echo var="fullname" -->


I am not to familiar with java yet but I have tried several different variations to inject the directory but none has worked. Could anybody point me the proper direction so I may get this codded correctly? All help is greatly appreciated. jeff
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-03-2007, 04:39 PM
Senior Member
 
Join Date: Jun 2007
Location: Bali, ID
Posts: 100
wsaryada is on a distinguished road
Does PWD or CWD means the current working directory? What is the value that you really want to pass to the file parameter? can you give an example of its value?
__________________
Website:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Blog:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-03-2007, 04:51 PM
Member
 
Join Date: Dec 2007
Posts: 2
jeffpoulsen is on a distinguished road
WSARGDA

Thanks for your quick reply. The line should return a value that gives the current working directory. Ex:

href="view_file.php?file=home_directory/sub_directory/file_needed.htm"

The line as posted above returns:

href="view_file.php?file=/sub_directory/file_needed.htm"

Which will not work. as I need the home_directory to complete the path.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-04-2007, 04:14 PM
Senior Member
 
Join Date: Jun 2007
Location: Bali, ID
Posts: 100
wsaryada is on a distinguished road
When using Java Servlet or JSP you can get the real path where you application is stored on the disk using:

Code:
getServletContext().getRealPath("");
Is this what you are looking for?
__________________
Website:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Blog:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
An echo server using UDP sockets Java Tip java.net 0 04-07-2008 09:09 PM


All times are GMT +3. The time now is 07:57 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org