Context-root Problem

The project I'm working on has just recently changed the context-root of the webapp from / to /grp. As the UI developer for this project, this seemingly small change has had a huge impact on my workload. All of the images, stylesheets and JavaScript files have absolute paths. For example, an image on the site would have the path
/i/t.gif
I'd like to know if there's a way to map /i to /grp/i without having to change every JSP in the webapp (~3000 files).
I read about virtual-directory-mapping at http://e-docs.bea.com/wls/docs81/webapp/weblogic_xml.html#1039396 but that only seems to apply to a directory on the server and not within the WAR file itself.

one solution for that is use a web server such i-planet that manage the static content.
the location of static content must be independent of application.

Similar Messages

  • Context Root problem migrating from WAS 4.0.4 to WAS 5.11

    Hi,
    Hopefully this is the most appropriate forum, apologies if not.
    I have a problem in migrating an application from WAS 4.0.4 to WAS 5.11, whereby the Context Path of the application is not being included within the URL of a servlet.
    When a user submits one of the application forms (presented as a JSP) and the application is running on WAS 4.0.4, the Form Action URI is "re-written" to include the Context Path of the application i.e. where the URI is "/xx/list.html", the domain is "www.mydomain.com" and the Context Path is "/myapp", on the 4.0.4 server the form submission is redirected to:
    www.mydomain.com/myapp/xx/list.html
    However, once deployed on WAS 5.11 and updating the Context Path in the EAR file as required during deployment, the application redirects to:
    www.mydomain.com/xx/list.html
    ...which causes an HTTP 404 error as you might expect.
    I have included debugging to display the context path at the point of submission and it is what you would expect i.e. "/myapp". The problem seems to be some kind of disconnect between the servlets or application and the application server container(?), perhaps in that it doesn't understand the context in which it exists at the point when the URL is being constructed.
    Can anyone give me some pointers as to why the servlet URL isn't being constructed with the Context Path of the application on WAS 5.11 when it is on WAS 4.0.4 please?
    Thanks in advance
    Jon Sumpster

    I found the problem.
    The default value of the 'com.ibm.websphere.sendredirect.compatibility' variable changed from True in WAS 4.0.4 to False in WAS 5.11. Changing this resolved the problem.
    Regards
    Jon

  • Problem with context root

    Hi,
    i have a big problem with the context root in jdeveloper 10 g, for this i can´t found a file using "getClass().getResourceAsStream", i don't know why?, i think that is the context root,
    the project uses a class WebParametersServlet extends HttpServlet, "WebParameters.SITE_ROOT" read it of a xml.
    Please help me.

    same app, but with two diff context root ?
    A web app packaged in WAR can have only one context root. Package a web app in two different WARs for two different context roots.
      weabpp1.war web.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-web-app>
      <context-root>context-1</context-root>
    </weblogic-web-app>
      weabpp2.war web.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-web-app>
      <context-root>context-2</context-root>
    </weblogic-web-app>

  • Problem with same application under two different context root

    JDev 11.1.1.6
    Does anyone have experience with such one scenario, so same app, but with two diff context root ?
    At a certain point, since both start to be used (and just in that case), at times there was a drastic deceleration, as if something is blocking some period. Subsequently, after some time, the application start to behave normally. I also periodically comes to acceleration and deceleration. In the log files there is no trace, no exception happens, nothing.
    And all this in a situation where both applications use only one user per app (so, the resources are not concerned)
    Any comments ?

    same app, but with two diff context root ?
    A web app packaged in WAR can have only one context root. Package a web app in two different WARs for two different context roots.
      weabpp1.war web.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-web-app>
      <context-root>context-1</context-root>
    </weblogic-web-app>
      weabpp2.war web.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <weblogic-web-app>
      <context-root>context-2</context-root>
    </weblogic-web-app>

  • How do I change the context-root of a web app with a deployment plan?

    I've been trying to figure this out for several hours.
    I'm deploying a .ear file which sets the context root for the single web application it deploys in its application.xml deployment descriptor:
    <application>
    <display-name>MyApp</display-name>
    <module>
    <web>
    <web-uri>MyAppViewControler.war</web-uri>
    <context-root>MyApp</context-root>
    </web>
    </module>
    </application>
    I want to change the context-root from /MyApp to something else when deploying the ear file. It seemed to me that using a deployment plan was the way to do this. But when I use this plan:
    <deployment-plan>
    <application-name>MyApp<application-name>
    <variable-definition>
    <variable>
    <name>NEWCONTEXTROOT</name>
    <value>foobar</value>
    </variable>
    </variable-definition>
    <module-override>
    <module-name>MyApp</module-name>
    <module-type>ear</module-type>
    <module-descriptor external="false">
    <root-element>application</root-element>
    <uri>META-INF/application.xml</uri>
    <variable-assignment>
    <name>NEWCONTEXTROOT</name>
    <xpath>/application/module/web/context-root</xpath>
    </variable-assignment>
    </module-descriptor>
    </module-override>
    </deployment-plan>
    I get an error:
    weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    /bea/user_projects/domains/devod1/nullplan.xml:0: problem: cvc-complex-type.2.4a: Expected element 'web-uri@http://java.sun.com/xml/ns/javaee' instead of 'context-root@http://java.sun.com/xml/ns/javaee' here in element web@http://java.sun.com/xml/ns/javaee:<nullplan.xml>
    I looked at http://e-docs.bea.com/wls/docs103/pdf/deployment.pdf which says:
    "You cannot use a deployment plan to change the context-root in an application.xml
    file. However, if an application is deployed as a library, you can either change the
    context-root through an weblogic-application.xml file or use the deployment plan
    to change the context-root in an weblogic-application.xml file."
    I don't understand what this means. I'm not deploying my application as a library.
    Does anyone know how to change the context-root for an application?
    Any help would be greatly appreciated!

    Hi James,
    I am quite new to Welogic if i am wrong please correct me.I have re-deployed my application (.war) with this Plan.xml
    &lt;?xml version='1.0' encoding='UTF-8'?&gt;
    &lt;deployment-plan xmlns="http://www.bea.com/ns/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/deployment-plan http://www.bea.com/ns/weblogic/deployment-plan/1.0/deployment-plan.xsd" global-variables="false"&gt;
    &lt;application-name&gt;BrowserR08.003&lt;/application-name&gt;
    *&lt;variable-definition&gt;*
    * &lt;variable&gt;*
    * &lt;name&gt;CONTEXTROOT&lt;/name&gt;*
    * &lt;value&gt;BrowserWeb/servlet/BrowserServlet&lt;/value&gt;*
    * &lt;/variable&gt;*
    * &lt;/variable-definition&gt;*
    &lt;module-override&gt;
    &lt;module-name&gt;BrowserWeb.war&lt;/module-name&gt;
    &lt;module-type&gt;war&lt;/module-type&gt;
    &lt;module-descriptor external="true"&gt;
    &lt;root-element&gt;weblogic-web-app&lt;/root-element&gt;
    &lt;uri&gt;WEB-INF/weblogic.xml&lt;/uri&gt;
    &lt;hash-code&gt;1231953167814&lt;/hash-code&gt;
    *&lt;variable-assignment&gt;*
    * &lt;name&gt;CONTEXTROOT&lt;/name&gt;*
    * &lt;xpath&gt;/weblogic-web-app/context-root&lt;/xpath&gt;*
    * &lt;operation&gt;add&lt;/operation&gt;*
    * &lt;/variable-assignment&gt;*
    &lt;/module-descriptor&gt;
    &lt;module-descriptor external="false"&gt;
    &lt;root-element&gt;web-app&lt;/root-element&gt;
    &lt;uri&gt;WEB-INF/web.xml&lt;/uri&gt;
    &lt;/module-descriptor&gt;
    &lt;module-descriptor external="true"&gt;
    &lt;root-element&gt;wldf-resource&lt;/root-element&gt;
    &lt;uri&gt;META-INF/weblogic-diagnostics.xml&lt;/uri&gt;
    &lt;/module-descriptor&gt;
    &lt;/module-override&gt;
    &lt;config-root&gt;/export/home1/tecapp/BrowserR08.003/plan&lt;/config-root&gt;
    &lt;/deployment-plan&gt;
    I do not know wether i will require the other module descriptor definition in this Plzn.xml. Now when I go to following link.
    Deployments --&gt; MyApp --&gt; Testing
    It gives me following url as a test page:
    http://localhost:7001/BrowserWeb/servlet/BrowserServlet
    as soon as i click on to the above link it redirects me to following.
    http://localhost:7001/BrowserWeb/servlet/BrowserServlet/servlet/BrowserServlet
    Same if i remove these context-root part my normal Testing menu shows me following link as my webapp access path
    http://localhost:7001/BrowserWeb &lt;-- My war file name is BrowserWeb.war so it is default name of my deployed application if i am not wrong
    and as soon as i click on above link it redirects me to the following one.
    http://localhost:7001/BrowserWeb/servlet/BrowserServlet
    It means application server know that my full web access page is with '*servlet/BrowserServlet*' because its adding it in both the cases.
    What I want is a constant URL whcih does not change?
    Hope this helps :)

  • FYI: Extension Builder project w/ LCDS: channel-definition endpoint having context.root

    This is an FYI of an issue and its workaround.
    If developing a CS SDK Extension in Flash Builder / Extension Builder and the project is configured to use LCDS (LiveCycle DataServices), then if your services-config.xml contains Channel definitions having the variable {context.root} in the endpoint URL, then the following error will occur.  This will happen even if you are not using that Channel in your Destination channel list.
    The services-config.xml laid down when using LCDS integrated into ColdFusion has by default some channel definitions using context.root in the endpoint URLs.   This is how I encountered the issue.  On the other hand, the free developer edition of LCDS on Tomcat puts down a services-config.xml that does not have any reference to {context.root} in channel definitions, so the problem will not be encountered there.
    Since I was not using a context root (was using the default of just "/"), I commented out the offending channels in services-config.xml to resolve the issue.  One could also leave the (unused) channel definitions and then remove the {context.root} part from the endpoint.
    ERROR
    The services configuration includes a channel-definition 'java-amf' that has an endpoint with a context.root token but a context root has not been defined. Please specify a context-root compiler argument.
    CHANNEL DEFINITION
    <!--  Java Based Endpoints -->
            <channel-definition id="java-amf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
            </channel-definition>

    Make sure your context root is defined in the project properties.  This is at "project/properties/Flex Server" from the menubar or package explorer context menu.  Alternately, you can hardcode your context root in the services-config.xml file/channel definition.

  • How to map a url that does not match with the context root  ?

    does weblogic support url that does not match the context root ?
    ex. the context root is AAA. the welcome page can be
    retrieved using http://localhost:7001/AAA
    Can it be configured to use http://localhost:7001/BBB to bring up the index.html in context root AAA ? if so, how ?

    I agree with Imp68.
    It still amazes me that in 2014 so many web sites are still not standards-compliant and instead insist on sniffing for the user-agent.  And, in the majority of cases, I've found that the websites work fine with any modern browser.
    phardell,
    To be clear, Safari is not the problem, the website is!  The developer of this website is still living in the 1990s and needs to move forward with the times.  Imp68's suggestion will cause Safari to "pretend" to be whatever browser you wish.  Try choosing "Safari 7" if that worked for you in the past and the website will likely go back to working.  If that does not work then try choosing "Internet Explorer 10" from the menu and see if that works.
    No matter what the result, you should look at the bottom of the page for a link to report problems with the website.  Submit a comment that tells them that they need to "modernize your website to support all modern web browsers".
    Good luck.

  • How can i retrieve xsl file by context-root

    we have a project using weblogic server6.1,all things done smoothly,
              but,we met a big problem . we use xml and xsl export html,but the problem is
              how can we retrieve xsl document in the same project root by relative path
              to context-root,is there some method else work around this. thanks in
              advance.
              

    In Repository, double click on XSL program.
    It will show you the mapping program, Graphical & there is one option for Code also, you can check the code there.
    Else if you have stylus studio, so export that program from repository & import into the stylus studio.
    When you will check this in stylus studio, it will ask you sender structure & receiver structure, just give it XSD of sender & receiver structures. Here you can check the complete mapping in graphical as well as codiing.
    Sandeep Kaushik

  • How to access static resources in ear without specifing context-root

    Hello, i have a problem with my ear.
    The war's structure is like this:
    ---/jsp
    ---/css
    ---/images/ViewRisposte.gif
    ---/xsl/Request.xsl
    ---/Common/data.xsl
    /error.xsl
    /input.xsl
    xsl files reference css and images files that are contained in css and images dir.
    I can't use the "../" to specify css and images path into xsl and jsp due to security policy setting on the Http server (and I can't change this policy).
    In the ear's application.xml is specified the context root of the module web with the name SABEARWeb
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <application>
    <display-name>SABEARWeb module</display-name>
    <module>
    <web>
              <web-uri>SABEARWeb.war</web-uri>
              <context-root>SABEARWeb</context-root>
         </web>
    </module>
    </application>
    For example with this following code (Request.xsl), how can i replace the "../" notation to access xsl and image resouces without write the context root? How i can insert the images and css references into xsl and jsp files?
    <xsl:import href="../Common/data.xsl" />
    <img align="center" width="20" src="../images/ViewRisposte.gif" id="viewXslRisp" title="Visualizza Risposta">...</img>
    Thanks a lot

    >>As I understand I should change View1 by handling command of button “Edit”, and then View 2 should be displayed, then I change data and then View1 should be updated. How to do it?
    For information about how to handle a command, please refer to my blog post:
    http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/
    You could bind the Command property of the edit button to an ICommand property of VMMain. When this command is executed you could then send a message using an event aggregator or some kind of messenger. Please refer to my blog post for more information about
    how to for example use Prism's event aggregator class to pass events between view model classes:
    http://blog.magnusmontin.net/2014/02/28/using-the-event-aggregator-pattern-to-communicate-between-view-models/
    Andy has written an example of how to use MvvmLight's Messenger class:
    http://social.technet.microsoft.com/wiki/contents/articles/26070.communicating-between-classes.aspx
    The concepts are the same but you will have to download and reference either Prism:
    https://www.nuget.org/packages/Prism/
    ...or MvvmLight: https://www.nuget.org/packages/MvvmLight/
    You then subcribe to this event or message in the main view model and change the value of the CurrentPageViewModel property whenever you recieve an event. Note that the class must implement the INotifyPropertyChanged interface and raise its PropertyChanged
    interface for this to work:
    https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
    This is how you are supposed to communicate between different view model classes.
    Hope that helps.
    Please remember to close your threads by marking helpful as answer and then start a new thread if you have a new question.

  • HowTo: deploy an j2ee app using "/" as context root on iAS 6.5

    Hi all iAS expert
    It is highly appreciated one can teach me how to get around below problem
    l deployed an app using "/" as context root. But the iAS could respond to any HTTP request.
    However, as l changed the context root to sth other than root. iAS responded properly.
    Can someone help me get around this problem ?
    thank you a lot
    fox

    I deployed the same EJB on WLS 6.1+sp3 and WLS 7.0.
    These both work. Looks like there is some problem with WLS6.0+sp2. I have opened
    a case with BEA customer support.
    --Latha

  • Navigation and context root

    I have a web application that only has four pages. A login brings a user to a welcome page and then from the welcome page, the user should be able to access either of the other two pages. However, jsf is trying to direct to the other pages relative to the page it is currently on. For instance, in my WebContent folder I have an html folder which has otherTwo and welcome folders. welcome.jsp is in the welcome folder and the page I am trying to get to is in the otherTwo folder. When I click the link to get to the page, it says html/welcome/html/othertTwo/page.jsp is not found.
    Relevant code
    <navigation-rule>
    <navigation-case>
      <from-outcome>otherPage</from-outcome>
      <to-view-id>/html/otherTwo/page.jsp</from-outcome>
    </navigation-case>
    </navigation-rule>I have never had this problem before with jsf. I am using backbase for the first time in this application and was wondering if anyone knew if it is known for causing issues like this. Also, is there a way to set the context root explicitly in say web.xml or something like that?
    Thanks

    sl,
    Have you looked at the deployed applications in the OAS admin tool (GUI)? I'd be curious as t what you might find there with two applications using the same context root.
    -Michael

  • Help me! Change Context root in weblogic portal 10.3.2

    I has a desktop in weblogic portal with path is: http://localhost:7001/ABC/appmanager/t1/home , I want to change the string ABC => Portal with new is the path: http://localhost:7001/Portal/appmanager/ v1/home How to configuration? I need config file? .The users help to resolve the problem this
    Thanks you very much! Hoping to replay soon!!!

    Thanks Sanjeev Kumar has replay topic!
    I have followed your instructions by: replace <display-name>Portal</display-name> in web.xml and <wls:context-root>Portal</wls:context-root> in weblogic.xml , then I redeploy up server portal weblogic then runing path new is http://localhost:7001/Portal/appmanager/t1/home , throw error:
    Resource /t1/home could not be resolved for locale null. I think problem related to database when I create desktop. I view database see context root ABC resource in PF_Desktop_instance and PF_Desktop_Defination.How to update name colum WebApp in two table?
    Thanks you very much! Hoping to replay soon!!!
    Edited by: 890028 on Feb 15, 2012 11:12 PM

  • Can not get application bc4j for adding context root file

    Hi all,
    Can someone help me on this,
    i got this this error while trying to run my web based reporting:
    06/08/21 18:01:04 [SEVERE]: Error instantiating application at file:/C:/Documents and Settings/Bryan1/Desktop/Pattern Maching JSP 2006Feb/jdevstudio1013/jdev/system/oracle.j2ee.10.1.3.34.12/embedded-oc4j/applications/bc4j.ear: Unable to get ApplicationConfig for bc4j : Error creating deployment directory: IO Error: The system cannot find the path specified.
    06/08/21 18:01:04 [SEVERE]: Error instantiating application at file:/C:/Documents and Settings/Bryan1/Desktop/Pattern Maching JSP May2006/jdevstudio1013/jdev/system/oracle.j2ee.10.1.3.34.12/embedded-oc4j/applications/ITS.ear: Unable to get ApplicationConfig for ITS : Error creating deployment directory: IO Error: The system cannot find the path specified.
    2006-08-21 18:01:07.265 WARNING J2EE_OJR0007 Can not get application bc4j for adding context root file:/C:/Pattern Maching JSP May2006/jdevstudio1013/jdev/system/oracle.j2ee.10.1.3.34.12/embedded-oc4j/config/default-web-site.xml
    Ready message received from Oc4jNotifier.
    Embedded OC4J startup time: 5282 ms.
    Target URL -- http://192.168.2.55:8988/Trans-Reporting-context-root/login.jsp
    06/08/21 18:01:07 Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview initializedIF i run http://192.168.2.55:8080/Reporting/login.jsp from web browser then is ok, but cannot straight run from JDeveloper? How to set the path?
    rgds,
    bryan

    Dear Frank,
    Thanks for ur reply but i still failed to access to my login.jsp
    I already select RUN from menu then clean <XXXX.jpr>, then rebuild the project and Run the project but still have the same problem.
    rgds,
    bryan

  • Context root for web Module application (with slash)

    We are on PI 7.31. I am getting URL not found error with web application in certain cases. Initially, i had thought it was not working because of the Slash. Later I realized it was happening with only keyword 'inbound'.
    Edited:
    my alias (context-root) starts with "inbound" and that is the problem.. For me when i try anything other inbound it works..
    For some reason, when I put my context-root as 'inbound' it gives me the message that URL does not work. All other context roots with  and without "/"(slash) works.

    Okay, The URL prefix in the SMICM is generated from the Services/external Alias defined in the SICF. Unfortunately in the new PI 7.31 environment, the URL prefix is stripped down to the first level.
    In our case, we had the URL (/inbound/xxx/yyy) which was SICF service. As a result our URL prefix was stripped to /inbound/. When we developed a java webmodule with URL /inbound/zzzz, it gave service not active error.
    We are creating a message with SAP to see if this will be the standard behavior going forward. Anyone encountered such an issue before?
    Moderators, I guess this question needs to be moved to a different topic thread. Wondering if I should close this thread and open a new one ?

  • Multiple war with same context root

    Dear all,
    I would like to know if it's possible to have several war in an EAR file with a same context root?
    I know that it is possible to have several war but I don't know if it's possible to share the same context root.
    The problem here is that the application on which we work is provided by another company, hence we have an original EAR containing the company war as well as the company EJB. As new versions of the application are delivered to us quite frequently, it's impossible to store the code developped by us in the EAR, as it is replaced in each delivery.
    Concerning our custom code, it is not a problem as we develop this code in a separated project which is included as a jar in the APP-INF/lib directory of the EAR file.
    But concerning the war it's an other problem. Indeed, we develop custom JSFs pages or javascript. These files are placed in the application war file which changes for each delivery.
    Thus, we would like to create an other war file which will contain all our custom pages and javascripts in order to be able, in each delivery, to fully replace the other war containing the company pages and javascripts. This would allow us to save time each time a new delivery is done.
    The important thing would be to keep the same context root for the two wars, enabling transparency for the application.
    Thanks for your help,
    Citrouille57

    Hello,
    this is possible in IBM Websphere via custom extension: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tprs_sharing_data.html
    I don't know if it's possible somewhere else.
    k.

Maybe you are looking for