Web application working directory?

Hi there!
I've been looking for an answer for some time now but was unsuccesfull.
I have a web application deployed under tomcat, named "store"
This application is stored in
apache_dir/webapps/store
and directories are
apache_dir/webapps/store/xml/test.xml
apache_dir/webapps/store/WEB-INF/classes/TestServlet.class
The servlet TestServlet must read the test.xml file.
I don't want the path "apache_dir/webapps/store/xml/test.xml" hard coded because of evident portability issues.
So how can I retrieve this file from my servlet?
I tried getResource, but it didn't succeded...
Any help will be greatly appreciated!
Thanks,
Omera

try using ServletContext.getRealPath()
regards,
sai

Similar Messages

  • Web Application working correctly only with Everyone user added to user privilages

    Hello,
    I have an web application in Sharepoint 2013 which only works correctly with the Everyone (Read Only) user added to User Privileges in Central Admin. 
    If I remove Everyone user from user privileges, user domains, that are added to access groups in Site Permissions, are directed to Request Access page of the site. I cannot understand how is this happening, specially because I have other Web App on the same
    server which are working correctly.
    Could you please advice me how could I trace the problem and resolve it.
    Thank you!

    Hi Bogdan,
    According to your description, my understanding is that Everyone user cannot access the web application except adding the account to user policy of the web application in Central Administration.
    I recommend to check if the Super Reader account has been given the Full Read permission on the web application in Central Administration.
    If not, add the account to the User Policy of the web application and grant Full Read permission to the account.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • We had migrated our servers from a domain to cloud. all the web applications working fine locally, but from outside they are accessible but on editing giving 404 with some request id.

    hi all,
    recently we migrated our moss 2007 from a domain to cloud env. everything goes well and all the application working fine locally.
    but when users are trying from outside first they get promt for basic auth, that is enabled, its fine. then servers serve first page smoothly. all the application browsing is fine. but when authorized users are trying to edit a web page and they click on
    anything(save, submit for publication, publish) they get 404 with a request ID. another thing if they add a new page to app and then make any changes to that page then they are not getting any issue.
    please help if any one resolved that kind of issue.
    thanks in advance.
    SJ

    Hi Sumanpreet,
    Thanks for posting your issue, Kindly check out below mentioned URLs to get the fix for this issue
    http://www.sharepointdiary.com/2011/02/404-page-not-found-error-sharepoint-2010-migration.html#ixzz2jHyVIFcX
    http://vasya10.wordpress.com/category/sharepoint-2010/sharepoint-2007-to-2010-migration/
    https://social.technet.microsoft.com/Forums/en-US/d80e7495-e889-4209-9a0a-82a852c944b1/after-migration-from-moss-2007-to-sharepoint-2010-i-tried-to-check-the-site-with-site-url-getting?forum=sharepointadmin
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • How can i create work directory for Tomcat4 which is installed on Mandrake

    Hello Everybody,
    I installed Tomcat4 with the help of JPackage on Madrake Linux. It is working fine. But Unfortunatly my work folder in tomcat4 is deleted. I restarted my Tomcat, But the work folder not created. my application is not working. I need help from u people. Is there any other options to create work folder. I installed the tomcat4 from jpackage.
    Thanks in advance, Naveen Kumar Madugula

    4) Advanced Configuration - Multiple Tomcat 4 Instances
    In many circumstances, it is desirable to have a single copy of a Tomcat 4
    binary distribution shared among multiple users on the same server. To make
    this possible, you must configure a CATALINA_BASE environment variable (in
    addition to CATALINA_HOME as described above) that points to a directory
    that is unique to your instance.
    When you do this, Tomcat 4 will calculate all relative references for files in
    the following directories based on the value for CATALINA_BASE instead of
    CATALINA_HOME:
    * conf - Server configuration files (including server.xml)
    * logs - Log and output files
    * shared - For classes and resources that must be shared across all web
    applications
    * webapps - Automatically loaded web applications
    * work - Temporary working directories for web applications
    * temp - Directory used by the JVM for temporary files (java.io.tmpdir)
    If you do not set CATALINA_BASE to an explicit value, it will be initialized
    to the same value as is set for CATALINA_HOME (which means that the same
    directory is used for all relative path resolutions).
    more -> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/RUNNING.txt

  • Web app works in sunone but after moving to tomcat it won't

    My web application works just fine in sunone studio, but once I move it to tomcat by creating a war file, it wont.
    the part of app that doesn't work is the file and directory copy part. everthing else is fine:server access, database connectivity, and login.
    if the files and directory are there, it is working, but if they are not there it won't create the directory and copy the file, what it is supposed to do.
    one thing I noticed was the browsers status bar:
    running it from sunone, it comes up like this:
    ..//localhost:8080/...
    running it from tomcat, it comes up like this:
    ..//127.0.0.1:8080/
    I don't know if that is a clue to a problem.
    I am working under window2000 server.
    any hint or suggestion would be great.
    Thanks,
    James

    Well the localhost vs. the IP address cannot be the cause for the problem. From what you are saying is that the application actually works and the WAR does get deployed and the application does some file system operations and those do not work.
    That can be for several reasons, make sure that the security manager in the external Tomcat allows this and also that there is read/write access to place you are trying to do the filesystem operations to. Are those directories inside your context path?
    Also, some exception stacks would be helpful.
    Regs Jirka

  • Can I use the search engine and run a web application under the same iPlanet 6.0 virtual server?

    I've got an iPlanet 6.0 SP2 virtual server with the search engine enabled, which was tested and working. I then deployed a web application to it (mapped to "/"), and the web application works fine but now the search functionality is completely broken. Browsing to /search results in a directory index being displayed. Is there some trick to getting the two working together? I tried shuffling NameTrans directives around, but can only get either the search or the web app working, not both.

    Ok, I'm going to answer my own question now...
    The issue has been resolved after some additional experimentation on my part. There were two causes for my problem:
    1. The NameTrans directives in obj.conf are in the wrong order when Java and Search are enabled from the administration interface.
    Here's the admin server generated obj.conf I started with initially, when the web application was working, but requests to the URI "/search" returning a 404 error:
    <Object name="default">
    NameTrans fn="NSServletNameTrans" name="servlet"
    NameTrans fn="pfx2dir" from="/search-ui" dir="/usr/local/iWS-6.0/plugins/search/ui" name="es-internal"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/usr/local/iWS-6.0/ns-icons" name="es-internal"
    NameTrans fn="pfx2dir" from="/manual" dir="/usr/local/iWS-6.0/manual/https" name="es-internal"
    NameTrans fn="es-search-nametrans" from="/search"
    NameTrans fn="NSServletNameTrans" name="servlet"
    NameTrans fn="document-root" root="$docroot"
    </Object>
    Here's my obj.conf now, which works perfectly:
    <Object name="default">
    NameTrans fn="pfx2dir" from="/search-ui" dir="/usr/local/iWS-6.0/plugins/search/ui" name="es-internal"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/usr/local/iWS-6.0/ns-icons" name="es-internal"
    NameTrans fn="pfx2dir" from="/manual" dir="/usr/local/iWS-6.0/manual/https" name="es-internal"
    NameTrans fn="es-search-nametrans" from="/search"
    NameTrans fn="NSServletNameTrans" name="servlet"
    NameTrans fn="document-root" root="$docroot"
    </Object>
    The "servlet" NameTrans directive needs to go below all others which map a URI to a function or directory (but before "document-root"), or they break. This is consistent with the iPlanet documentation on NameTrans, but the admin server doesn't get it right!
    2. The developer who wrote the web application uploaded a directory named "search" in the root of his application, which caused the server to display a directory index of "/search", instead of executing the search function. I believe this issue is covered in an iPlanet knowledge base article.

  • From a Technical Architect point of view, how to design a web application?

    Hi to all,
    I am writing this issue here because I this question is not related on how to program, but on how to design a web application. That is, this question is not related to how to program with the technologies in J2EE, but how to use them correctly to achieve a desired outcome.
    Basically I know how to develop a simple web application. I like to use SpringFramework with AcegiSecurity and Hibernate Framework to persist my data. I usually use JBoss to deploy my web applications, however I could easily use Tomcat or Jetty (Since I am not using EJB�s).
    However I have no idea on how to develop (or a better word would be �design�) a website which is divided into different modules.
    Usually when you develop a website, you have certain areas that are public, and other areas that are not. For example, a company would want anyone on the Internet to download information about the products they are selling, however they would only want their employees to download certain restricted information.
    Personally I try to categorise this scenario in to common words; Extranet and Intranet.
    But � (and here starts the confusion in my mind) should I treat these two as two projects, or as one project? The content to be displayed on the Extranet is much different then the content to be displayed on the Intranet and definitely clients should not be allowed to the Intranet.
    First approach would be to treat them as the same project. This would be perfect, since if the company (one day) decides to change the layout of the website, then the design would change for both the Intranet and the Extranet version. Also the system has a common login screen, that is I would only need to have employees to have a certain Role so that they have access to the intranet, while clients would not have a certain Role and thus they would not be allowed in. But what about performance and scalability? What if the Intranet and Extranet have to be deployed on the different Hardware!?
    The second approach is to threat them as two separate projects. To keep the same layout you just copy & paste the layout from one project to another. However we would not want to have two different databases to store our users, one for the employees and the other one for the clients. Therefore we would build a CAS server for authentication purposes. Both the Intranet and the Extranet would use the same CAS server to login however they could be deployed on different hardware. However what if we want to change the design. Do we really want to have to just copy and paste elements from one project to another? We all know how these things finish! �We do not have time for that � just change the Extranet and leave the Intranet as it is!�
    The third approach (and this is the one I like most) is to have a single project built into different WAR files. The common elements would be placed in all WAR files. However in development you would only need to change once and the effects would show in the different war files. The problem with this approach is that the project will be very big. Also, you will still need to define configuration files for each one of them (2 Web.config, 2 Spring-Servlet.config, 2 acegi-security.config, etc).
    Basically I would like something in the middle of approach 2 and approach 3! However I can identify what this approach is. Also I can not understand if there is even a better approach then these three! I always keep in mind that there can always be more then two modules (that is not only Intranet and Extranet).
    Anyways, it is already too long this post. Any comments are more then welcome and appreciated.
    Thanks & Regards,
    Sim085

    Hi to all,
    First of all thanks for the interest shown and for the replies. I do know what MVC or Multi-layered design is and I develop all my websites in that way.
    Basically I have read a lot of books about Domain-Driven Design. I divide my web applications into 4 layers. The first layer is the presentation layer. Then I have the Facade layer and after that I have a Service layer (Sometimes I join these two together if the web application is small enough). Finally I have the Data Access layer where lately I use Hibernate to persist my object in the database.
    I do not have problems to understand how layering a web application works and why it is required. My problem is how to design and develop web applications with different concerns that use same resources. Let me give an example:
    Imagine a Supermarket. The owner of the Supermarket want to sell products from the website, however he wants to also be able to insert new products from the website itself. This means that we have two different websites that make use of the same resources.
    The first website is for the Supermarket clients. The clients can create an account. Then they can view products and order them. From the above description we can see that in our domain model we will have definitely an object Account and an object Product (I am not mentioning all of them). In the Data Access layer we will have repository objects that will be used to persist the Account and Products.
    The second website is for the Supermarket employees. The employees still need to have an account. Also there is still a product object. This means that Account and Product objects are common to the two websites.
    Also important to mention is the style (CSS). The Supermarket owner would like to have the same style for both websites.
    Now I would not like to just copy & paste the objects and elements that are common to both websites into the two different projects since this would mean that I have to always repeat the changes I make in one website, inside the other one.
    Having a single WAR file with both websites is not an option either because I would not like to have to deploy both websites on the same server because of performance and scalability issues.
    Basically so far I have tought of putting the common elements in a Jar File which would be found on the two different servers. However I am not sure if this is the best approach.
    As you can see my problem is not about layering. I know what layering is and agree with both of you on its importance.
    My question is: What is the best approach to have the same resources available for different websites? This includes Class Files, CSS Files, JavaScript Files, etc.
    Thanks & Regards,
    Sim085

  • 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)

  • Correct Directory Structure for Serving a Web Application from Arch?

    At the moment I have an Apache web server hosting PHP based web pages out of /srv/http. This works for what I am doing at the moment, but i was wondering if there was a more professional\correct way to host a web application on Arch.
    When would someone host a page in /srv/http vs /var/www ? ( is /www even widely used on archlinux) ?
    Or is their a better way all together ( I read something about symbolic linking the 2 directories)?
    Can anyone provide a sample of how they decided to set up their basic web directories ?
    Any help is very much appreciated !

    It mainly depends on the webserver you're using.  There's nothing about the difference between /srv/http versus /var/www.  As far as the web user is concerned they don't even know what directory structure you're using.

  • 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

  • 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

  • Nested web applications directory.

    I recently design the jsp development structure in my company.
    It is basically contain two webapps which is productionLine webapp and developmentLine webapp.
    In my developmentLine webapp contain several programmers. Each of them has their own user directory in developmentLine webapp but i face a trouble which is each subdirectory cannot run their servlet in WEB-INF.
    In http://localhost/developmentLine/servlet/servletname is running fine but once i move the webapp into user directory then it cause the problem like http://localhost/development/John/servlet/servletname. It is not working. Any idea about it?
    design jsp development structure based.
    root
    -> productionLine
    \t -> HR
    \t -> Admin
    -> developmentLine
    -> John
    -> HR
    -> webster
    -> Admin
    Is the tomcat support nested webapplication? else i think i need put entire servlet in the common library to shared among each web applications.
    Edited by: webster on Nov 15, 2008 12:30 PM

    Because my company didn't install the any Java Tools before. I need to install entire java development Tools and assigned each particular directories in Tomcat web server for each developer. what's mean of "hacked"?
    I intent to put assigned each developer a userId directory in developmentLine directory. what i trying to do is allow each userId subdirectory in web application directory (i.e. ROOT, webdav, balancer and etc) to have their own servlet classes in WEB-INF directory.
    cause my company required put all the source code into a single server. Their think it is much more easier to maintain.
    so I am trying to install two tomcat in a server. I had change my http port, shutdown port and AJP port to 80, 89 and 85. When i try install a new Tomcat with same version into server, it pop up an error msg.
    Failed to install Tomcat5 service.
    Check your settings and permissions
    Ignore and continue anyway (not recommended)
    I choose ignore it, and continue install. Afterward my web application in port 80 change to 8080. I think it is replace the old tomcat server instead of running both tomcat together.
    Any idea?
    p/s: previous tomcat installation path is C:\Program Files\Apache Software Foundation\Tomcat 5.5 and another tomcat server installation path is C:\Program Files\Apache Software Foundation\Tomcat 5.52.
    Edited by: webster on Nov 17, 2008 10:39 AM

  • Sharepoint web application is not working on client system

    my sharepoint we application is working on premises but it is not working on local system 

    I assume you mean its working on the server, but not on your client.  If so, make sure that you have registered the URL for the web application in your Domain Name Server (DNS).  If you can't resolve the name you won't be able to reach the web
    application.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Creating a folder in web application directory?

    Hi
    I have a web application which contains some jsps and servlets and i am running it on Apache Tomcat 4.1. The name of my application is MyApp which contains all the servlets and jsps.
    In order to deploy the application i have placed the MyApp folder in the 'webapps' folder of Tomcat. Now in one of my servlets i.e. 'DirectoryCreator', i am trying to create a folder i.e. 'Directory' in the MyApp folder. The problem is that i dont want to give an absolute path to the File class constructor. The class files of my servlets are in classes folder i.e. MyApp \ Web-INF \ classes.
    I have tried:
    File f = new File("/Directory");
    f.mkdir();
    but this creates the Directory folder in my C drive.
    Please tell me how i can avoid giving the absolute path.
    Thanks.

    if the code to create the directory is a servlet, you can use
    String path=getServletContext().getRealPath("/");
    //getRealPath("/") will return the actual path on your machine of the base directory
    //of the webapp. getRealPath("/SomeDirectory/SomeFile") will return the real
    //path of SomeFile
    File f=new File(path + "/Directory");
    if(!f.exists())
        f.mkdir();if the code is in a .jsp file simple replace getServletContext(). with application.

  • 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

Maybe you are looking for

  • Best way to backup macbook

    Hello i was looking for some advice on backing up my macbook, i did think that i could plug an external drive and run time machine but as the external drive is also used for my windows machine, it says incorrect file system for time machine. I then d

  • Master-Detail Query

    Hi, I have parent and child tables and I need to get data in the following fashion. I'm using emp and dept tables for this example. DEPTNO DNAME LOCATION EMPNO ENAME SAL JOB COMM 10 HQ NY 1111 TOM 3000 CLERK 5 1112 TIM 5000 MGR 0 20 ACT BOS 1113 LEE

  • How to default payment type to invoice in istore billing page

    We are using B2B user scenario in iStore and we have a requirement to default payment type to invoice in billing page of iStore and user can change it to credit card if required.

  • RSAR_PSA_CLEANUP_DIRECTORY -  Error log

    Hi friends, I have run report "RSAR_PSA_CLEANUP_DIRECTORY" and it gives errors in the log as follows: Fatal error occured, DO NOT USE correct option For errors 'wrongly present in partition' refer to NOTE 849857 / 992248 Request : ODSR_491SD29HA8QDFT

  • IBooks closes after I open a book

    I am using the new OS (7.0.3) and experiencing a problem new since the new OS was installed.  I open iBooks and see the shelves with books I've purchased, but when I tap a book, the screen returns to the home page.  I have turned the iPad off and on