Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes CRUD web app sample without a framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "CRUD web app sample without a framework" Watch "CRUD web app sample without a framework" New topic
Author

CRUD web app sample without a framework

margaret gillon
Ranch Hand

Joined: Nov 12, 2008
Posts: 318
    
    5

I am learning web applications by using books but when the books start showing CRUD programming a framework is used. In Marty Hall's "More Servlets" he is using JSF of which Bear says

In my opinion, JSF is an abomination that should never have left the drawing board. thread -- I need a stack


I could not find any non framework samples on the Internet. I believe frameworks can be useful but feel that I need to know the basics before adopting one.

I am looking for a sample CRUD web application that does not use any framework. Then I would like to see the sample application with a framework added.

...or is there a book that would show a no framework web application doing basic CRUD for a database?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Margaret,
JDBC isn't a framework. What are you looking for beyond the JDBC tutorial?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
margaret gillon
Ranch Hand

Joined: Nov 12, 2008
Posts: 318
    
    5

Hi Jeanne,

I need to build a web application and most of what it is doing will involve CRUD screens for a database that I have already built. I have used JDBC to run queries against my development database server (linux / postgresql) so I have the basics down on connecting to the database. I have done some tutorials that walk the user through building a CRUD screen with Spring and got those working.

While studying tutorials I have been following some of the threads on frameworks to use for web applications like Frameworks? Do I need one? want one?. In many of the posts Bear Bibeault, Pat Farrell, and others talk about not using a framework. I am trying to find an example of what the classes, html pages, and jsp pages would look like that would be involved in building scriptless CRUD screens without a framework like Spring.

A war file that I could look at like the 'Simple Command' sample app on the Code Barn Servlets page Code Barn Servlets
[ December 11, 2008: Message edited by: margaret gillon ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30356
    
150

Margaret,
I don't know where would find an example. I can imagine one though - it would have servlets for processing requests that delegate to a DAO (data access object) class to do the actual work.

That said, most people use some framework. Even it's just a servlet that delegates to classes to do work based on the URL. Even Bear has a framework he likes. The key is that it is extremely lightweight.
margaret gillon
Ranch Hand

Joined: Nov 12, 2008
Posts: 318
    
    5

Hi Jeanne,

I have ordered some more of the older books and maybe a few of them will have more CRUD examples than the ones I have now. I know about Bear's framework and have downloaded it so I can study it on my desktop. I am reading the articles in some of the JavaRanch newsletters, too.

I don't mind using a framework and will probably try to work with Bear's. What I am cautious about is that I have seen companies adopt frameworks and the entry level programmers who get trained in the framework cannot distinguish what the framework is doing from the general structure of the application and language.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61084
    
  66

Originally posted by margaret gillon:
What I am cautious about is that I have seen companies adopt frameworks and the entry level programmers who get trained in the framework cannot distinguish what the framework is doing from the general structure of the application and language.

Then you'll probably like Front Man. That's exactly what it was designed not to do.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Richard Corbin
Greenhorn

Joined: Nov 22, 2008
Posts: 12
so what the H-e Double Hockey Sticks is wrong with JSF :-)

I personally think it's pretty darn easy and intuitive. I think it gets a bad wrap due to its 1.0 and 1.1 release. Netbeans IDE also has a slick WYSIWYG editor (Matisse) so you can get down to business without a lot of design headaches.

as for frameworks, yeah.. I don't like JPA, I like SQL so I just issue native queries that i store in a central repository.
margaret gillon
Ranch Hand

Joined: Nov 12, 2008
Posts: 318
    
    5

One of the books recommended on this site was "Special Edition Using Java Server Pages and Servlets " by Mark Wutka (2000) . When I received the book I found it has several chapters on creating a CRUD application and shows the classes that support the database connections and editing. A bonus for me is that this book includes a chapter on security and the example class shows different ways to authenticate people. Thanks to the ranchers who recommended it . The book is out of print but used editions are easy to find on Amazon.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You can also take a loot at Marty Hall's original Core servlets & JSP and the more Servlets and JSP.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: CRUD web app sample without a framework