Results 1 to 4 of 4

Thread: echo of pwd

  1. #1
    jeffpoulsen is offline Member
    Join Date
    Dec 2007
    Posts
    2
    Rep Power
    0

    Default 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

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default

    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?

  3. #3
    jeffpoulsen is offline Member
    Join Date
    Dec 2007
    Posts
    2
    Rep Power
    0

    Default

    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.

  4. #4
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default

    When using Java Servlet or JSP you can get the real path where you application is stored on the disk using:

    Java Code:
    getServletContext().getRealPath("");
    Is this what you are looking for?

Similar Threads

  1. An echo server using UDP sockets
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 08:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •