how to Change glassfish application url

孤人 提交于 2019-12-22 00:29:13

问题


My current glassfish application can be accessed using this url

localhost:9595/apex

I want to change it to

localhost:9595/pls/apex

what i need change in this case.


回答1:


You can change the context-root for your application by adding a context-root in glassfish-web.xml (If you don't have this file in your project, create it in the WEB-INF folder) like this:

<?xml version="1.0" encoding="UTF-8"?>
<!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 error-url="">
    <context-root>/pls/apex</context-root>
</glassfish-web-app>

Update: If this doesn't work you can try to use a sun-web.xml like it is described in this question.




回答2:


Alternatively to using the descriptior glassfish-web.xml you can explicitly definde the context root at deploy time by using the --contextroot switch of asadmin:

asadmin deploy --contextroot="/pls/apex" apex.war

or fill the appropriate context root field in the admin console.



来源:https://stackoverflow.com/questions/16231286/how-to-change-glassfish-application-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!