简体   繁体   中英

Is there any downfall of using JQuery with Servlets without JSPs?

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.

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 JSTL 1 .

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM