Set Context Path

I wish to separate customer specific jsp codes in different directory. All jsps are stored in a directory "/jsp".
Within this there is another directory "cust_jsp" , where I moved the customer specific code. This customer code links to other jsps in the parent directory (/jsp).
When I visit the customer specific code and then try to go to other link, it tries to look for them in the current directory. What I want, is that it should look for any hyperlinks from the web-apps root directory.
I guess, I can use request.getContextPath() and then append this in front of the hyperlinks. But doing this would require a lot of change in the application.
Is there any other way, where i can set the context path to the root so it looks for the files from the web-apps root directory.
Thanks for your help.
RM

if you are using eclipse or WSAD you could set the context path in Project>properties>web

Similar Messages

  • I want to set context path to 1 character like "/a"

              I use WLS6.1.
              I'd like to access
              http://localhost:7001/a/servletname
              to web application "a" or "a.war".
              but it doesn't seems work.
              (Returned "Http Error 404")
              Can't I set context path to 1 character,
              like "/a","/b",..."/z",etc?
              thanks for your answer.
              Kurose
              

    In this case you probably should submit this to [email protected] - it
              definitely looks like a bug. BTW, did you try 6.1sp1? This bug looks
              so obvious, so it's possible it was fixed in sp1.
              Kurose <[email protected]> wrote:
              > Thanks your reply.
              >>Maybe the problem you have is similar - does it work if you deploy
              >>aaa.war instead of a.war (and try http://localhost:7001/aaa/servletname)
              >>?
              > It works when WAR-File name is aa.war(Only 2 characters).
              > <http://localhost:7001/aa/servletname>
              > And on WLS6.02,a.war works.
              > <http://localhost:7001/a/servletname>
              > On on WLS6.1 it doesn't work.
              >>Did you application deploy successfully?
              > No exception when application was deployed.
              > But done "undeploy => deploy" on AdminConsole,
              > exception is occurring.
              > Dimitri Rakitine <[email protected]> wrote:
              >>Did you application deploy successfully? There is(was?) a bug
              >>in 6.1 using File.createTempFile which was preventing war's with
              >>archives in WEB-INF/lib with names less than 3 characters from
              >>working.
              >>
              >>Maybe the problem you have is similar - does it work if you deploy
              >>aaa.war instead of a.war (and try http://localhost:7001/aaa/servletname)
              >>?
              >>
              >>Kurose <[email protected]> wrote:
              >>
              >>> I use WLS6.1.
              >>
              >>> I'd like to access
              >>> http://localhost:7001/a/servletname
              >>> to web application "a" or "a.war".
              >>> but it doesn't seems work.
              >>> (Returned "Http Error 404")
              >>
              >>> Can't I set context path to 1 character,
              >>> like "/a","/b",..."/z",etc?
              >>
              >>> thanks for your answer.
              >>
              >>> Kurose
              >>
              >>
              >>--
              >>Dimitri
              Dimitri
              

  • I want to set context path to ""

    Can I set context path to "" like as Tomcat ?
              tomcat server.xml
              <Context path="" docBase="webapps/ROOT" debug="0" reloadable="true"
              >
              </Context>
              I set weblogic.properties as below
              weblogic.httpd.webApp.=C:/somewebapp
              It seems to work well.
              But actually WLS see weblogic/myserver/public_html.
              Please give me any advise.
              Thanx.
              ikedatka
              

    I think what you are looking for is called the "default web application",
              which answers to the "/" path. Luckily someone else already answered this
              question, so I can look intelligent:
              > The answer is to set up a weblogic property:
              >
              > weblogic.httpd.defaultWebApp=<web-app-name>
              >
              > If you do this you don't need to type:
              >
              > http://localhost:7001/<web-app-name>/<the-rest-of-the-URL>
              >
              > you can just say
              >
              > http://localhost:7001/<the-rest-of-the-URL>
              >
              >
              > --kumar allamraju
              Peace.
              Cameron Purdy
              "ikedatka" <[email protected]> wrote in message
              news:[email protected]..
              > Can I set context path to "" like as Tomcat ?
              >
              > tomcat server.xml
              > <Context path="" docBase="webapps/ROOT" debug="0"
              reloadable="true"
              > >
              > </Context>
              >
              > I set weblogic.properties as below
              >
              > weblogic.httpd.webApp.=C:/somewebapp
              >
              > It seems to work well.
              > But actually WLS see weblogic/myserver/public_html.
              >
              > Please give me any advise.
              > Thanx.
              >
              > ikedatka
              >
              

  • PermissionDeniedException while setting conext path in merchandiser dyn admin

    Hi All,
    I created a project in BCC using admin user and when I tried setting context to that project in merchandiser dyn admin, i got permission denied exception.
    javax.ejb.EJBException: QUERY_EXCEPTION_MESSAGE: RQL query: status = ?0 RANGE ?1+?2, Args: ?0=Active ?1=0 ?2=5000 ; nested exception is: CONTAINER:atg.repository.RepositorySecurityException; SOURCE:atg.security.PermissionDeniedException: You do not have read access to the project item descriptor.
    at atg.repository.tojava.runtime.RJSupport.executeRqlStatement(RJSupport.java:1045)
    at atg.epub.project._ProjectHome_ReposImpl.findProjectsByStatus(_ProjectHome_ReposImpl.java:131)
    at atg.service.dynamo.admincontext.ProjectAdminContextProvider$1.doInTransaction(ProjectAdminContextProvider.java:222)
    at atg.service.dynamo.admincontext.ProjectAdminContextProvider$1.doInTransaction(ProjectAdminContextProvider.java:217)
    at atg.dtm.TransactionUtil$TypedTransactionAction.doWithTransaction(TransactionUtil.java:95)
    at atg.service.dynamo.admincontext.ProjectAdminContextProvider.getAvailableOptions(ProjectAdminContextProvider.java:217)
    at atg.service.dynamo.admincontext.AdminContextFormHandler$ProviderAndCurrentContext.(AdminContextFormHandler.java:366)
    at atg.service.dynamo.admincontext.AdminContextFormHandler.getProviderAndCurrentContexts(AdminContextFormHandler.java:327)
    How Can I add permission to the user to set context path in merchandiser dyn admin.

    Sorry forgot to update the post, I have tried following and failed:
    admin user being super-admin, I have added read,write,creare,delete privileges to it.
              I have tried adding guper-admin to both process and project item-descriptors in atg/epub/publishingSecurity.xml acl.
              <acl-property name="acl" />
                 <descriptor-acl value="Profile$role$ePubSuperAdmin:read,write,create,delete;   Newly added profile privileges
                                                           Profile$role$epubAdmin:read,write,create,delete;                       
                                                           Profile$role$epubManager:read,write,create,delete;
                                                           Profile$role$epubUser:read,write,create,delete;
                                                           Admin$role$administrators-group:read,write,create,delete" />
    On that page I was able to set context, but for other pages(components) Same exception came.
    Is there any problem with newly added acl-value: Profile$role$ePubSuperAdmin:read,write,create,delete?
    Also let me know if other changes are required.
    Thanks,
    Nitin.

  • How to set the servlet context path manually in Tomcat web server.

    I tested some servlets by putting them in the folder , which the tomcats examples application uses (ie Tomcat 4.1\webapps\examples\WEB-INF\classes\) and it appeared to be working fine.
    I was calling the servlet like this : http://localhost:2006/examples/servlet/TestServlet
    But when I installed my own WAR file in the server , the servlet is not working now. now the new location of my servlets is : Tomcat 4.1\webapps\MyApp\WEB-INF\classes\
    and I'm trying to call the servlet like this : http://localhost:2006/MyApp/servlet/TestServlet
    The error , what i'm getting is :
    description :The requested resource (/MyApp/servlet/TestServlet) is not available.
    Some body please tell where I'm making the mistake ? I believe this may have something to do with the servlet context path setting. If anybody has any idea , how to set the path..will be much appreciated.

    Thanx for your reply , at first I was not using any web.xml(since not mandatory) but even after using the web.xml file the error is coming . Please have a look into the contents of the web.xml file and let me know if you find any problem...
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>TestServlet</servlet-class>
    </servlet>
    </web-app>
    one more thing I would like to tell you here. I was just looking into the configuration of Iplanet web server..I found that , there are options to set the servlet container path (like : - Prefix: /servlet
    Servlet Directory: /ecomm/iplanet/nes60/product/docs/container )
    so from here I came to know that "container " is the folder where we should put our servlets and it has URI as "servlet" but yet I'm not able to find any option in the Tomcat Web server to set the servlet container to any different directory.
    If you have any idea please let me know.

  • Finding the context path or docBase in a backing bean - Howto

    How should I go about finding the context path or docBase in a backing bean?
    Is there anyway to get this from glassfish or jsf? GlassFish proudly displayed it on the Application Server > Applications > Web Applications > page. It puts it there with an EL for example:
    ${com.sun.aas.instanceRoot}/applications/j2ee-modules/jsf-witaCan and/or should I try to use it in a backing bean? i.e. can I rely on it to stay defined?
    Or should I make a property which I can set for my backing work?

    Is this what you want?
    FacesContext.getCurrentInstance().getExternalContext().getContext()

  • Trobule in saving log in file which is in my context path

    Hello all, i am facing problem while saving log into Log file from servlet. I am using Log4j library and eclipse as IDE. When i push any log information to log file, it make log file default to eclipse path not in my servlet context path. I am using log4j.properties file for configuration. Which has following contents :
    log4j.rootLogger=DEBUG, FA
    log4j.appender.FA=org.apache.log4j.FileAppender
    log4j.appender.FA.File=log.txt
    log4j.appender.FA.layout=org.apache.log4j.PatternLayout
    log4j.appender.FA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
    and servlet code for configuring properties file is : PropertyConfigurator.configure(context.getResource("/log4j.properties"));
    what when i push content to log.txt it create file in my eclipse path. How can i set the file path as my context path for log.txt?
    thanks in advance.
    sanjeev

    I don't know such way. But maybe You can read the file when application starts (in ServletContextListener) and change this property when it's already running. Don't know if this helps, but may try.

  • h:outputLink with context path?

    Hey,
    give it anyway to set an flag in the <h:outputLink> tag to copy the context path automatic on the beginning of the value from outputLink or must I write my own component?

    No flag like that... I'm not actually sure what the problem is here though. It definitely sounds like you don't need a custom component though!
    What's wrong with just binding the value attribute to your backing bean, and let the bean figure out what your context root is?
    CowKing

  • Weblogic.application.ModuleException: Context path is already is use

    Hi,
    I am using ALSB 3.0 and I am trying to deploy a ALSB configuration jar. I am seeing the following exception during deployment.
    +weblogic.application.ModuleException: Context path '/alsb/internal/transports/ejb/UserAccounts_1_0_businessservices_C-6414' is already in use by the module: /alsb/internal/transports/ejb/UserAccounts_1_0_businessservices_C-6414 application: EJBALSB_1290003713346+
    If i restart the Weblogic server and redeploy it works. I will not have the convenience of restart on the production systems. I need to nail this issue on my test system and I am looking for help.
    My configuration details are
    SunOS camden 5.10 Generic_120011-14 sun4v sparc SUNW,SPARC-Enterprise-T2000
    WebLogic Server 10.0 MP1
    AquaLogic Service Bus 3.0.0.0
    java version "1.5.0_21"
    My set up is as below
    One Admin server and two Managed server which are in a cluster. All deployments are done using the Admin server.
    The ALSB configuration Jar uses the ALSB business service to lookup to a JNDI provider.
    I am a newbie and I am not sure if I have provided all the details for someone to help me out. Please let me know if you need more information.
    Thank you.
    Support.

    Looking at the information provided I assume that you are modifying some BS related to EJB and activating the session with new changes.
    Instead of restarting servers you can also see if this workaround is working.
    1) disable the BS and commit the session
    2) modify changes to BS and enable BS and commit session.
    Let me know if the above work-around is working.Ideally we should not see the behavior what you are observing. Track it through support to get a fix. While activating the changes, OSB deletes the old resource and creates a new resource. During this stage something is going wrong inside OSB (clash of JNDI names for old and new resources OSB deploys).
    I also vaguely remember that some issues with JNDI that got resolved in later releases.Please check with support to confirm if there is an existing patch already.
    My two cents
    Manoj
    Edited by: Manoj Neelapu on Nov 29, 2010 9:02 AM

  • Context path

    I have a web app in a war called my_war which is in an ear called my_ear
    I have a jsp page called hello.jsp in directory "dude" (i.e. the directory structure in the war has a directory /dude with hello.jsp in it)
    So to get to this page in my browser, I type
    http://ip_address/my_ear/dude/hello.jsp
    Note that by default, it uses the ear name which seems pretty sensible.
    If I put <%=request.getContextPath()%> in this jsp page, I get "/my_ear"
    This is also what I expected and I'm happy so far, I will refer to this value as the "context path"
    Now say I have another jsp page dude2/booya.jsp
    I want an html link between the 2.
    I could get this by <%=request.getContextPath()%>/dude2/booya.jsp
    I know I could also probably go ../dude2/booya.jsp, but I'd rather not.
    To make my design a bit nicer, I would prefer to avoid calling <%=request.getContextPath()%> each time I want to get the context path. I'd rather store it globally. It can't change right?
    Is there a way to get the context path on deployment of my web app.
    e.g from the init method of a servlet that is set to load-on-startup

    The context path can change if you deploy the war or ear differently. There is a context path setting in application.xml in the ear's META-INF. Your best bet is to use inheritance. You can make your JSPs/servlets extend a base servlet which could add another parameter to the service signature. That's kinda how JSP gets its other auto defined locals like request, response, and out. The downside is that you'd have to declare the new method in your JSPs unless you wanna get into creating/modifying the JSP servlet generator. I dunno, maybe that's not such a hot idea after all.
    Cliff

  • DocBase for servlet context path

    In Tomcat's server.xml file, I can setup a url mapping to a local directory on my server. For instance, in the above example, when a user calls "http://localhost:<port>/my_servlet/reports/... " the Tomcat engine will access the my_reports directory on my machine. Is there a weblogic configuration property or entry in one of weblogic 7.0's many xml config files I could use to duplicate this functionality?? Thanks much!!!!
              Tomcat 4.01 server.xml entry:
              <Server><Service><Engine><Host>
              <Context path="/my_servlet/reports" docBase="C:/my_webapp_home/my_reports" debug="0"
              </Context>
              </Host></Engine></Service></Server>
              

    Yes. Checkout:
              http://e-docs.bea.com/wls/docs70/webapp/weblogic_xml.html#1037236
              virtual-directory-mapping
              Use the virtual-directory-mapping element to specify document roots other
              than the default document root of the Web application for certain kinds of
              requests, such as image requests. All images for a set of Web applications
              can be stored in a single location, and need not be copied to the document
              root of each Web application that uses them. For an incoming request, if a
              virtual directory has been specified servlet container will search for the
              requested resource first in the virtual directory and then in the Web
              application's original document root. This defines the precedence if the
              same document exists in both places.
              Example: (weblogic.xml)
              <virtual-directory-mapping> <local-path>c:/usr/gifs</local-path>
              <url-pattern>/images/*</url-pattern>
              <url-pattern>*.jpg</url-pattern></virtual-directory-mapping><virtual-directo
              ry-mapping> <local-path>c:/usr/common_jsps.jar</local-path>
              <url-pattern>*.jsp</url-pattern></virtual-directory-mapping>
              hth,
              Vinod.
              "Keith Wilson" <[email protected]> wrote in message
              news:[email protected]...
              > In Tomcat's server.xml file, I can setup a url mapping to a local
              directory on my server. For instance, in the above example, when a user
              calls "http://localhost:<port>/my_servlet/reports/... " the Tomcat engine
              will access the my_reports directory on my machine. Is there a weblogic
              configuration property or entry in one of weblogic 7.0's many xml config
              files I could use to duplicate this functionality?? Thanks much!!!!
              >
              > Tomcat 4.01 server.xml entry:
              > <Server><Service><Engine><Host>
              > <Context path="/my_servlet/reports" docBase="C:/my_webapp_home/my_reports"
              debug="0"
              > </Context>
              > </Host></Engine></Service></Server>
              

  • How do I set project paths in JBuilder 4?

    Hello,
    I am trying to create a new project in JBuilder 4.
    I used the project wizard and set my paths to the following folders:
    C:\OU2007\TM427\mysolution
    However when the project and all files are getting saved to these folders:
    C:\Documents and Settings\Jason\jbproject
    Have you any idea why this is? I�m a bit confused on what I should enter for each of the paths in the project wizard, any help would be appreciated.
    thanks,
    Jason.

    It's difficult to set a single font size without wrecking the display of most web sites. One alternative would be to store your preferred zoom level and apply that to all sites. This requires an add-on such as:
    * [https://addons.mozilla.org/en-US/firefox/addon/6965/ Default FullZoom Level]
    * [https://addons.mozilla.org/en-US/firefox/addon/2592/ NoSquint]
    Does that work for you?

  • How can i set a path for my deployment files in weblogic server 10.3

    Hi
    How can i set the path for my WAR ,JAR files while deploying.i am using the wls10.3 version.
    is there any scripts for this ,please provide me.
    my Application is ADF 11g application.

    By "path", I assume you mean "classpath".
    The simplest way is simply to include the jars you need inside the web application or web module's WEB-INF/lib directory, EJB module's META-INF/lib directory, or EAR lib directory.
    If that's not practical, if you use NodeManager to start your servers, you can go to the "Server Start" tab in the server definition in the WebLogic console and edit the "Classpath" field, which defaults to no value. You can specify a classpath value there. Note that if you specify a value there, it REPLACES the default classpath for the server, it doesn't add to it. If you need to just add to it (a much more likely scenario), if the value references the value "$CLASSPATH" in it, that will reference the original classpath value that the server would have had.
    So, for instance, if you wanted to include the MQ jars in the server classpath, you could set a value like this:
    /usr/java/mq/lib/mq.jar:/usr/java/mq/lib/mqstuff.jar:$CLASSPATH

  • Table error - Context Path Cannot Be Resolved (Last Node Is Empty)

    Hi All,
    I am dynamically building up a context node called PoList which is used to hold the contents of a table.
    My BAPI is called and a routine transfers the contents of the BAPI context node across into the POList context node. This is rendered correctly on the screen. There is a routine which filters the results based on a vendor. The code works fine when some records are found but when no records are found, I get the error "Context Path POLIST.EBELN Cannot Be Resolved (Last Node Is Empty) ".
    The cardinality of the PoList node is 0..N. This should mean that 0 records is valid.
    The ABAP which fills the context is pasted below :
    data:
        Node_Z_Bapi_Po_Combined             type ref to If_Wd_Context_Node,
        Node_Changing_Po                    type ref to If_Wd_Context_Node,
        Node_T_Header                       type ref to If_Wd_Context_Node,
        Elem_T_Header                       type ref to If_Wd_Context_Element,
        itab_C_T_Header    type If_Componentcontroller=>Elements_Polist,
       stru_C_T_Header    like line of itab_C_T_Header,
        Stru_T_Header                       type If_Componentcontroller=>Element_T_Header .
      data:
        Node_Polist                         type ref to If_Wd_Context_Node,
        Elem_Polist                         type ref to If_Wd_Context_Element,
        Stru_Polist                         type If_Componentcontroller=>Element_Polist.
      data:
    lri_Element    type ref to if_Wd_Context_Element,
    loa_Elements   type Wdr_Context_Element_Set.
    navigate from <CONTEXT> to <Z_BAPI_PO_COMBINED> via lead selection
      Node_Z_Bapi_Po_Combined = wd_Context->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_Z_Bapi_Po_Combined ).
    navigate from <Z_BAPI_PO_COMBINED> to <CHANGING_PO> via lead selection
      Node_Changing_Po = Node_Z_Bapi_Po_Combined->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_Changing_Po ).
    navigate from <CHANGING_PO> to <T_HEADER> via lead selection
      Node_T_Header = Node_Changing_Po->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_T_Header ).
    navigate from <CONTEXT> to <POLIST> via lead selection
      Node_Polist = wd_Context->get_Child_Node( Name = IF_COMPONENTCONTROLLER=>wdctx_Polist ).
      loa_Elements = node_T_Header->get_Elements( ).
      loop at loa_Elements[] into lri_Element.
        lri_Element->get_Static_Attributes(
          importing Static_Attributes = stru_C_T_Header ).
    Get the vendor number
        if i_lifnr is initial.
          insert  stru_C_T_Header into table itab_C_T_Header[].
        elseif i_lifnr = stru_c_t_header-lifnr.
          insert stru_C_T_Header into table itab_C_T_Header[].
        endif.
      endloop.
      data : W_LINES TYPE I.
      describe table itab_c_t_header lines w_lines.
      if w_lines eq 0.
        node_Polist->set_lead_selection_index( 0 ).
        CALL METHOD NODE_POLIST->INVALIDATE.
      else.
        node_Polist->bind_Table( itab_C_T_Header ).
        clear itab_C_T_Header[].
      endif.
    I would have though that invalidating the node would blank the context node and mean that the table is empty but instead I get an error.
    Please help.
    Richard

    Hi Richard,
    The problem here is that some UI element tries to bind against a node where the parent node is empty. You have to make sure that the last but one node has at least 1 element, otherwise you should hide the UI element (visibility = NONE).
    If the lead selection were empty, the corresponding error message would tell you this, but it explicitely says: "Last Node is Empty", and you can trust it.
    One possibility to have at least one element in the node is to change the cardinality to 1..n. If you have a supply function for this node, you have to make sure that there is at least 1 element (bind empty structure to the node), otherwise the framework creates the first element for you.
    Ciao, Regina

  • How to set dynamic path in forwards action

    Hi All,
    i have a requirement to set my path dynamically in forward action
    suppose i have
    @Jpf.Action(forwards = { @Jpf.Forward(name = "success1", path =  "/output1.jsp") })
         public Forward testIpc1() {
              Forward forward = new Forward("success1");
              System.out.println("IN PageflowportletController :: testIpc1() method called");
              return forward;
    Here the path="/output1.jsp" is hardcoded.is there any way to set the path dynamically in forwards action
    @Jpf.Action(forwards = { @Jpf.Forward(name = "success1", path =  dynamic_path) })
    how do i get the dynamic path set in my forwards action.
    Suggestions provided would be really helpful
    Thanks,
    Deepak

    http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/classpath.html

Maybe you are looking for

  • Since updated to 3.4.1 Aperture doesn't work

    since I updated the application aperture it doesn't work anymore and it ask me to enter the serial key which I haven't because I bought it from the app store. This problem occurs on a mac book pro retina if this can help.

  • How to change Quantity in LQ02

    Hi, We have a requirement for transferring from blocked stock into Un-Res Stock. This is initiated from a bin to bin transfer transaction. So when the users are doing bin to bin transfers, the program should check the source storage type and if it is

  • InDesign Folio Error // Book

    Hi, We are running into very strange problem very frequently, very recently. We have individual InDesign documents paginated as Chapters/Articles, and when we create PS or Export PDF, everything looks fine. Whereas, when we create InDesign Book (to c

  • Select single * into FIELD_SYMBOL

    Hi, I'm trying to select single * into a field symbol, but I keep getting a dump.  Is it not possible to do this.  The syntax checker says it's ok... ThankS!

  • Dreamweaver template removes swf when updated

    Everthing was working great, then I update the index pagewith the temp. and the swf banner disappeared. I can't seem to get it back, after viewing the temp. in  a browser it's there. I've done these a million times and this is the first time this has