• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JSP, Beans and Servlet.

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all, I finds most tutorials I read so far for Servlet is for forms. JSP is for out put html, Java Beans is for database interaction.

One thing I don't know is, how do they interact with each other? I understand what each of them are, but don't understand how they work with each other.

Thank you all,

Mike

PS: Also, what is J2EE? Many job posting want J2EE experience.
[ June 15, 2004: Message edited by: mike chi ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mike,

By Java Beans, I'm sure you meant Enterprise JavaBeans (EJBs). You can use the three technologies in a web application. The JSPs provide your webpage content; requests can be handled by a ControlServlet, say; and you can use EJBs for the data persistence.

Suppose the web app is like a bookstore, and it allows the user to save their book selections for purchase at a later time. The ControlServlet can handle a request like "http://www.myexamplebookstore.com/controlServlet?saveBooks=true", and the ControlServlet can use an EJB like LibrarianBean (okay, that's laughable) to persist the user's book selections to the database.

Hope that helped,
--Leo
 
Leo Deegan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, I saw your p.s.

J2EE (Java 2, Enterprise Edition) is a catch-all set of code and specifications for developing enterprise level applications. J2EE includes JSP, Servlets, and EJBs. J2EE also provides APIs for handling XML, SQL, mail and messaging, along with other things of interest to enterprise developers.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you already have a similar post in the EJBs and Other J2EE Technologies forum, I suggest using that thread for your general J2EE questions.

I'm moving this to the Servlets forum for a discussion the Servlets-JSP-JavaBeans system design and interactions.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet is for forms. JSP is for out put html, Java Beans is for database interaction. ... how do they interact with each other?

A lot of folks will design their web applications following the Model-View-Controller (MVC) pattern, sometimes referred to as Model 2, or MVC 2.

Rather than regurgitate what others have said many times on the subject, let me point you to two pages on the original wiki, ModelViewController and MvcInJspModelTwoArchitecture. Also, a quick search on this forum will likely nab a good explanation or two. Note that the search page link is at the top right of this page.

Good luck, and of course if you have further questions on the subject, don't hesitate to ask. Though, keep in mind that we prefer that most design-based questions be held in the OO, Patterns, UML and Refactoring forum.
 
Weronpc
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for you reply, you guys are nice people.

Could someone give me few lines of codes (example codes) how a servlet send info to jsp?
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic