Paul Clapham wrote:Hi Nathaniel, welcome to the Ranch!
Your question is a bit unclear. You say that your AddCustomers.jsp doesn't show the table output. I don't know whether that means "it shows the headings but no customers" or "it shows only the headings".
And likewise your servlet with "out.println" in it. It's clear that it doesn't show any customers, but it does show the headings. And you seem to think that's okay. But no, that's not the correct way to do it. Technically it's legal but it's really in bad taste since it's been an obsolete feature for nearly 20 years now.
So I'm guessing your first version shows you nothing, including no heading. I think that's because of this line of code:
Look closely and compare with the line below.
Nathaniel Broome wrote:Also, are you saying that I need insert the import statement in to theAddCustomers.jsp? I'm just trying to make sure I understand.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Paul Clapham wrote:
Now I'm the one being unclear. I'm saying you need to check the spelling of that import statement. Did you really put "ailrines" into the package name of the Customers class while putting "airlines" into the package name of a different class?
Tim Holloway wrote:The use of "out.println()" is simply indicative that you are producing your output HTML by brute programming force. The preferred way these days is to use a JSP as View Template and have the servlet forward to that JSP with the results of its computations. Since the JSP more closely resembles the actual HTML, it's a lot easier to maintain, where out.println() has a lot of java crud code surrounding the actual output HTML.
The opposite offence is to use JSPs with scriptlets, and that, too is discouraged.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
Nathaniel Broome wrote:I feel so defeated. I have been working on this literally since time began.
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|