在IntelliJ Idea中自动设置应用程序上下文 [英] Automatically set application context in IntelliJ Idea

查看:1642
本文介绍了在IntelliJ Idea中自动设置应用程序上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在Eclipse中开发Web应用程序,最近决定对IntelliJ Idea进行尝试.我的Web服务器大约有15个工件,在Eclipse中,它们是根据名称自动分配给应用程序上下文的.现在,在Idea中将其全部默认为"/",这显然是不正确的.是否可以将其设置为根据工件名称自动定义应用程序上下文,还是必须手动输入所有内容?抱歉,如果这是一个新手问题,我尝试对其进行谷歌搜索并在各种设置中搜索创意",但找不到答案.

I've been developing web applications in Eclipse and recently decided to give a shot to IntelliJ Idea. My webserver has about 15 artifacts and in Eclipse they were automatically assigned application context based on their names. Now in Idea it defaults them all to "/" which is obviously incorrect. Can I somehow set it to automatically define application context based on artifact name or do I have to enter them all manually? Sorry if that's a newbie question, I tried googling it and searching inside various settings for Idea but couldn't find the answer.

推荐答案

这取决于您使用的Web服务器.对于Tomcat,您必须手动设置已部署工件的上下文路径(在Tomcat服务器的部署"选项卡中),或者配置Web服务器的特定设置,例如Tomcat的server.xml(

This depends on the web server you're using. For Tomcat, you have to either manually set the context path of the deployed artifacts (in Deployment tab of Tomcat Server) or configure your web server's specific settings, like server.xml for Tomcat (see an example here)

对于其他服务器,例如JBoss,每个工件都使用名为该工件本身的Web上下文进行部署.

For other servers, like JBoss for example, each artifact is deployed with web context named as the artifact itself.

这篇关于在IntelliJ Idea中自动设置应用程序上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆