This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes Do I need to know JSP/Servlets to make a client/server application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "Do I need to know JSP/Servlets to make a client/server application?" Watch "Do I need to know JSP/Servlets to make a client/server application?" New topic

Do I need to know JSP/Servlets to make a client/server application?

Lucas Abrao

Joined: Apr 02, 2004
Posts: 1
Hi there!
I'm a J2SE Programmer and right now, Im starting learning J2EE... Well, I was comissioned to make a client/server application and I'm gonna utilize J2EE platform... This applicaton is about an enrolling controler of some students in an school... To make this application, do I need to use Servlets/JSP??? I mean, in the SCJD, they dont require us to know JSP/Servlets, what I know, it's that they require us to know only RMI, JDBC, etc... But nor JSP neither Servlets... I wanna know only if I can make a client/server application without these both technologies.
Thank ya for your cooperation...
Best regards!
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13001
Servlet technology is the basis for client-server communication in J2EE - if you look at Sun's various summary diagrams you will always see servlets between the client and the back-end.
You should rejoice the servlet API is very well designed and refined to take care of many annoying details. If your clients are going to be using web browsers, there is really no better way.
IMHO you can do without learning JSP to start with.
Byron Estes
Ranch Hand

Joined: Feb 21, 2002
Posts: 313
I agree with William, Servlets and JSP (...which by the way is just a scripting language that gets compiled into a servlet itself) are the best route for you to take.
There are other options (e.g. Creating a socket based server), but then you have to deal with a lot of messy details including multi-threading, security issues, transport/firewall issues, establishing a protocol, etc.
I must, however, disagree on the point of not using JSP. It's not hard to pick up and it helps promote, if used correcly, a good separation of presentation and business logic.
I would even, depending upon how tight you deadlines are and how maintainable you want the code to be, consider learning a little about Jakarta Struts. It might be difficult for your first J2EE web based application, but it teaches you, IMHO, how to structure and layer your application logically. It even saves you time because it essentially provides you with a basic architecture and handles many of the more mundane tasks of common to all web applications. When I started Struts didn't exist and I ended up writing my own framework (...very much like Jakarta Struts) based upon lessons learned by developing various applications.
If you can't use Struts, keep your business logic separate from the presentation and extract any calls to data into a set of objects (data access layer) for data access.
Good luck with your project...

Byron Estes<br />Sun Certified Enterprise Architect<br />Senior Consulant<br />Blackwell Consulting Services<br />Chicago, IL<br /><a href="" target="_blank" rel="nofollow"></a>
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Forget JSPs. If you want true separation of layers look at Velocity.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
JSPs work well if used properly.
If used improperly, no technology works well so don't blame JSP for those implementations using it that did it wrong
I'm currently working on a miniature application (some 15 screens in this release).
For this I created my own miniature MVC framework allowing different output media to be plugged in easily.
This release will use only JSPs to render HTML for miniature screens (PDAs), but I can see the tech I write now being used in the future for other things as well (there's some brainstorming going on about offering some web services for the backend this app accesses for example, the framework could easily handle outputting data to XML by adding another entry to some config files pointing to servlets outputting SOAP messages instead of JSPs outputting HTML.
That's the beauty about pluggable view technologies, if implemented properly you don't have to worry about any existing code at all...

Byron Estes
Ranch Hand

Joined: Feb 21, 2002
Posts: 313
Jeroen... might want to take a look at Apache's Caccoon project.
The beauty of this framework is that you create everything as presentation independent xml that describes the data and calls various renderers to transform the output into whatever format you need (i.e. HTML, CHTML, WML, PDF, etc.). It's ultimately an XSLT executioin framework that uses the concept of pipes to declaratively configure the execution of a series of tasks from request to response.
I believe the newest version supports Web Services as well.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
I've looked at Cocoon in the past, not recently though.
Has it gotten more mature, I think I remember it was not all that well architectured and quite hard to use (we decided at the time to not go with it).
Byron Estes
Ranch Hand

Joined: Feb 21, 2002
Posts: 313
I didn't have the opportunity to put it through it's paces. The wireless project I was looking to potentially use it on due to multiple disparate devices got dropped. Based upon what I needed at the time, it was looking like the way to go. I've done other wireless development and have struggled with supporting lots of devices easily. This just seemed to make a lot of sense.
I do remember being impressed with it's simplicity and really liked the idea of pipes and being able to declaratively configure the sections in the pipe.
I wish I could give you more information, but that's all I have.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Do I need to know JSP/Servlets to make a client/server application?
It's not a secret anymore!