Spring MVC in HTML pages without JSP

Asked

Viewed 856 times

3

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

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

3 - Bootstrap CSS framework works on JSP pages?

1 answer

3


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

It is not possible to use pure HTML, since the output generated with controller data must be dynamic.

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

It is possible to get rid of JSP’s with Templates processing technologies such as Freemarker or Velocity. The very Spring documentation teaches how to do 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 point of view of performance and flexibility.

On the other hand, a JSP is more than enough to generate an HTML 5 output without intrusion of Java code. In most cases, just use the Taglibs suitable for printing values and making repeat loops without writing scriptlets.

3 - Bootstrap CSS framework works on JSP pages?

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

Of course this can be a problem in frameworks Component-based like Struts or JSF generating the entire screen for you, taking your control over the code structure.

  • 1

    Thank you for answering me.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.