Monday April 14, 2008
GlassFish @ Silicon Valley Web Developer JUG - Tomorrow (Apr 15, 2008)
![]() |
Project GlassFish: On a mission
to please Developers is the topic of talk at Silicon
Valley Web Developer JUG tomorrow (Apr 15, 2008). Hear all about GlassFish v2, it's exciting set of features such as Metro, High Availability, Clustering, Grizzly, Scripting, SIP container, Tools integration (such as NetBeans and Eclipse) and many others that together deliver a compact and high-fidelity Java EE Application server. You'll also learn about GlassFish v3 and how, through modularization and embedability, it enables support for non-Java EE containers such as Rails, Phobos and others. |
![]() |
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
| Rails and Java EE integration - Native Rails on GlassFish v3
The last part of this tri-series blog (Part
1, Part
2) will show how a Rails application can be deployed on
GlassFish - without the need of Goldspike,
Warbler
or any other gem or plugin. Yes, that's a native Rails app deployment
on GlassFish v3.
GlassFish
v3 is next version of GlassFish v2 and the focus is
modularization, enablement of non-Java EE containers and modularity - download
b09.
Rails
powered by GlassFish provides all the details on why
GlassFish provides an industry-grade and functionally-rich Application
Server.
Now detailed steps:
|
~/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 |
| <!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> |
| <?xml
version="1.0" encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software /appserver/dtds/sun-web-app_2_5-0.dtd"> <sun-web-app error-url=""> <context-root>/servlet</context-root> <class-loader delegate="true"/> </sun-web-app> |
| JRUBY_HOME="/Users/arungupta/testbed/jruby-1.1" |
| ~/testbed/jruby-1.1/samples/rails
>~/testbed/glassfish/v3/p2b9/glassfish/bin/asadmin
deploy --force=true railsee3 railsee3 deployed successfully Command deploy executed successfully. |


| ~/testbed/jruby-1.1/samples/rails/railsee3
>../../../bin/jruby
script/generate controller home index JRuby limited openssl loaded. gem install jruby-openssl for full support. http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL exists app/controllers/ exists app/helpers/ create app/views/home exists test/functional/ create app/controllers/home_controller.rb create test/functional/home_controller_test.rb create app/helpers/home_helper.rb create app/views/home/index.html.erb |
| class
HomeController < ApplicationController include Java def index url = java.net.URL.new("http://localhost:8080/servlet/hello"); conn = url.open_connection; reader = java.io.BufferedReader.new(java.io.InputStreamReader.new(conn.get_input_stream)); @servlet_output = ""; input_line = reader.read_line; while input_line != nil @servlet_output << input_line; input_line = reader.read_line; end reader.close; end end |
| <h1>Home#index</h1> <p>Find me in app/views/home/index.html.erb</p> <%= @servlet_output %> |

Posted by Arun Gupta in web2.0 | Comments[15]
|
|
|
|
|
Today's Page Hits: 3935
Total # blog entries: 994