Integration of rails and Java EE
The following is an introduction to the integration of rails and Java EE on the GlassFish v3. GlassFish V3 is the next version of GlassFish V2, focusing on modularity and making it possible to run containers and modules that are not Java EE.
Here is a detailed description of the details:
1. Using JRuby 1.1 (Install rails), follow the steps below to create a rails application "railsee3":
~/testbed/jruby-1.1/samples/rails. /.. /bin/jruby-s Rails Railsee3
Create
Create App/controllers
Create App/helpers
Create App/models
. . .
Create Log/production.log
Create Log/development.log
Create Log/test.log
2. Add servlet description (servlet descriptors)
1. Create a new Folder "Web-inf", create a new file under this folder "Web.xml"
<! DOCTYPE Web-app Public
"-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>server. Helloservlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>