[New to Java] Servlets vs JSP, Struts, etc.

A

Arnost Sobota

Hello World,

I intend to take up Java for Website development (so far I'm
ASP/VBScript, quite another world). First I have to learn Java.
My question is: is it realistic/advisable to write Web applications
directly in plain Java (ie: Servlets) or do you recommend using what I
understand to be higher-level languages (JSP, Struts, Tea, etc.)

I'm aware that the scope of my question is wide, but at this point I
have very little knowledge of the question so I'll greatly appreciate
your comments and guidance.

Arnost
 
S

Simon Brooke

Arnost Sobota said:
I intend to take up Java for Website development (so far I'm
ASP/VBScript, quite another world). First I have to learn Java.
My question is: is it realistic/advisable to write Web applications
directly in plain Java (ie: Servlets) or do you recommend using what I
understand to be higher-level languages (JSP, Struts, Tea, etc.)

It's almost certainly not a good idea now to 'roll your own' all the way
from the javax.servlet.http package upwards, since there are a lot of good
toolkits around which do an awful lot of the grunt-work for you allowing
you to develop more error-free code more easily.

I was for a long time of the opinion the it was better to write servlets
than use JSP, because I said that JSP mixed logic with presentation and
that's a bad thing. And then I read a book by a well respected author who
said it's better to use JSP than servlets, because servlets mixed logic
with presentation...

I think it really doesn't matter which approach you take, provided you can
clearly separate out logic issues and presentation issues. But if I was
starting again today I'd start with Struts.

--
(e-mail address removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/

;; 99% of browsers can't run ActiveX controls. Unfortunately
;; 99% of users are using the 1% of browsers that can...
[seen on /. 08:04:02]
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Arnost said:
I intend to take up Java for Website development (so far I'm
ASP/VBScript, quite another world). First I have to learn Java.
My question is: is it realistic/advisable to write Web applications
directly in plain Java (ie: Servlets) or do you recommend using what I
understand to be higher-level languages (JSP, Struts, Tea, etc.)

I would recommend JSP pages, controller servlet, servlets for special
purposes, Java classes.

It could be Struts.

It could be JSF.

But it could also be your own.

Arne
 
M

Mark Space

Arnost said:
Hello World,

I intend to take up Java for Website development (so far I'm
ASP/VBScript, quite another world). First I have to learn Java.
My question is: is it realistic/advisable to write Web applications
directly in plain Java (ie: Servlets) or do you recommend using what I
understand to be higher-level languages (JSP, Struts, Tea, etc.)

I'm aware that the scope of my question is wide, but at this point I
have very little knowledge of the question so I'll greatly appreciate
your comments and guidance.

Arnost

Hey Arnost,

I'm a bit newbie also. My answer would be that you need to learn both.

I think you should understand what goes on "under the hood" and learn
how to write everything in Java. But in a real production environment,
it's too much work. First learn Java. Then do a couple of basic web
apps in all Java/Servlets. Then see what JSP, Struts, EL, JSTL, tag
libraries, etc. can do for you. They are complementary technologies
with Servlets, really.
 
A

amanda

Mark said:
Hey Arnost,

I'm a bit newbie also. My answer would be that you need to learn both.

I think you should understand what goes on "under the hood" and learn
how to write everything in Java. But in a real production environment,
it's too much work. First learn Java. Then do a couple of basic web
apps in all Java/Servlets. Then see what JSP, Struts, EL, JSTL, tag
libraries, etc. can do for you. They are complementary technologies
with Servlets, really.

I agree with you.
 
M

Manish Pandit

Arnost said:
Hello World,

I intend to take up Java for Website development (so far I'm
ASP/VBScript, quite another world). First I have to learn Java.
My question is: is it realistic/advisable to write Web applications
directly in plain Java (ie: Servlets) or do you recommend using what I
understand to be higher-level languages (JSP, Struts, Tea, etc.)

I'm aware that the scope of my question is wide, but at this point I
have very little knowledge of the question so I'll greatly appreciate
your comments and guidance.

Arnost

Hi,

Given the open-ness, acceptance and the rich set of tools/methodologies
available for Java Technologies, it is generally recommended to use the
same. Ramping up should not be hard, as long as you are used to any
Object Oriented Programming. JSPs end up being servlets, but give a
cleaner view and separation of Java code vs. View specific code. Struts
is not a language but a framework, which provides an MVC architecture
for a web-application. I'd say start with googling 'java for ASP
developers' or something of similar nature, to get your feet wet on
what to expect. Once you are comfortable with the syntax, start with
basic programs and try to use the common libraries (collections, jdbc,
io, net..). Once you're there, start learning about the JSP/Servlet
Model, followed by Struts and how that will fit your application.

-cheers,
Manish
 
R

richardsosborn

There's a number of articles on the Sun site about learning J2EE.
There are also a number of ebooks, comparing the technologies.
Each one is good for different things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top