Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Servlets and the fly likes Servlets vs Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets vs Struts" Watch "Servlets vs Struts" New topic

Servlets vs Struts

Aaron John
Ranch Hand

Joined: May 30, 2005
Posts: 74
As far as I can tell, these two are different approaches to web application programming. However I would like to know the main differences between them and which is preferable? Hope someone can answer my trivial question.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

No, they are not different approaches.

Struts is a framework built upon Servlet and JSP technologies.

Until you have a good understanding of Servlet technology under your belt, I recommend avoiding the use of frameworks.
[ July 12, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Sharad Agarwal
Ranch Hand

Joined: Sep 11, 2002
Posts: 167
The bottomline is this. If you have a "small application" and speed of development is of the essence, perhaps you are better off just using plain Servlets and JSPs. The moment it starts becoming something "large" and/or it has a lot of incremental changes expected, a formal framework is best employed. Struts is the most popular framework for Java web applications. It has its shortcomings, but it also has a lot of industry adoption as well as a strong user community.

I suggest you look at some basic Struts tutorials to get an idea of what it would offer you. Then you can decide if the learning curve is worth your while (for the application you have in mind). Let us know if you have more specific questions.

Alco-Haul: We move spirits.
Demented Deliberations of a Dilettante
yingyong yang

Joined: Jul 12, 2005
Posts: 1
I just suggest that if you develop a big web application , and your custom want to offer small lund , then you will use Eclipse + Jboss + mySql + Junit + Ant + Struts + Hibernate + String . and you will find them are very very strong and good
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

"yingyong yang",

There aren't may rules that have been put into place here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Forum Bartender
Devender Thareja
Ranch Hand

Joined: Jul 14, 2005
Posts: 187
Struts is (M)odel-(V)iew-(C)ontroller frame work. The main components are:
Model :- form bean
View: jsp
Controller: Action

The action class here is actually a servlet. So every action class is a servlet but reverse is not true.

Hope it helps.

Devender Thareja
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it


Thanks! and welcome to the JavaRanch!


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Servlets vs Struts
It's not a secret anymore!