天道酬勤,学无止境

contextroot

JBoss 7: how to change a WAR context root

I have an application that is to be deployed in a WAR file (app.war). After deployment it is available from http://:8080/app I would like to have it being made available as something like http://:8080/secret/app I searched the documentation and for JBoss'es 5 and 6 this seems to be able to do with a jboss-web.xml file. I have tried it but with no luck. It seems that JBoss 7 just ignores the element inside jboss-web.xml. I don't know if this is relevant but this application has both JSF and PrettyFaces. Does anyone know if this behavior is possible with JBoss 7? If so, how can it be done? I am

2021-04-27 02:06:45    分类:问答    jboss   war   jboss7.x   contextroot   jboss-web

在GlassFish 3中使用glassfish-web.xml中的上下文根(Using the context-root from glassfish-web.xml in GlassFish 3)

问题 最近,我们切换到了Glassfish 3.1.2.2,并将多个Web应用程序打包为war文件。 有时,这些应用程序所需的上下文根不同于文件名。 回到使用Weblogic时,我们是通过在weblogic.xml中声明上下文根目录来实现的,就像这样 <context-root>path/to/our/App</context-root> 我们注意到,glassfish-web.xml中存在相同的标记。 但是无论我们在此处定义什么,服务器始终将文件名确定为上下文根。 现在,我们在asadmin实用程序中找到了--contextroot选项,该选项使我们可以在部署时覆盖文件名,但我们希望直接在归​​档文件本身中进行定义,以便最终将部署该文件的人都不会需要知道所需的contex-root。 有什么办法可以做到这一点? 回答1 通常,这应该与glassfish-web.xml如下所示: <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd"> <glassfish-web-app> <context-root>/path

2021-04-06 17:58:06    分类:技术分享    glassfish   war   asadmin   contextroot

Using the context-root from glassfish-web.xml in GlassFish 3

We recently switched to Glassfish 3.1.2.2 and have several Web-Applications packaged as war files. At times the desired context-root for these applications differs from the filename. Back when we used Weblogic we achieved this by declaring the context-root in the weblogic.xml like this <context-root>path/to/our/App</context-root> We noticed that the same Tag exists in the glassfish-web.xml. But no matter what we define there, the server always determines the filename as the context-root. Now we find the option --contextroot in the asadmin utility that would allow us to overwrite the filename

2021-03-31 16:45:22    分类:问答    glassfish   war   asadmin   contextroot

如何在Eclipse中更改动态Web项目的上下文根?(How to change context root of a dynamic web project in Eclipse?)

问题 我在Eclipse中开发了一个动态Web项目。 我可以使用以下URL通过浏览器访问该应用: http://localhost:8080/MyDynamicWebApp 我想将访问URL更改为: http://localhost:8080/app 为此,我从项目“属性| Web项目设置|上下文根”更改了上下文根。 但是,Web应用程序仍具有相同的访问URL。 我已经在Tomcat上重新部署了该应用程序并重新启动了Tomcat,但是访问URL与之前的相同。 我发现WAR文件没有附加server.xml文件。 在没有附加server.xml文件的情况下,Tomcat如何确定我的Web应用程序的上下文根目录是/MyDynamicWebApp并允许我通过此上下文根URL访问该应用程序? 回答1 我敢肯定你现在已经前进了,但是我还是想回答。 其中一些答案提供了解决方法。 实际必须发生的事情是您清理并重新发布项目以“激活”新URI。 可以通过右键单击服务器(在“服务器”视图中)并选择“清理”来完成。 然后,您启动(或重新启动它)。 这里的大多数其他答案都建议您做一些实际上可以完成此任务的事情。 更改的文件是workspace/.metadata/.plugins/org.eclipse.wst.server.core/publish/publish.dat除非您的工作空间中有多个服务器

2021-03-29 01:44:16    分类:技术分享    eclipse   jakarta-ee   applicationcontext   contextroot

How to change context root of a dynamic web project in Eclipse?

I developed a dynamic web project in Eclipse. I can access the app through my browser using the following URL: http://localhost:8080/MyDynamicWebApp I want to change the access URL to: http://localhost:8080/app To do so, I changed the context root from the project "Properties | Web Project Settings | Context Root". However, the web app still has the same access URL. I have re-deployed the application on Tomcat and re-started the Tomcat, but the access URL is the same as earlier. I found that there was no server.xml file attached with the WAR file. Without the server.xml file attached, how is

2021-03-21 12:28:11    分类:问答    eclipse   jakarta-ee   applicationcontext   contextroot