Beginning In J2EE

814 views

Published on

Beginning In J2EE

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

Beginning In J2EE

  1. 1. Beginning in Java Web Application Leng^M[0]
  2. 2. Overview Today <ul><li>Beginning & Basic of Java web Apps </li></ul><ul><li>HTML </li></ul><ul><li>JSP, Servlet </li></ul><ul><li>MVC Model </li></ul><ul><li>MVC Framework </li></ul><ul><li>Make Hi5’s little brother </li></ul><ul><li>DO NOT COVER TO DAY  Database, More complex details </li></ul><ul><li>CONDITION  Times and interesting </li></ul>
  3. 3. J2EE Technology <ul><li>Java 2 Enterprise Edition </li></ul><ul><li>Many services for organization, business with securities, etc. </li></ul><ul><li>Web application services </li></ul><ul><li>More complex than JDK </li></ul><ul><li>Useful in organization system or big systems </li></ul>
  4. 4. J2EE Services - Web Application <ul><li>Provide JSP </li></ul><ul><li>Java Server Page </li></ul><ul><li>Servlet </li></ul><ul><li>Container (Tomcat , glassfish) </li></ul><ul><li>Frameworks </li></ul><ul><li>Seem like PHP, ASP, CGI </li></ul><ul><li>Script language </li></ul>
  5. 5. Start! Open Netbean!
  6. 6. HTML <ul><li>All web pages in the world, represent by HTML (Hyper Text Makeup Language) </li></ul><ul><li>Use Tag <name property=“”></name> </li></ul><ul><li>Static Web pages (Just texts and pictures) </li></ul><ul><li>Dynamic Web pages </li></ul><ul><li>(Interact with users or do some things in that page) </li></ul>
  7. 7. JSP <ul><li>Use tag too! </li></ul><ul><li><%@ … …%> </li></ul><ul><li><% … %> </li></ul><ul><li><%! ….%> </li></ul><ul><li><%= … %> </li></ul><ul><li>Still use HTML to represent </li></ul><ul><li>Should HTML + JSP in one pages </li></ul><ul><li>Save page by use .jsp </li></ul>
  8. 8. Interact with User <ul><li>HTML Form </li></ul><ul><li>Action </li></ul><ul><li>the action of that form, when event occured. </li></ul><ul><li>Method </li></ul><ul><li>GET , POST </li></ul><ul><li>More importance to understand </li></ul>
  9. 9. Servlet <ul><li>Make dynamic web contents </li></ul><ul><li>The Servlet API , contained in the Java package hierarchy javax.servlet . </li></ul><ul><li>Work on Server Side . </li></ul><ul><li>Servlet Container Apache Tomcat </li></ul><ul><li>Use to be a controller </li></ul><ul><li>Request, Responds </li></ul><ul><li>doGet, doPost, doProcess </li></ul>
  10. 10. MVC Model <ul><li>OO designing concept </li></ul><ul><li>Useful in many web application </li></ul><ul><li>Model, View, control </li></ul><ul><li>Separate main part into sub part for working together </li></ul><ul><li>Model  business logic (Java classes, JavaBeans) </li></ul><ul><li>View  just view (JSP pages) </li></ul><ul><li>Control  stay between View and Model, it ‘s controller (Serlvet) </li></ul>
  11. 11. MVC Framework <ul><li>Framework </li></ul><ul><li>completely structure for programmer to implement into application </li></ul><ul><li>(Just know How to use? Don’t worry about codes of the framework) </li></ul><ul><li>MVC Framework </li></ul><ul><li>- Struts, Spring MVC </li></ul><ul><li>- Today, We talk about Struts with Netbean. </li></ul>
  12. 12. Struts 1.x.x <ul><li>implement model-view-controller MVC design pattern. </li></ul><ul><li>Apache Jakarta project Open Source ^^ </li></ul><ul><li>Convenience. </li></ul><ul><li>Netbean provided. </li></ul>
  13. 13. Struts 1.x.x (cont.) <ul><li>Struts Config (XML)  mapping </li></ul><ul><li>Action path </li></ul><ul><li>- *.do (just default) </li></ul><ul><li>- *.a, *.cs, *.mep, *.love (up to goo) </li></ul><ul><li>ActionForm  get data + validating (control) </li></ul><ul><li>Action  Do process (concerning with Bussiness logic) </li></ul><ul><li>Action Forward  to JSP pages </li></ul>
  14. 14. Hi5 use Struts Let try!

×