The time for teaching is very limited: I now often have only 30 hours to take students from »no programming experience whatsoever« to »first steps with Swing« including exercises done in the classroom. When teaching Java with Swing, I need the JDK as the one single dependency: javac Main.java, java Main, and that's it.
I have the impression that teaching servlets is more
time-consuming, because the toolchain is longer and the configuration and application of more tools needs to be done and explained.
I don't see it myself, that teaching servlets would be more time-consuming than teaching Swing (or JavaFX for that matter). In fact, I think that teaching servlets affords an excellent opportunity to introduce students to important real-world stuff:
1) using libraries;
2) the ubiquity and importance of app servers;
3) HTTP request-response handling;
4) how servlets underlie many Java frameworks, with a brief intro to how the frameworks build upon the servlet API.
Can this be done in 30 hours, especially for programming neophytes? Maybe not. But I'm not convinced you can accomplish more by doing "first steps with Swing". The issue here may be that 30 hours isn't enough...but I myself have a gut feeling that you'd do better with a servlet approach.
For a barebones first approach, I think we can over-emphasize the importance of GUIs (web or desktop) as being what beginners expect to see, or what they feel comfortable with. I'm probably dating myself here, but back in the '70's when I learned programming with FORTRAN 66 and FORTRAN 77, I (and most of my peers) grokked program output to printer or tape, and program input from similar sources. It's also not difficult to relate a console input prompt to an HTML text input box - students understand that what matters is what you do with the input, not so much how you got it.
Let me put something else out there. 30 hours is a short semester if we suppose three 1-hour classes per week. Is it even realistic to try and introduce any kind of GUI (Swing, JavaFX, servlets with simple HTML etc) in 30 hours? Perhaps console output is all you should shoot for.
AHS