简体   繁体   English

将grails集成到我的Java EE应用程序中

[英]Integrate grails into my Java EE application

I have a simple Java EE application using Servlets and JSP. 我有一个使用Servlet和JSP的简单Java EE应用程序。

Now I want to develop new functionality using Grails within the same application not a new application. 现在,我想在同一应用程序而不是新应用程序中使用Grails开发新功能。 Can I add Grails to my existing application? 我可以将Grails添加到现有应用程序中吗?

You'll have more luck the other way round - create a new Grails application, put your existing servlets into src/java , then run grails install-templates and edit the template web.xml to add your <servlet> and <servlet-mapping> tags to that. 相反,您会遇到更多的运气-创建一个新的Grails应用程序,将现有的servlet放入src/java ,然后运行grails install-templates并编辑模板web.xml以添加您的<servlet><servlet-mapping>标签。 But note that Grails installs a number of filters that intercept all urls, and these may adversely affect your servlets. 但是请注意,Grails安装了许多拦截所有URL的过滤器,这些过滤器可能会对您的Servlet产生不利影响。 You'll have to try it and see what breaks... 您将不得不尝试一下,看看会发生什么...

It very well depends on the framework ur currently using. 这非常取决于您当前使用的框架。 I'd try with adding grails' lib subdirectory to the project classpath. 我尝试将grails的lib子目录添加到项目类路径中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM