I am new to Java / Servlets / Tomcat etc., but have a good understanding of web applications since my days as a CGI / PHP developer.
I have a JSP index.jsp that represents a table from a database.
I have Results.class , which is a normal Java class (and not a servlet) that queries the database and returns a string from a method: public static String displayAllResults()
The returned row is an html table.
So in my index.jsp there is a line that says something like:
String table = Result.displayAllResults();
And then the table is displayed as I hoped - all is well!
My question is this: is there any advantage / disadvantage of using regular Java classes instead of Java servlets in this way, or should I port all my classes to servlets to add functionality?
source
share