General Java Questions I
other anytime soon.
Joe
Q: My question is : is JSP as powerful as servlet?
I heard that JSP will eventually compile into servlet class file.
One thing can be done by servlet, can it be done by JSP too? In terms of http.
Answer: Everything a servlet does can be done in JSP and vice versa. Good
programming practice (you will see some articles over the last year in JavaPro)
dictates to combine servlets and JSP in any significant web application.
JSP should be mainly HTML (or XML, or WML or whateverML) with little Java inside.
Servlets should be Java with few or not at all lines like this:
out.println( "" );
out.printlb( "" );
This creates a more or less clean separation between presentation (JSP) and
business logic (servlet).
Java beans also have a role in this. I strongly recommend the JavaPro articles or
whatever text on the MVC model you can find.
eugene aresteanu
Q: I m just starting to learn Java on my own. Should I first learn AWT or should I
jump directly into the Swing of things?
Answer: Will you be wanting to code applets that are easy for anyone to run in their
browser? If so, you ll probably have to go with the AWT for now.
The AWT isn t so bad, but Swing makes a lot of things much easier, so if you want to
ship native code applications or suchlike then I d go with Swing. I still use the AWT,
but I find myself having to code a lot of standard things myself.
Mark
Swing make things easier but IE doesn t support it.
Q: I can t manipulate inodes on my linux box ... in fact I can t even get real info
about a file! Java is a bad hack and is for kids who aren t sharp enough to do C++.
Answer: Think of Java in the same terms as COBOL and VB, and you ve got the right
idea. Start thinking of it as a replacement for C++ and you re on the wrong track.
Don t expect this portable language to be a tool for low level coding with hooks into
the OS and hardware internals. It just wasn t designed for that. It s an excellent
*applications* language, not a *systems* language like C or assembler.
On the other hand, if any pesky Java programmers tell you that C++ is dead and that
Java can do everything C++ does, and more, you may howl with laugher and tell
them to eat their JVM.
David Ehrens
Q: I wonder what happened if I remove "deprecations" from my code, for example
size() and put getSize().
Don t the programs work any more on older browsers (e.g. IE3)?
Answer: Check the docs to see whether they say "Since 1.1", "Since 1.2" or "Since
1.3" if so, they will not work in the oldest MS VM.
file:///F|/a_jsite/350_tips/general_java I.htm (3 of 33) [2001 07 08 11:24:51]
footer
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved