Obtaining root directory of web application

Hi all.
I am beginer in web application developing. You probably know how it is. Problem after problem:)
So I started developing in JSF using NetBeans 6.0 with Tomcat 6.0.14 and i have the folowing problem:
How can I programically get the root directory of my web application? I need it because I use some kind of filter, which redirects to error page, when unauthorized user tries to access protected resources. This error page is in root directory of my web application and has commandLink to logging site (action is set for method, which returns some string and navigation is defined for this string in facesconfig.xml), which is also in root directory. When I want to access for example /restricted/user/userPage.jsp and I am not logged in, the error page is displayed, but command link does not work. I supose the is a problem in current directory which is probably set for /restricted/user/.
Thank You for any clues.
Regards,
Jahn Gurda

Hello!
I am also new to web applications and JSF. But I can tell you that its a little hard to programically achieve the security you want to achieve i.e. displaying some error page if the user is not logged in, however you can do it relatively easily using web.xml or sun-web.xml files by defining some roles, filters etc.
I read that somewhere, try searching on Google...I have not implemented that myself.
As far as obtaning the root directory of web application is concerned you may try following in your button_action method or any where in Page Bean class:
ServletContext theApplicationsServletContext = (ServletContext) this.getExternalContext().getContext();
String rootPath = theApplicationsServletContext.getRealPath("/");Then use "rootPath" where ever you want, it contains the path of the root directory.
It atleast works for me.....
Its strange that no one has answered this query for so long. Hope someone does early, I also want the clear answer.
Thanks!
Edited by: T.B.M on Oct 20, 2008 12:45 AM

Similar Messages

  • Obtain parent directory of WEB-INF from within a servlet

    hi to everyone!
    i have got a directory containing a WEB-INF directory (with web.xml and all the other stuff necessary). Hoy is it possible to obtain the parent directory of WEB-INF directory FROM WITHIN A SERVLET, put in lib directory?
    let's say:
    A----WEB-INF---classes
    ---lib----MyServlet.jar
    ---tlds
    ---dtds
    How can I get A from within MyServlet.jar? Please help. Thank's a lot...
    Wendigo

    getServletContext().getRealPath("WEB-INF")

  • Displaying a photo obtained from SAP R/3  in a Web Application Module

    Hi,
    I am currently developing a Web Application Module (through NWDS) which displays details of employees (name, last name, picture, etc...) obtained from a RFC function module called remotely through SAP JCA connector.
    I could obtain the picture passed through the RFC module, but now I need to displayed in a JSP page. I first start to look for a service which allows me to upload the picture to an application server cache as I have already done with
    IWDCachedWebResource
    in Web Dynpro development, but could not find anything alike. Then I tried to upload the picture to a relatively referenciable (Web Application) path, that I can use as a source for the IMG HTML tag, but I am just able to save the picture at the root directory of the application server (/usr/sap/SID/JC00/j2ee/cluster/server0) and this path can not (and must not) be referenced through my application JSP.
    Please any help or workaround will be gladly welcome
    Best regards,
    Jonathan

    Ravi,
    We have tried the same from SOAP UI client also and it is not working,
    same result as PI. But I repeat the Service is working from DOTNET applications.
    If it is not working in SOAP UI then it will not work in PI also. I suggest you to re-import the WSDL in you .net application and check.
    Regards,
    Ramesh

  • How do I get info from Active Directory and use it in my web-applications?

    I borrowed a nice piece of code for JNDI hits against Active Directory from this website: http://www.sbfsbo.com/mike/JndiTutorial/
    I have altered it and am trying to use it to retrieve info from our Active Directory Server.
    I altered it to point to my domain, and I want to retrieve a person's full name(CN), e-mail address and their work location.
    I've looked at lots of examples, I've tried lots of things, but I'm really missing something. I'm new to Java, new to JNDI, new to LDAP, new to AD and new to Tomcat. Any help would be so appreciated.
    Thanks,
    To show you the code, and the error message, I've changed the actual names I used for connection.
    What am I not coding right? I get an error message like this:
    javax.naming.NameNotFoundException[LDAP error code 32 - 0000208D: nameErr DSID:03101c9 problem 2001 (no Object), data 0,best match of DC=mycomp, DC=isd, remaining name dc=mycomp, dc=isd
    [code]
    import java.util.Hashtable;
    import java.util.Enumeration;
    import javax.naming.*;
    import javax.naming.directory.*;
    public class JNDISearch2 {
    // initial context implementation
    public static String INITCTX = "com.sun.jndi.ldap.LdapCtxFactory";
    public static String MY_HOST = "ldap://99.999.9.9:389/dc=mycomp,dc=isd";
    public static String MGR_DN = "CN=connectionID,OU=CO,dc=mycomp,dc=isd";
    public static String MGR_PW = "connectionPassword";
    public static String MY_SEARCHBASE = "dc=mycomp,dc=isd";
    public static String MY_FILTER =
    "(&(objectClass=user)(sAMAccountName=usersignonname))";
    // Specify which attributes we are looking for
    public static String MY_ATTRS[] =
    { "cn", "telephoneNumber", "postalAddress", "mail" };
    public static void main(String args[]) {
    try { //----------------------------------------------------------        
    // Binding
    // Hashtable for environmental information
    Hashtable env = new Hashtable();
    // Specify which class to use for our JNDI Provider
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    // Specify the host and port to use for directory service
    env.put(Context.PROVIDER_URL, MY_HOST);
    // Security Information
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, MGR_DN);
    env.put(Context.SECURITY_CREDENTIALS, MGR_PW);
    // Get a reference toa directory context
    DirContext ctx = new InitialDirContext(env);
    // Begin search
    // Specify the scope of the search
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    // Perform the actual search
    // We give it a searchbase, a filter and the constraints
    // containing the scope of the search
    NamingEnumeration results = ctx.search(MY_SEARCHBASE, MY_FILTER, constraints);
    // Now step through the search results
    while (results != null && results.hasMore()) {
    SearchResult sr = (SearchResult) results.next();
    String dn = sr.getName() + ", " + MY_SEARCHBASE;
    System.out.println("Distinguished Name is " + dn);
    // Code for displaying attribute list
    Attributes ar = ctx.getAttributes(dn, MY_ATTRS);
    if (ar == null)
    // Has no attributes
    System.out.println("Entry " + dn);
    System.out.println(" has none of the specified attributes\n");
    else // Has some attributes
    // Determine the attributes in this record.
    for (int i = 0; i < MY_ATTRS.length; i++) {
    Attribute attr = ar.get(MY_ATTRS);
    if (attr != null) {
    System.out.println(MY_ATTRS[i] + ":");
    // Gather all values for the specified attribute.
    for (Enumeration vals = attr.getAll(); vals.hasMoreElements();) {
    System.out.println("\t" + vals.nextElement());
    // System.out.println ("\n");
    // End search
    } // end try
    catch (Exception e) {
    e.printStackTrace();
    System.exit(1);
    My JNDIRealm in Tomcat which actually does the initial authentication looks like this:(again, for security purposes, I've changed the access names and passwords, etc.)
    <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
    connectionURL="ldap://99.999.9.9:389"
    connectionName="CN=connectionId,OU=CO,dc=mycomp,dc=isd"
    connectionPassword="connectionPassword"
    referrals="follow"
    userBase="dc=mycomp,dc=isd"
    userSearch="(&(sAMAccountName={0})(objectClass=user))"
    userSubtree="true"
    roleBase="dc=mycomp, dc=isd"
    roleSearch="(uniqueMember={0})"
    rolename="cn"
    />
    I'd be so grateful for any help.
    Any suggestions about using the data from Active directory in web-application.
    Thanks.
    R.Vaughn

    By this time you probably have already solved this, but I think the problem is that the Search Base is relative to the attachment point specified with the PROVIDER_URL. Since you already specified "DC=mycomp,DC=isd" in that location, you merely want to set the search base to "". The error message is trying to tell you that it could only find half of the "DC=mycomp, DC=isd, DC=mycomp, DC=isd" that you specified for the search base.
    Hope that helps someone.
    Ken Gartner
    Quadrasis, Inc (We Unify Security, www -dot- quadrasis -dot- com)

  • How to get the current application root directory

    Hi Experts,
    I am deploying an ADF Application to a Standalone WLS 10.3. During development I am using Integrated WLS (which comes with JDeveloper 11.1.1.5.0). During development, I configured my application to create log files in my local machine (where Integrated WLS is running) by using absolute path for my log file. Now, I am moving to a standalone instance of WLS for testing (before moving to production).
    Now I need to keep my log files under my application root directory. Please let me know how to get the absolute path of the deployed application root directory from WLS ENV/System property into my application's Java Code.
    I tried the below java code,
    Current weblogic server name is: " + System.getProperty("weblogic.Name") --> This gives me the name of the server where my application is running.
    Current weblogic server name is: " + System.getProperty("weblogic.Root") --> This returns NULL. How to get the Root directory of my application using some system property inside my application at runtime??
    Thanks
    Rathnam

    One method is to create a File(""); and do getPath() on it.
    At least it's worked for me.

  • How can I get the web application's context root?

    I have a web application, which is defined in Tomcat's server.xml:
    <Context path="/cbes" docBase="e:\work\GM\code\CBESCurrency" debug="0"
    reloadable="true" crossContext="false"/>
    And I hava a servlet in this web application.
    How can I get the context root of the web application?
    in this example: reture should be "cbes" or "/cbes"
    how?
    thanks alot.

    getContextPath() in javax.servlet.http.HttpServletRequest

  • Communication between two web applications deployed on same app server

    I need to update the war file of one application(say Application A) from another application(say application B). Actually application B is the admin application of application A.
    In order to achieve this, I need to get the ServletContext of A from B. How can I do that?
    P.S: Both the applications will be deployed on the same app server and they are app server independent.

    from the JavaDocs:
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
    getContext
    public ServletContext getContext(java.lang.String uripath)
    Returns a ServletContext object that corresponds to a specified URL on the server.
    This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
    In a security conscious environment, the servlet container may return null for a given URL.
    Parameters:
    uripath - a String specifying the context path of another web application in the container.
    Returns:
    the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
    See Also:
    RequestDispatcher

  • Get installation path of web application from class file

    Can anybody tell me how I can get the path on disk to the root of my web application from a class file. Im running under Tomcat 5.5 and I have 3 copies of the same webapp under 3 differenet directories:
    C:\xxx\dev\yyy
    C:\xxx\test\yyy
    C:\xxx\prod\yyy
    Based on which directory the web-app, I need to do a lookup on a properties file to pull the right jdbc connection to connect to the appropriate database. So it would be similar to using getServletContext().getRealPath("/") from a .jsp file.
    Thanks,
    Jason

    Sorry for not clarifying. I have a properties file with name/value pairs. I know where this properties file is and I can do a lookup in it. In this file, I have jdbc connection names which point to corresponding jdbc resources in my context.xml file.
    jdbcDevDatabase=jdbc/tfmDev
    jdbcTestDatabase=jdbc/tfmTest
    jdbcProdDatabase=jdbc/tfmProd
    These connections are for dev, test and prod databases. Now based on where the web-app is installed on disk, i.e-dev dir, test dir, prod dir, I want to retrieve the corresponding connection. The problem is I don't know how to get a handle to the web apps real path on disk without access to the request object or using getServletContext().getRealPath("/") which are not available to me in a class file.
    Thanks,
    Jason

  • Error 403 when trying to run a web application

    I am trying to run a web application(J2EE and velocity) that works perfectly fine on Tomcat but doesn't work on weblogic. I was initially getting a nullpointer error but I got rid of it when I removed xercesImpl.jar from my application's library folder and repackaged the war file. However, when I try to run the application now, I get the following error:-
    *Error 403--Forbidden
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.4 403 Forbidden
    The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.*
    The application has been deployed successfully but I am unable to run it using the link generated in the testing tab. The application. I was wondering if there is any workaround for this error.

    The testing link is using, the host:port/contextroot. Note that the URL is per default not accessible and give justly the 403 forbidden error.
    When you have an index.jsp (or something similar) in the root of your Web application it will automatically load that one, otherwise
    you will get the forbidden message.

  • Dreamweaver CC Won't Connect to the Right Root Directory

    Hi there.
    I'm running DW CC on a Macbook Pro running OSX 10.7.5. I made an edit to a link in a page file and put it to the remote server but the live page was still showing the old link (even after refreshing).
    After troubleshooting a number of possible causes I found that the hosting provider (Hostway) apparently recently moved the site files from the original "www" root directory to a new root directory called "web". So I'm putting files to "www" which is now a dead directory.
    I deleted the old server configuration (because just editing the root directory didn't change anything) in DW ftp client and created the new one with the new root "web". But when I connect to the remote server it's still showing the "www" directory and there's no way to get to "web".
    I no longer have any reference to "www" in my server settings but DW still insists on going there and won't let me connect to the correct "web" directory.
    I deleted my personal config file and that didn't make any difference.
    I uploaded the edited file to "web" successfully with Fetch and the live page is now updated.
    Any ideas? I can't seem to use DW's ftp client.
    Thanks!

    Sure thing.
    Here's the server setup in DW:
    And here's a shot of the local and remote files in the DW ftp client (note the "www" directory):
    And, for comparison's sake, here's what the remote files look like in Fetch (pointing to the "web" directory:
    Thanks for your help!

  • How to set a root directory for file management in web application

    Is it possible to set a default root directory for file management for a web application ?
    We would upload some files and store them in the web server.
    When we write the uploaded files without any path, the files are written in the config directory into the jdeveloper embedded oc4j directory.
    When we write the uploaded with a relative path ("/somedir/filename"), the files are written in C:/somedir/filename.
    We would like that all file management with relative path into the web application refer automatically to a given root directory (for example defined in web.xml).
    Is it possible ?

    I'm using the standard upload in adf faces.
    The problem is not during upload. This is managed in a temporay directory defined in web.xml. The problem is for writing the file that was uploaded (upload give us an inputStream we have to write somewhere, eventually after unzipping).
    Here is an example of our current code.
    if (mimeType.equals("application/x-zip-compressed") |
    mimeType.equals("application/zip")) {
    File destZipFile =
    new File(rootDirectory + "/" + parametersDirectory +
    "/" + uploadedFile.getFilename());
    BufferedInputStream isZipFile =
    new BufferedInputStream(uploadedFile.getInputStream());
    FileOutputStream fosZipFile =
    new FileOutputStream(destZipFile);
    BufferedOutputStream bosZipFile =
    new BufferedOutputStream(fosZipFile, BUFFER);
    // read and write until last byte is encountered
    while ((currentByte = isZipFile.read(data, 0, BUFFER)) !=
    -1) {
    bosZipFile.write(data, 0, currentByte);
    }

  • Directory Structure ?s for an Exploded Web Application

    We have an application that consists only of JSPs and Servlets, no
    EJBs. I am researching whether or not it's worthwhile to start using
    EJBs. We're also migrating from Weblogic 5 to 6.1. I've managed to
    migrate our application fine and have it up and running on WLS 6.1.
    I'm confused about the exploded directory structure, the
    application.xml file, where to put the EJBs and whether or not I have
    to jar them. Here's our current directory structure:
    DefaultWebApp/               JSPs here
    DefaultWebApp/WEB-INF          web.xml and weblogic.xml here
    DefaultWebApp/WEB-INF/classes     Servlets and other classes here
    DefaultWebApp/WEB-INF/lib     do my un-jar-ed EJBs go here?
    I've been reading a lot of BEA's documentation, particularly
    ‘Deploying an Exploded J2EE Application' and a ‘Web Application PDF',
    and looking for relevant threads on the weblogic.developer.interest
    groups. It looks like the application.xml should go in a new
    DefaultWebApp/META-INF directory. But where do the EJBs go?
    I also see some directory structures with another /web directory
    that's confusing me.
    Oh, I've also managed to compile and jar up a trial Stateless Session
    EJB. Then I think I ‘auto-deployed' it into the /applications
    directory, and Weblogic seems to recognize it. But when I tried to
    reference it in a JSP, I got an error message ‘class x is public,
    should be declared in a file named x.java'. I'm assuming this is
    related to the application.xml, where I need to define the ejb
    directory.
    Thanks.

    To deploy your web app together with your EJBs, you need to create
    an "EAR" structure. Both your webapp and your EJB jars will be within
    this new structure, at the same level. You may jar up your EJBs, or you
    may explode their structure, it's up to you.
    The resulting structure should look something like below:
    EnterpriseApp/ <-- new top level
    EnterpriseApp/META-INF/
    EnterpriseApp/META-INF/application.xml
    EnterpriseApp/lib/ <-- shared libraries (if any)
    EnterpriseApp/EJB/ <-- ejbs go here
    EnterpriseApp/EJB/META-INF/ejb-jar.xml
    EnterpriseApp/EJB/META-INF/weblogic-ejb-jar.xml
    EnterpriseApp/EJB/com/your/ejb/classes/here
    EnterpriseApp/WebApp/ <-- move your current app here
    EnterpriseApp/WebApp/index.jsp <-- JSPs goes here
    EnterpriseApp/WebApp/other.jsp
    EnterpriseApp/WebApp/WEB-INF/web.xml
    EnterpriseApp/WebApp/WEB-INF/weblogic.xml
    EnterpriseApp/WebApp/WEB-INF/lib <-- ui libraries go here
    EnterpriseApp/WebApp/WEB-INF/classes <-- servlets go here
    The above structure is identical to the structure to an EAR file, only "exploded"
    as actual files and directories instead of being "jarred" into a single EAR file.
    Your application.xml in this case would specify something like:
    <application>
    <display-name>EnterpriseApp</display-name>
    <description>My Enterprise Application</display-name>
    <module>
    <ejb>EJB</ejb>
    </module>
    <module>
    <web>
    <web-uri>WebApp</web-uri>
    <context-root>/yourAppRoot</context-root>
    </web>
    </module>
    </application>
    And in config.xml you would have an entry similar to:
    <Application Deployed="true" Name="EnterpriseApp"
    Path=".\config\mydomain\applications\EnterpriseApp">
    <WebAppComponent Name="ui" Targets="myserver" URI="WebApp"/>
    <EJBComponent Name="ejb" Targets="myserver" URI="EJB"/>
    </Application>
    regards,
    -Ade

  • How do I set up a root directory for a web site

    So this is probably a naive newbie question.
    I have been creating websites driven by php/mysql on my mac for years using the previous the web preference pane to run Apache and since that went away using XAMPP to provide Apache/php/mysql functionality on localhost.
    I decided to download OSX server and try to use that.  Figured might as well go native MAC.
    I am baffled.
    The manual says to set up a web site in Server by working through the Websites Services interface. I did that and pointed the setup at the directory where I have all of my web site files.  I now have no idea how to access that page from my local machine.
    I have tried:
    http://localhost/myURL
    http://localhost/~username/Sites/[root file directory]  -- where the files are stored
    I also tried some typical localhost ip address
    None access my site.
    How do I access my site over my local netework?
    I feel like just dumping server.app and stting things up through the terminal.
    Thanks,
    --Kenoli

    How familiar are you with the bash command line and with Apache, and how much do you want to learn about Apache and related topics?  (If you're not already, then I'd encourage learning about this material, as this knowledge is very useful for maintaining and updating sites, and knowledge of correctly securing files and directories is critical to building and maintaining secure web sites — all of managing and running and updating a web server builds on these foundations.  There are various good books and web sites on Apache, and the Apache web site has various materials available, if you don't already have something.)
    The localhost host name and the 127.0.0.1 IPv4 address are both synonyms for the "me" host.  It's the name and the address that always gets you to the current host.
    With http://localhost/ or http://127.0.0.1 specification, what you enter at the URL address bar is relative to the root directory specified for the default web server, and will default to the index.html or index.php page or whatever the default web site is configured to use.  With OS X Server, this root directory is configured via Server.app.  To use Server.app, launch it, connect to the server, select Websites from the left navigation, and you (by default) will see a default site and a secure site.  Select the default site.  Select the edit button below the site to edit (and to view) the configuration. 
    With the details of the default site visible, you will see the path to the default web directory.  This path to the default web directory is where the files for the default web sever location reside. 
    The default path to the default web site is /Library/Server/Web/Data/Sites/Default
    If you place foo.html in that directory (or whatever the defailt web site is using), you can view it via your web browser and the URLs:
    http://127.0.0.1/foo.html
    http://localhost/foo.html
    To get to the default web site using the GUI, launch Finder and select Go To Folder, and enter that string into the box.  You will now get a GUI view of that folder.  (I'd strongly recommend using the command line here, and not the GUI.  To get to the directory from the command line and then list the files present, launch Terminal.app from Applications > Utilities folder and issue the following commands:
    cd /Library/Server/Web/Data/Sites/Default
    ls
    If you want to test something in the browser, you can use the file:///path-to-file-to-test mechanism.  Most web browsers will allow you to render local files directly using file and three slashes.
    You will need to ensure the executable files (scripts) are marked as executable to OS X, using a Terminal.app command such as the following:
    chmod o+x path-to-file
    Enabling ~/user per-user sites involves directly editing the configuration file, as Apple has disabled that by default. 
    There's an Apache tutorial with an overview of what's involved with enabling per-user directories here, and there's what's been listed in my earlier replies and links.  With OS X Server Mavericks, the default configuration file for Apache is located in the Library folder, and can be viewed with the following Terminal.app command:
    cat /library/server/web/config/apache2/httpd_server_app.conf
    This file is the OS X Server equivalent of the oft-cited httpd.conf file you'll see listed in various documentation.
    If you want to enable the per-user directories or tweak other Apache settings, then shut down Apache from Server.app or from the command line, and then edit the configuration file with nano or some other command-line editor using a command similar to this:
    sudo nano /library/server/web/config/apache2/httpd_server_app.conf
    you'll end up finding and uncommenting (removing the #) from the following two lines:
    #LoadModule apple_userdir_module ${SERVER_INSTALL_PATH_PREFIX}/usr/libexec/apache2/mod_userdir_apple.so
    #Include /private/etc/apache2/extra/httpd-userdir.conf
    If you have specific questions about this, then I and others here can answer those.  If you don't understand something, then asking a question about that can help you learn, and can help me understand what it is that I'm posting in my replies here that's confusing you.  There are also various resources available for learning Apache, and I'd encourage spending a little time with those if you've not already done so or feeling at all unsure about how that tool works; I end up re-re-reviewing the Apache docs fairly regularly.

  • Document root of web application

    Hi. I'm having trouble determining where a web application is pulling a particular resource from.
    I always though that the ServletContext.getResource() resolved it's path relative to the root of the WAR file or the equivalent root of the exploded deployment. However, I have a web application that appears to be running out of a war file, but also retrieving resources from the surrounding filesystem with getResource() Is this possible?
    In particular, is it possible to have multiple roots? How would these multiple roots be configured, i.e. where would you specify them?
    I've reread the servlet specification and it talks about the getResource() being capable of pulling resources off of remote filesystems, etc. So, i get the sense I'm missing some details.

    This might help.
    If you put this in the java code, it will print to the console the path that java code is running from. From there, you should be able to go up or down the directory structure as necessary. Note it will print out a different path for your project running in your development enviornment than when its deployed on a server.
    File file=new File("");
    System.out.println(file.getAbsolutePath());

  • Where should one register a web application directory

    Hi:
    I have created a server domain and server instance for weblogic 8.1. Could someone
    please tell me where I should register the web application directory so that my
    jsp files could be served from this directory or a sub-directory of this web application
    directory?
    Thanks in advance.
    Rino

    Yes, it did work!
    Thanks a lot.
    Rino
    "Deepak Vohra" <[email protected]> wrote:
    >
    Rino,
    Is directory structure of the WebApplication the following?
    user_projects/mydomain/applications/myWebApp/jsp/HelloWorld.jsp
    myWebApp/WEB-INF/web.xml
    myWebApp/WEB-INF/weblogic.xml
    thanks,
    Deepak
    "Rino" <[email protected]> wrote:
    I did put the web application directory "myWebApp" under the "applications"
    folder
    but it still gives me error 404-Not Found.
    The content my my weblogic.xml file is as follows:
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA
    Systems, Inc.//DTD Web Application 8.1//EN"
    "http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
    <weblogic-web-app>
    <context-root>myWebApp</context-root>
    </weblogic-web-app>
    Can someone explain me how the applications folder serves the jsp pages?
    And
    also what I may be doing wrong
    Thanks.
    Rino
    "Deepak Vohra" <[email protected]> wrote:
    I created a web application directory "myWebApp" under my weblogichome directory.
    The web application directory "myWebApp" should be under the 'applications'
    directory.
    thanks,
    Deepak
    "Rino" <[email protected]> wrote:
    Thanks for your response. However, I still could not get it to work.
    My weblogic home is "C:\bea\weblogic81"
    I created a web application directory "myWebApp" under my weblogic
    home
    directory.
    I also created a WEB-INF folder under "myWebApp" directory.
    After this I created "weblogic.xml" file under the WEB-INF folder.
    The content of my weblogic.xml file is as follows:
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA
    Systems, Inc.//DTD Web Application 7.0//EN"
    "http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
    <weblogic-web-app>
    <context-root>myWebApp</context-root>
    </weblogic-web-app>
    Under my web application folder i.e. "myWebApp" I have a sub-directory
    named jsp.
    In this sub-directory I placed my helloworld.jsp file.
    Now when I try to run my jsp file from the browser as follows.
    http://localhost:port/jsp/helloworld.jsp
    I get an error message "Error 404-Not Found
    Could someone let me know what I am doing wrong here?
    Thanks in advance.
    Rino
    "Deepak Vohra" <[email protected]> wrote:
    The applications directory has a default Web Applications directory,
    DefaultWebApp.
    To specify a Web Applications dir other than the DefaultWebApp dir,specify
    the
    web app dir in
    the context-root element of weblogic.xml deployment descriptor.
    thanks,
    Deepak
    "Rino" <[email protected]> wrote:
    Hi:
    I have created a server domain and server instance for weblogic
    8.1.
    Could someone
    please tell me where I should register the web application directory
    so that my
    jsp files could be served from this directory or a sub-directoryof
    this
    web application
    directory?
    Thanks in advance.
    Rino

Maybe you are looking for