1

I am going on redesigning the server-side of one of my applications. Currently, my setup is JQuery, HTML,CSS for the front end, and Java Servlets for the server side (accessed using AJAX).

Most examples online for Servlets use JSPs. I am wondering if there is any certain advantage of using JSPs with the standard front end stack im using.

*It also might be the case that Servlets might not even be the best way to go for my application (basic db reading/writing and generating client code on server side). I've also been looking at Rails but I'm not sure if the switch is necessary.

Im very new to full stack design, so just looking for some insight.

TheUberUser
  • 121
  • 1
  • 8

2 Answers2

3

JSP is a view technology that helps you to add dynamic content to your web pages through code that is executed on server like Expression Language and usage of taglibs like JSTL1.

If you're going to use Servlets only as controllers to support RESTful services, then there's no need for you to use JSP at all. Even more, you won't directly need to work with Servlets but with a JAX-RS framework implementation like Jersey.


1 You could also use scriptlets in JSP but it's not a good idea at all. See here: How to avoid Java code in JSP files?

Community
  • 1
  • 1
Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
0

JSPs compile down to servlets, so functionally they do the same thing.

The only possible benefit you could derive from JSP is the support of additional web framework libraries such as taglibs. If you don't need this, don't worry about it.

mcfinnigan
  • 11,442
  • 35
  • 28