HOME     PRODUCTS     DOCUMENTATION     EXAMPLES     NEWS     COMPANY     CONTACT 
Why object-oriented template processing? Click here for more information.
Try out JPlates 3.0.2. Click here for more information about your free evaluation.

FAQ Table of Contents


back to top

Is JPlates standards based?

Absolutely. JPlates is committed to supporting and interoperating with all relevant industry standards. JPlates supports Java and all Java core APIs. JPlates also supports Java Servlets and the J2EE platform. JPlates even works with JSP, and supports XML and all Java APIs for working with XML.

In addition, JPlates is designed to work with popular open-source tools such as Ant, JUnit, Tomcat, JBoss, Xalan, Xerces, etc.

back to top

What platforms does JPlates run on?

JPlates is written entirely in Java and runs on any platform that supports JDK 1.3 or above. JPlates Servlet support is compatible with the Java Servlet Specification, version 2.2 or above. JPlates has no known operating system or other platform dependencies.

back to top

What kind of support is available for JPlates?

JPlates is a fully supported commercial product. Our support team is available to answer questions and solve problems, and our professional services team can help when necessary. Multi-tiered support is licensed separately from the software license. Email support is also available for evaluation customers.

back to top

Does JPlates have a money-back guarantee?

Yes. JPlates comes with a one year 100% money-back guarantee on development licenses. If for any reason JPlates does not live up to your expectations, you can let us know and we will send you a complete refund.

back to top

Are there any runtime license or deployment costs?

The JPlates runtime is licensed according to the number of template requests that can be processed concurrently. For simple standalone use, the development license includes the runtime license for single-user template processing. See the pricing page for detailed information about server runtime licensing.

back to top

Is there any discount pricing?

Yes. Both educational and volume discounts are available, and the trial version is available for free. See the product pricing page for details.

back to top

Is the source code for JPlates available?

The JPlates core source code is not publicly available, but all source code is available for examples and web application support. Full source code licensing is available by special arrangement with JPlates Inc.

back to top

How does JPlates work?

JPlates is a fully object-oriented template processing language based on classes, objects, methods, encapsulated state, inheritance, etc., just like Java. JPlates works by creating classes that operate just like Java classes in the JVM. You can use JPlates classes together with Java classes to build even the biggest applications without losing control.

JPlates methods are executable templates, and they're also object-oriented methods that have access to encapsulated fields, other methods, etc. The literal parts of your methods are executed by copying them to the template output. The control-flow statements act like similar control-flow statements in Java. The complete object-oriented programming and powerful template processing features work together to produce template-based applications that you design and implement like Java applications.

back to top

How do you use multiple objects and methods in JPlates?

Each JPlates request starts with a call to a top-level template method of some specified JPlates object. The template method can do everything all by itself, or it can call other methods in the same or other objects to split up the work.

Since JPlates objects can encapsulate state just like Java objects, it's easy to create other JPlates objects, initialize them, and use them together by calling methods just like you would do with Java objects in a Swing application or any other Java application.

Every JPlates template method can use the same template processing features, so every JPlates method can contribute to the output of a template request, just by being called. Since JPlates is a fully object-oriented language, you can inherit or override methods in subclasses and take advantage of all object-oriented programming techniques and design patterns.

back to top

How are JPlates statements different from JSP scriptlets?

JSP scriptlets are just embedded fragments of Java. They have no meaning until the JSP compiler assembles all of the Java fragments and literal fragments together into Java source and submits it to a Java compiler. JSP doesn't actually define any flow-of-control on its own, but relies on these embedded fragments for everything other than basic string substitution.

JPlates statements are an integral part of JPlates. Many JPlates statements use syntax for expressions and types that is based on Java syntax, in order to make it easy to learn. But everything in a JPlates statement is fully defined by and supported by JPlates. The difference is that JPlates statements give you control over complexity rather than adding to it.

back to top

Is the HTML part of a JPlates method defined by JPlates?

No. JPlates has no specific knowledge of HTML, and doesn't have to be used for web-applications. Everything in a JPlates template method that's not a statement or substitution or comment is treated as literal text to be copied to the template output.

back to top

How do I use Java objects from JPlates?

Your JPlates classes and methods have totally seamless access to all existing Java classes. You can use any Java type in a JPlates declaration, create new instances, call methods, handle exceptions, etc.

back to top

How do I use JPlates objects from Java?

JPlates classes are first compiled into Java, and then into JVM class files. Consequently, JPlates objects can be used from Java just like other Java objects.

back to top

How do I debug JPlates classes?

When the JPlates compiler translates JPlates sources into Java, it makes sure that the line numbers of the generated Java match the line numbers of the original JPlates source code. As a result, stack-traces and error-messages always refer to the correct line number, even if the messages refer to the generated Java sources.

back to top

Does JPlates support internationalization?

Absolutely. JPlates provides support for internationalization based on Java ResourceBundles, and makes it possible to refine the translation of resource-keys based both on class inheritance relationships and on component containment relationships. This provides unmatched expressive power and significantly reduces the amount of special-case code needed to internationalize an object-oriented template application.

back to top

Does JPlates support inner classes?

Yes. JPlates provides complete support for inner classes, except that inner classes may not be defined inside of template methods.

back to top

Does JPlates support static methods and fields?

Yes. JPlates template methods can be specified with all of the normal Java modifiers, except for abstract and native.

back to top

Does JPlates support javadoc?

Yes. You can document your classes, fields, and methods with javadoc comments the same way as you do in Java.

back to top

Does JPlates provide control over output formatting?

Yes. JPlates gives you complete control over how lines of generated output are indented and formatted, without sacrificing readable formatting of your JPlates classes. JPlates has a very simple whitespace rule that handles most indenting and formatting issues in a very natural way. JPlates also provides powerful features that provide complete formatting control that are designed to work with well-designed object-oriented templates.

back to top

Does JPlates provide a facility for defining custom tags?

No. JPlates 3.0 does not provide support for custom tags or macros, but rather promotes the use of normal object-oriented programming techniques for abstraction and encapsulation.

JPlates statements take the place of JSTL and other control-flow tag libraries, and JPlates provides support classes for HTML forms processing that take the place of the Struts tag libraries. Our experience shows that normal object-oriented approaches are more productive and easier to use correctly than custom tags.

back to top

How fast is the JPlates compiler?

The JPlates compiler is hundreds of times faster than most JSP compilers, and is easy to integrate into your build environment. On typical hardware, the JPlates compiler can translate 100 typical JPlates classes in just a few seconds.

The JPlates compiler supports incremental compilation too, so you don't have to rebuild everything every time.

back to top

How can I unit test a simple JPlate class?

For simple JPlate classes that don't require complex initialization, you can use the main() method in JPlateApplication to test your JPlates classes. The command is:

java [options] com.jplates.JPlateApplication full-jplates-class-name

For other cases, follow the guidelines in the User Guide section on using JPlates from a Java application.

back to top

Can I get more debug information for errors?

JPlates will output additional useful debugging information for translation errors and runtime errors if you pass
-DJPlates.DEBUG=true
to the Java VM. In a servlet application, you can configure the JPlateServlet using an init-parameter, as follows:
  <servlet>
    <servlet-name>JPlateServlet</servlet-name>
    <servlet-class>com.jplates.servlet.JPlateServlet</servlet-class>
    <init-param>
      <param-name>JPlates.DEBUG</param-name>
      <param-value>true</param-value>
    </init-param>
  </servlet>
        

back to top

How do I handle exceptions and perform "finally" processing?

JPlates provides the same kind of exception handling features as Java, allowing you to handle exceptions thrown in Java classes or JPlates classes, and to perform "finally" processing.

back to top

Does JPlates report compile-time errors?

Yes. JPlates checks the syntax, structure, and type-safety of your JPlates classes at compile time, both in the interpreter and compiler. Error messages indicate what kind of problem was found, and exactly where the problem is in your source code.

back to top

Does JPlates provide support for debugging runtime errors?

Compiled JPlates classes behave exactly like Java classes at runtime, so additional debugging support can be provided by any JVM debugger. The JPlates compiler generates code that preserves the line numbers from your JPlates source code, so that standard JVM stack traces indicate the right source files and line numbers.

back to top

Is JPlates integrated with any Java IDEs?

Not yet. Complete integrated support for developing JPlates applications in different IDE tools is coming soon.

back to top

How does JPlates work in a web application?

JPlates can be used in any kind of Java application, but special support is provided for web applications. JPlates provides a Servlet that dispatches HTTP requests to the appropriate JPlates classes, and relays the JPlates generated output back through the Servlet response.

JPlates takes advantage of all functionality provided by the Servlet container, such as session-failover.

JPlates provides several utility classes to make building web applications as easy as possible. JPlates also provides excellent support for working with Struts as an alternative to JSP.

back to top

Can I reload JPlates classes without restarting the server?

Yes. The JPlates servlet supports a development-time option that allows you re-deploy compiled JPlates classes and Java classes to the web-application without restarting the web-server or servlet container. There is even support for live reloading of Struts configuration files, properties files, etc. See the JPlates 3.0.2 Users Guide and Java-doc for more details.

back to top

Are JPlates classes compatible with JSP?

JPlates can work side by side with JSPs in the same web application, and JPlates components can even produce output that is included by JSPs. In addition, JPlates objects can be used from your JSPs, allowing you to use both tag-libraries and template objects at the same time. See the "JPlates with JSPs" example on the examples page for more details.

You can replace your JSPs with JPlates classes one at a time. If you plan to replace your JSPs with JPlates, don't forget to take advantage of all the object-oriented features in JPlates.

back to top

Does JPlates support the MVC and Model-2 design patterns?

MVC and Model-2 are object-oriented design patterns that work much better with JPlates than with any other template technology. JPlates can be used to implement MVC directly, or in conjunction with other tools, such as Struts, that provide additional support for these design patterns.

back to top

Does JPlates work with Struts?

Yes. Struts provides an excellent framework for dividing up the work of models, views, and controllers in web applications. Struts provides particular support for controller components, and JPlates is ideal for implementing all aspects of the view, as well as the non-model rendering objects manipulated by the view.

JPlates doesn't depend on Struts in any way, and can be used to implement web applications on its own. Struts provides some very useful functionality, though, that complements JPlates nicely.

When you use JPlates with Struts, the only parts of Struts you don't use are the JSP tag libraries that Struts provides for JSP users. JPlates provides comparable or superior functionality in all cases, though, so everything is even easier. JPlates provides support classes to for form-based input and working with Struts ActionForms. JPlates is compatible with Struts validation, all kinds of ActionForms, nested ActionForm structure, etc.

back to top

How can I forward to a JPlate class in a Struts application?

In your struts-config.xml file, use a JPlates-style URL instead of a JSP reference. For example:
    <action
          path="/myAction"
          type="mypackage.MyActionFormType"
          name="myActionFormInstanceName"
          validate="true"
          scope="request" >
      <forward name="success"
            path="/my.complete.package.MyJPlateClass.jplate"/>
    </action>
        
You can also include query-parameters in the URL, just as you would with a JSP reference.

back to top

How do I access a Struts ActionForm from a JPlates class?

You can access any object in the session-scope using the
Object getSessionAttribute(String name, Object defaultValue)
method defined in class JPlate. Similarly, you can use
Object getRequestAttribute(String name, Object defaultValue)
to access objects in the request-scope. For example:

   void useActionForm() {
     MyActionFormType actionForm = (MyActionFormType)
        getSessionAttribute("myActionFormInstanceName", null);
     ...
   }
        
You can also use the provided Struts-support classes to perform many tasks even easier. See the API documentation for details.

back to top

Can I use JSP tag-libraries and custom tags in JPlates?

No. JSP custom tags can only work with JSP. That's because they're more like extensions of the JSP compiler than like components of your application. You can use both JSP custom tags and JPlates in your JSPs though, allowing you to benefit both from your investment in custom tags and from the object-oriented features of JPlates.

JPlates provides support classes for working with Struts and with the servlet environment without custom tags. Using conventional object-oriented approaches, JPlates support for Struts and forms processing is easier to learn and use than JSP tag libraries.

back to top

Can JPlates objects be stored in the session?

You can store JPlates instances in the session to use across multiple requests. By encapsulating state, JPlates objects do a great job of integrating presentation state with presentation logic, which maintaining a clean separation of presentation logic from business logic.

back to top

Why does the JPlates jar file have to be deployed in the WEB-INF/lib directory?

The JPlates runtime needs to be able to find your JPlates classes and other resources in your web application. It does so using the web application's class-loader which is available only to class libraries deployed to the WEB-INF/lib directory of your web application.