Webapp root path

Hi all,
How do I find a JSP application's root path in a help class used by a java bean? I use Tomcat 4 and what I want is the /webapps/app path.
BR
Markus

application.getRealPath("/");

Similar Messages

  • Root path links and tomcat

    Hi!
    I'm using tomcat 5.5 and I made a simple webapp:
    tomcat_dir/webapps/myapp
    I'm using root paths when refering to images, docs, servlets, and so within myapp (servlets, jsp, html, etc.)... For example:
    <img src="/myapp/imgs/pic1.jpg" ...>
    <form ... action="/myapp/servlets/sendMail.do">
    request.getRequestDispatcher("/es/thanks.jsp");all this root path links works fine whenever I'm running my web app from localhost (http://localhost/myapp/index.html) but whenever I running it from internet (http://myapp.mydomain.com) I can't get the web app to work, instead I get the glamorous HTTP 400 error
    What do I'm doing wrong? I've tried using relative paths and myapp works both localhost and internet way... but what do i need to do to use root paths?
    thx

    when u are getting error code 400, pls notice what the url has formed...copy and paste it here inthis forum..

  • Flex mobile project: web root and root path for a remote web service?

    Hi all,
    i'm trying to set up the testdrive tutorial for flex mobile project, with flash builder 4.5
    and php data.
    I've uploaded the files on my remote web space (e.g. http://mywebsite.org, and the
    test file is http://mywebsite.org/TestDrive/test/test.php... and it works
    correctly)... But when i'm setting properties of the project, i don't know what
    to write into the web root and root path fields... I thing root path is simply
    http://mywebsite.org... and whatever i write in the other fields (output folder
    too) i have errors when i click on "validate configuration"...
    What should i put into those fields? is zend framework (and gateway.php)
    strictly necessary?
    As you can see... i'm a bit confused....
    Many thanks for any help
    Bye
    Alex

    I thought it was a simple question...
    No advice?

  • How to set FileSystemWatcher powershell script to exclude folders within the root path being monitored?

    All,
    I want to use a pre-fab script to monitor the OS folders on a Windows 2008 R2 Domain Controller and send any changes into the Event Log.  But there are two folders in the file path I want to exclude because changes to them would fill up the Event Logs
    too quickly.  Thus, I want to monitor all folder in C:\Windows but want to exclude C:\Windows\Temp and C:\Windows\debug.
    The script I want to use is below.
    #This script uses the .NET FileSystemWatcher class to monitor file events in folder(s).
    #The advantage of this method over using WMI eventing is that this can monitor sub-folders.
    #The -Action parameter can contain any valid Powershell commands. 
    I have just included two for example.
    #The script can be set to a wildcard filter, and IncludeSubdirectories can be changed to $true.
    #You need not subscribe to all three types of event.  All three are shown for example.
    # Version 1.1
    $folder = 'C:\Windows' # Enter the root path you want to monitor.
    $filter = '*.*'  # You can enter a wildcard filter here.
    # In the following line, you can change 'IncludeSubdirectories to $true if required.                          
    $fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $true;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}
    # Here, all three events are registerd.  You need only subscribe to events that you need:
    Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore green
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
    Register-ObjectEvent $fsw Deleted -SourceIdentifier FileDeleted -Action {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore red
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
    Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged -Action {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore white
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"}
    # To stop the monitoring, run the following commands:
    # Unregister-Event FileDeleted
    # Unregister-Event FileCreated
    # Unregister-Event FileChanged
    Is there a command line I can use to exclude thos two folders?
    Thanks

    First, thank you to everyone who has been helping me.  I've gotten a little bit further in what I need to do.  I still have two problems that I really need help in sorting out:
    1. The script will run on Windows 7 with no errors but will not run on a Server 2008 R2 Domain Controller.  On the DC, I get an error for the SourceIdentifier:  "A parameter cannot be found that mataches parameter name 'SourceIdentifier'."
    2. Even though the script runs on Windows 7 with no errors, I tested it by making changes to the Temp and debug folders and the changes were still being recorded in the logs.
    A copy of the updated script I am running is below:
    #This script uses the .NET FileSystemWatcher class to monitor file events in folder(s).
    #The advantage of this method over using WMI eventing is that this can monitor sub-folders.
    #The -Action parameter can contain any valid Powershell commands.  I have just included two for example.
    #The script can be set to a wildcard filter, and IncludeSubdirectories can be changed to $true.
    #You need not subscribe to all three types of event.  All three are shown for example.
    # Version 1.1
    $folder = 'C:\Windows' # Enter the root path you want to monitor.
    $filter = '*.*'  # You can enter a wildcard filter here.
    # In the following line, you can change 'IncludeSubdirectories to $true if required.                          
    $fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{IncludeSubdirectories = $true;NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'}
    # Here, all three events are registerd.  You need only subscribe to events that you need:
    $Script:excludedItems = 'C:\Windows\Temp','C:\Windows\debug'
    Register-ObjectEvent $fsw Created -SourceIdentifier FileCreated -Action {
    If ($excludedItems -notcontains $Event.SourceEventArgs.Name) {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore green
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"} }
    Register-ObjectEvent $fsw Deleted -SourceIdentifier FileDeleted -Action {
    If ($excludedItems -notcontains $Event.SourceEventArgs.Name) {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore red
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"} }
    Register-ObjectEvent $fsw Changed -SourceIdentifier FileChanged -Action {
    If ($excludedItems -notcontains $Event.SourceEventArgs.Name) {
    $name = $Event.SourceEventArgs.Name
    $changeType = $Event.SourceEventArgs.ChangeType
    $timeStamp = $Event.TimeGenerated
    Write-Host "The file '$name' was $changeType at $timeStamp" -fore white
    Out-File -FilePath c:\scripts\filechange\outlog.txt -Append -InputObject "The file '$name' was $changeType at $timeStamp"} }
    # To stop the monitoring, run the following commands:
    # Unregister-Event FileDeleted
    # Unregister-Event FileCreated
    # Unregister-Event FileChanged
    Thanks in advance for any help you can give.

  • How can I use a weblogic server's root path in an XML?

    Hi all,
    I hope I posted this to the correct newsgroup...
    Anyway, I have a question about getting a Weblogic (9.2) server's root directory in an XML config file. I'm trying to use a log4j.xml file to set up a logger for my application, but when I use just the file name in the "file" parameter for the Appender, the logger writes the file to the domain directory. I'm avoiding hard-coding of the server path because the deployment system's configuration may be different than mine.
    So, is it possible to get the server's root directory in an XML config file?
    Thanks for the help!

    By the way, here's the XML:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
      <appender name="mibLogFile" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="File" value="mib_application.log" />
        <param name="DatePattern" value=".yyyy_MM_dd"/>
        <param name="Append" value="true"/>
        <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%d{MM/dd/yyyy HH:mm:ss} [%t] %c %x%n  %-5p %m%n"/>
        </layout>
      </appender>
      <root>
        <level value="info"/>
        <appender-ref ref="mibLogFile"/>
      </root>
    </log4j:configuration>I tried using "$WL_ROOT/logs/" at the start of the file name, thinking that $WL_ROOT would work for the env variable for the server root path. But it doesn't exist, and I don't think I'll have access on the deployment server to add any environment variables, so I was hoping to use something native to Weblogic. Any thoughts??

  • The root path of location OUTPUT_FILE_DIR

    The root path of location OUTPUT_FILE_DIR must be specified as one of the file paths for the UTL_FILE_DIR parameter in the init.ora for the runtime instance. The root path of location OUTPUT_FILE_DIR must be a file path on the server.
    give me some hints

    Sorry, what is the context of "location OUTPUT_FILE_DIR"?
    Nikolai Rochnik

  • Unable to determine the install root path for the LabVIEW Runtime Engine

    Hi,
    i have an issue with using a LabVIEW interop assembly in a .NET application. I get an exception "Unable to determine the install root path for the LabVIEW Runtime Engine" when calling the assembly.
    The little test program is attached below. It's called dotNETHost.exe. If you excecute the programm a dialog with an button appears. Clicking the button shall open another dialog (the LabVIEW Interop component). But the only thing I get is the exception message. The ZIP folder also contains the complete exception meassage (ExceptionMessange.jpg & ExceptionDetails.txt).
    The Interop Assembly was built with LabVIEW 2011. We use Visual Studio 2010 and .NET 4.0.. The dotNETHost.exe.config file is prepared as mentioned in Knowledge base - Loading .NET 4.0 assemblies.
    The Interop assembly contains only one simple dialog (loop is finished by clicking OK) without calling any other VIs or other DLL's.  In case of this there's also no support directory generated by the build process.
    I have no idea why it doesn' work. I hope anyone can help me.
    Thanks in advance
    Kay
    Attachments:
    Debug.zip ‏75 KB

    This may be unrelated, but Labview and .Net4.0 dont work well together. Not yet anyway. I had to compile my assembly in 3.5 to get it to work.
    Please read the following:
    http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/configuring_clr_version/
    http://digital.ni.com/public.nsf/allkb/32B0BA28A72AA87D8625782600737DE9
    http://digital.ni.com/public.nsf/allkb/2030D78CFB2F0ADA86257718006362A3?OpenDocument
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • MDM syndicator, Root path is disabled

    Hi
    I have created xsd version of my repository and in the MDM syndicator, Root path is disabled.
    should I have to create xsd root file or how can I do that
    thanks
    Manian

    Hi Manian,
    if your root path is disabled, i.e. you cannot select any, when you are specifying your schema file, then most likely there is an error in the xsd file. Try to validate it again.
    Otherwise, if you refer to the mapping part:
    1. You set up "XML File Output" to "Multiple Files" in the Map Properties, then you do not need the root element anyway.
    2. You set up "XML File Output" to "Single File" in the Map Properties, then you need to specify a repeatable node name. If this is supposed to be your root, then you need to specify another root node in the xsd.
    Best regards
    Christian
    Edited by: Christian Heuer on Jul 8, 2008 4:08 PM

  • AD "Root Path" GPO property as home

    Hello,
    I have an AD integration question. On our Windows
    network the "Root Path" GPO user property is being
    used. Can this path be utilized by 10.4.7 as home
    dir.?
    This GPO seems to have no effect with the "Use UNC
    path..." Directory Access setting checked and "Force
    local home..." unchecked. What does work however is
    hardcoding the "Connect Z: To:" AD property.
    Any suggestions much appreciated,
    Thank you
      Mac OS X (10.4.7)  

    The issue you are likely running into is the fact that OS X does not support DFS shares. You need a third party product (http://www.thursby.com/products/admitmac.html) to pull that off. The closest you can try is to identify which server in the DFS cluster contains the home folder and attempt a direct map to that server. Permissions and inheritance will likely not function, but since this is a home folder you may not care.
    Also, I remember the guys from ExtremeZ came up with a fake DFS solution but I can not recall the details.
    Hope this helps

  • Get Root Path

    Hello All,
    I run the following code on my computer but, return me the location of JRE and not the root path of program?
    public class GetRootPath {
         * @param args
         public static void main(String[] args) {
              String path = ClassLoader.getSystemResource(".//").toString();
              System.out.println(path);
    The output is : file:/C:/Programs/Java/jre1.5.0_06/lib/ext/X86//
    as you know this should return the root path not the JRE location,
    i run that code in another machine and it work properly, so
    why it did not work on my machine?
    any one know, how i can resolve this problem?
    thanks!
    Hamzeh Khazaei

    This will print the current working directory
    System.out.println(System.getProperty("user.dir"));#

  • How to List the Root Path?

    Hi all,
    How can I list the root path? (windows: "My Computer", UNIX: / )
    I tried
    File f = new File("/");
    String s = f.list();
    It didn't work....
    Thanks for your help.

    What do you mean doesn't work, works just fine.
    String s = f.list();should be String[]

  • [solved ... :P] yaourt - 'm' is not a valid root path

    [root@pwn etc]# yaourt -noconfirm -Sybu
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    local database is up to date
    error: 'm' is not a valid root path
    Aaahhh!!!
    Noooo!!!
    Don't!!!!
    How can I fix it?
    Last edited by synthead (2007-09-24 02:23:18)

    it's --noconfirm, with '2' hyphens

  • Failed to get root path for 'UED'

    Good afternoon.
    I have a problem with my IDES installation in University.
    After a server reboot, MAXDB doesn't want to give up.
    This is the log:
    $ tail startdb.log
    Error! Connection failed to node dolphin for database UED: database not found                    
    Opening Database...
    Failed to get root path for 'UED'
    Error! Connection failed to node dolphin for database UED: database not found                    
    Fri Aug 24 17:11:11 CEST 2007
    Connect to the database to verify the database is now open
    dbmcli check finished with return code: 0
    If I try to run dbmcli manually, I receive the same error:
    $dbmcli -u control,****** -d UED
    Failed to get root path for 'UED'
    Error! Connection failed to node (local) for database UED: database not found
    Any suggestions??
    Regards,
    Luca

    Hi Markus,
    I think that my problem is not completely solved.
    In fact, now the IDES system is on , but I'm not able to login into it.
    When I select UED system on menu of my JAVA GUI and press "connect button", I can't access to SAP login window. (see )
    I'm sure that is not a "network problem" of my laptop. (the problem persist also with others SAPGUI).
    I've tried to <b>reboot</b> the server, but the situation is always the same. No way to access into the system, popup "connecting" reman.
    If I try to see process that are running in the server, via "top -u uedadm" command, this is the situation:
    3791 uedadm    16   0 87988 9768 1996 S    0  0.2   0:00.00 sapstartsrv                                                                               
    4775 uedadm    15   0 54664 1580  904 S    0  0.0   0:00.04 csh                                                                               
    4911 uedadm    16   0 54664 1604  920 S    0  0.0   0:00.05 csh                                                                               
    5388 uedadm    20   0 26788 1896 1064 S    0  0.0   0:00.04 sapstart                                                                               
    5408 uedadm    16   0 35736 5748 3024 S    0  0.1   0:00.06 ms.sapUED_DVEBM                                                                               
    5409 uedadm    16   0 4480m 100m  86m S    0  2.5   0:00.95 UED_00_DP                                                                               
    5410 uedadm    16   0 27528 2988 2224 S    0  0.1   0:00.05 co.sapUED_DVEBM                                                                               
    5411 uedadm    16   0 27488 2952 2216 S    0  0.1   0:00.04 se.sapUED_DVEBM                                                                               
    5412 uedadm    18   0 17620 2432 1800 S    0  0.1   0:00.01 ig.sapUED_DVEBM                                                                               
    5413 uedadm    16   0  210m  12m 3352 S    0  0.3   0:00.20 igsmux_mt                                                                               
    5414 uedadm    16   0  183m  18m  10m S    0  0.5   0:00.16 igspw_mt                                                                               
    5415 uedadm    16   0  183m  18m  10m S    0  0.5   0:00.19 igspw_mt                                                                               
    5430 uedadm    15   0  188m 8296 5972 S    0  0.2   0:00.05 gwrd                                                                               
    5431 uedadm    18   0  164m 4376 2844 S    0  0.1   0:00.63 icman                                                                               
    5432 uedadm    17   0 4486m  22m 7988 S    0  0.6   0:00.01 UED_00_DIA_W0                                                                               
    5433 uedadm    17   0 4486m  22m 7976 S    0  0.6   0:00.01 UED_00_DIA_W1                                                                               
    5434 uedadm    16   0 5201m  79m  63m S    0  2.0   0:00.82 UED_00_DIA_W2                                                                               
    5435 uedadm    17   0 4486m  22m 7976 S    0  0.6   0:00.01 UED_00_DIA_W3                                                                               
    5436 uedadm    17   0 4486m  22m 7980 S    0  0.6   0:00.02 UED_00_DIA_W4                                                                               
    5437 uedadm    16   0 4486m  22m 7980 S    0  0.6   0:00.02 UED_00_DIA_W5                                                                               
    5438 uedadm    16   0 4486m  22m 7976 S    0  0.6   0:00.01 UED_00_DIA_W6                                                                               
    5439 uedadm    16   0 4486m  22m 7976 S    0  0.6   0:00.02 UED_00_DIA_W7                                                                               
    5440 uedadm    17   0 4486m  22m 7980 S    0  0.6   0:00.01 UED_00_DIA_W8                                                                               
    5441 uedadm    16   0 4486m  22m 7976 S    0  0.6   0:00.02 UED_00_DIA_W9                                                                               
    5442 uedadm    17   0 4486m  22m 7976 S    0  0.6   0:00.02 UED_00_DIA_W10                                                                               
    5443 uedadm    17   0 4486m  22m 7984 S    0  0.6   0:00.01 UED_00_DIA_W11                                                                               
    5444 uedadm    17   0 4486m  22m 7972 S    0  0.6   0:00.02 UED_00_UPD_W12                                                                               
    5445 uedadm    17   0 4486m  22m 7972 S    0  0.6   0:00.01 UED_00_UPD_W13                                                                               
    5446 uedadm    17   0 4486m  22m 7976 S    0  0.6   0:00.01 UED_00_UPD_W14                                                                               
    5447 uedadm    16   0 4486m  22m 7976 S    0  0.6   0:00.02 UED_00_ENQ_W15                                                                               
    5448 uedadm    16   0 4486m  22m 7976 S    0  0.6   0:00.02 UED_00_BTC_W16                                                                               
    5449 uedadm    17   0 4486m  22m 7980 S    0  0.6   0:00.01 UED_00_BTC_W17                                                                               
    5450 uedadm    17   0 4486m  22m 7976 S    0  0.6   0:00.01 UED_00_BTC_W18      
    I think that is not a performance problem of server, because
    "free -m" command
                       total       used       free     shared    buffers     cached
    Mem:          3946       2249       1697          0         50        950
    -/+ buffers/cache:       1247       2699
    Swap:         8001          0          8001
    Can you please me, give some suggestions?
    Thank you very much.

  • What is the webapp root url?

    I have some problems resolving urls in my webapp jsp. The webapp is packaged in
    a war file inside a ear file. in the ear file's application.xml, I specified
    that the context root for the webapp to be /foo. However, if I wrote in my jsp
    a uri like /bar, it takes me to http://localhost:7001/bar, instead of http://localhost:7001/foo/bar.
    how can i use the webapp root context in my jsp?
    -hoki

    I guess you will have to use the servlet-mapping in the web.xml to do the mapping.
              Ho-Ki Au wrote:
              > I have some problems resolving urls in my webapp jsp. The webapp is packaged in
              > a war file inside a ear file. in the ear file's application.xml, I specified
              > that the context root for the webapp to be /foo. However, if I wrote in my jsp
              > a uri like /bar, it takes me to http://localhost:7001/bar, instead of http://localhost:7001/foo/bar.
              > how can i use the webapp root context in my jsp?
              > -hoki
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • Apache Tomcat Web Root Path Disclosure Vulnerability ..any fix avaialable

    Apache Tomcat Web Root Path Disclosure Vulnerability
    do anyone know that any fix is available for this vulnerability
    my tomcat version is 5.0.28
    java 1.4
    more details my scan result
    A vulnerability was reported for Apache Tomcat Version 4.0.3 on a Microsoft Windows platform. Reportedly, it is possible for a remote malicious user to make requests that will result in Apache Tomcat returning an error page containing information that includes the absolute path to the server's Web root.
    For example, submitting a request to Tomcat for LPT9 results in the following error message: "java.io.FileNotFoundException: C:Program FilesApache Tomcat 4.0webappsROOTlpt9 (The system cannot find the file specified)".
    IMPACT:
    A malicious user can obtain the absolute path of the Web server root directory, which could aid in further attacks against the host.
    SOLUTION:
    A fix has not been released. Please check Apache's Web site for more information.my application runs well without any problem but this was the scan result submitted by my security people

    thanks for replay.
    I followed the documentation in the appache's commons datasource documentation and that worked .
    thanks once again

Maybe you are looking for