Originally posted by Bear Bibeault:
No. All code having to do with SQL should be as far removed from the UI as possible, and not be anywhere near a JSP page.
Originally posted by Bear Bibeault:
Your page controller should call methods in your model classes to obtain the results. As you read in the other topics, the results should not be still ensconced in the JDBC resultset, but copied to other collection types.
Yes. but it also delegates to the model layer to perform operations on the model. All JDBC should be ensconced in the model layer.Originally posted by Blaine Swensen:
The servlet (Page/Task Controller) operates on the request and gathers the necessary data to output
The servlet usually sets scoped variables into request or session scope via the setAttribute() methods.The servlet sends that data (via unknown means-Still Learning) to jsp
Not quite. The JSP is executed to create the plain HTML response that is sent to the browser. JSP is a server-side concept.Server sends JSP response with the data the servlet sent to it.
Beans are an important Java concept that you need to have under your belt before diving off into JSP and servlets. Essentially a bean is a Java class that follows certain conventions that make them easy to deal with in reflective fashion. Primarily they contain properties that can be set or accessed using methods whose signature follow the JavaBean standard.but I am not familiar with what a java bean is, how it differs from a servlet
Good start!I have, however understood that I should copy the resultset so I may close the connection. I use an ArrayList of Maps for rows & columns.
Danger, 10,000 volts, very electic .... tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|