Spring MVC in HTML pages without JSP

3

1 - Is it possible to use data sent by Spring Controllers in HTML pages (using HTML5 tags), not to use JSP?

2 - If it is not possible, how can I make JSP pages with Spring MVC with minimal Java code intrusion on pages?

3 - Does the Bootstrap CSS framework work on JSP pages?

    
asked by anonymous 10.07.2014 / 01:22

1 answer

3
  

1 - Is it possible to use data sent by Spring Controllers in HTML pages (using HTML5 tags), not to use JSP?

You can not use pure HTML, since the output generated with controller data must be dynamic.

  

2 - If it is not possible, how can I make JSP pages with Spring MVC with minimal Java code intrusion on pages?

You can get rid of JSPs with template rendering technologies like FreeMarker or Velocity . The Spring documentation teaches you how to do the integration with these two frameworks.

Many developers (like me) think that a template language is much better suited to represent HTML output than JPS's. In addition, JSP's are very debatable from the standpoint of performance and flexibility.

On the other hand, a JSP is more than enough to generate an output in HTML 5 without Java code intrusion. In most cases, just use the appropriate taglibs to print values and loop repetition without writing scriptlets .

  

3 - Does the Bootstrap CSS framework work on JSP pages?

Any technology that generates valid HTML output can work with Bootstrap.

Of course this can be a problem in component-based frameworks such as Struts or JSF that generate the entire screen for you, taking your control over the code structure.

    
10.07.2014 / 17:26