AWG Blogs

Saturday, March 8, 2014

Deploy Small Java App to OpenShift

This is the code deploy method. For deploying an existing WAR there are other methods will plenty of how-tos on the web.

- Create a JBoss Application Server 7 app preferably from the rhc client.
- Create a file TestBean.java under src\main\java\action and paste in the sample TestBean class from this tutorial on JSP actions: http://www.tutorialspoint.com/jsp/jsp_actions.htm
- Create a folder "classes" under src\main\webapp\WEB-INF (although I'm not sure this step is necessary)
- Create a file "main.jsp" under src\main\webapp and paste in the corresponding sample code from the above referenced tutorial
- Git add, commit, and push it up.
- Load it in the browser e.g. http://jbossas-<your namespace>.rhcloud.com/main.jsp

see also: http://awgjournal.blogspot.com/2014/03/tomcat-openshift-projects.html