the Context Root of Web Applications

 

  

Changing the Context Root of Web Applications

Soon after the first steps in developing web applications on SAP NetWeaver Cloud, developers often realize that the default context root of their applications is not exactly what they want. By default, the context root goes after the project name - if the name of your project is "HelloWorld" then it will be deployed with context root "/HelloWorld".

 

Changing the context root is a piece of cake. In this post we will see how you can do this in Eclipse and in the Neo Console Client.

 

Setting the context root when creating a new web project in Eclipse

 

As described in the Getting Started tutorial, when creating a new web application, you typically use the "New Dynamic Web Project" wizard. Instead of finishing it on the first wizard page, you should click on the Next button to advance to the "Web Module" wizard page. There you can set the context root of the application by modifying the value in the "Context root" text field. If you wish to deploy the application in the server's root then simply give "/" as context root.

web_facet_page.png

 

Changing the context root of an existing web project in Eclipse

 

To change the context root of a web application that is already available in the Eclipse workspace, simply right-click on the web project and call the "Properties" action from the context menu. Then navigate to the "Web Project Settings" property page and you will find the text field where you can change the context root.

web_project_settings.png

 

If your application is already deployed then you will need to redeploy it for the change to take effect.

 

Setting the context root when deploying a WAR using the Neo Console Client

 

Setting the context root using the Neo Console Client is as easy as in Eclipse. Simply name the WAR file you aredeploying with the desired context root. For example, if you want to deploy your WAR in context root "/hello" then rename your WAR to hello.war. If you want to deploy it in the "/" context root then rename your WAR to ROOT.war(capital letters matter).

 

If your application is already started then you need to stop it and start it again for the change to take effect.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值