Hi guys, how do you do,
This is my first
java topic so forgive me if I don't adhere to forum protocols.
I have been learning Java for some time now and have decided that server side Java is what I want to do.
I have made a few web apps for fun and have just started reading Head First
Servlets and
JSP where I've just read the mini MVC tutorial.
In a general sense what I see is:
HTTP request to servlet > servlet calls normal Java class for help > servlet then sends the info to a JSP > JSP puts the dynamic info in the right place and is returned to the browser.
It seems like an overly complicated process when I can achieve the same result by:
Http request to JSP > JSP imports normal Java class > JSP can call any method on that class(not just the servlet ones) > JSP puts the info in the right place and is returned to browser.
I know that the first way is better because there is no direct link to the servlet class as it's accessed via the web.xml file. Is that all though?
I like the second way better as I am able to call any method on the standard class rather than go through the doPost or doGet methods.
Please let me know which is better and why.
Thanks.