This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Why to use JSP?
As per my knowledge, it is used to separate budiness logic from the view part. JSP is mainly for the front end.
But, on compilation, JSP will be converted into a servlet. Servlet is a server side component. So, what ever is written in JSP is converted into Servlet and executed at the server side......if this is true, how can we say, JSP is mainly for front end UI development?
I am confused here. Can anyone please help me why JSP is mainly used?
1) Don't use scriptlets -- put no Java code in a JSP
2) Keep the JSPs as simple as possible -- hide any complexity in the controllers and beans, not on the page
3) Hide the JSPs under the WEB-INF folder to prevent direct access without their controllers