Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Arnost Sobota - 05 Nov 2006 11:34 GMT
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
Simon Brooke - 05 Nov 2006 15:22 GMT
> 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.

Signature

simon@jasmine.org.uk (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]

Arne Vajhøj - 05 Nov 2006 15:42 GMT
> 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
Mark Space - 05 Nov 2006 18:58 GMT
> Hello World,
>
[quoted text clipped - 9 lines]
>
> 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.
amanda - 05 Nov 2006 20:21 GMT
> > Hello World,
> >
[quoted text clipped - 20 lines]
> libraries, etc. can do for you.  They are complementary technologies
> with Servlets, really.

I agree with you.
Manish Pandit - 06 Nov 2006 18:23 GMT
> Hello World,
>
[quoted text clipped - 9 lines]
>
> 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
richardsosborn@gmail.com - 07 Nov 2006 17:36 GMT
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.

> > Hello World,
> >
[quoted text clipped - 27 lines]
> -cheers,
> Manish


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.