Pragmatach

The pragmatic web development framework

Skip to the Pragmatach Site

What is it?

Pragmatach is a simple J2EE framework intended to provide server-side support for B2C web applications

The Need

Pragmatach was written to address real-world needs that are important to B2C site developers

Simple

  • Pragmatach is based on the MVC paradigm
  • Applications consist of simple annotated controller classes

Auto generated

10 minutes or less to get a skeleton project started

Pragmatach provides a maven archetype which generates a fully functional skeleton

Maintainable

Applications need to be maintained

  • Maintainable with commodity developer skills
  • Server-side code is Java
  • No need to find Groovy, GSP, or Scala programmers
  • Sites are built and deployed via Maven

Light

Server side support for web applications should be simple

  • Full-featured web frameworks are not necessary to support simple B2C sites
  • Pragmatach is just a couple small jar files that implement a servlet

JSON

Web programmers prefer to communicate via JSON to their servers

Pragmatach implements simple GET and POST of JSON and XML to Controllers

Real world - friendly

Running applications need to be operated and debugged at runtime

Pragamatach provides a secure, web-based console to allow runtime operation and debugging of applications

Built-in manageability via JMX

Extensible

Needs vary from application to application

Pragamatach provides a modular API for plugging in new functionality

Server-only

Pragmatach imposes no client-side restrictions

  • Use the JS & CSS frameworks you need
  • Multiple server-side templating languages supported

Example HTML Controller


package com.teverett.com.pragmatach.exampleproject;

@Controller(name="indexController")
@View(view = "index.html")
public class IndexController extends FreemarkerController {
 
   private String message = "Hello World";

   @Route(uri = "/")
   public Response render() throws PragmatachException {
      return super.render();
   }
}					

Example HTML Template


<head>
   <title>exampleproject<title>
</head>
<body>
<h1>exampleproject</h1>
    ${indexController.message}
</body>				
				

Example JSON Controller


@Controller(name="index")
public class AcceptPostController extends JSONController {
   private String message;

   @Route(uri = "/acceptpost", method = HttpMethod.post)
   public Response acceptJSONpost() throws PragmatachException {
         return super.render();
      } catch (final Exception e) {
         throw new PragmatachException("Exception in showFeed", e);
      }
   }
}				
				

Trying it: step 1

Build a skeleton using the Maven Archetype

Script

Trying it: step 2

run it


mvn clean package jetty:run
					

Thanks

http://www.pragmatach.com