Managed Beans II Advanced Features
|
|
|
- Derick Norton
- 10 years ago
- Views:
Transcription
1 2014 Marty Hall Managed Beans II Advanced Features Originals of Slides and Source Code for Examples: Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location Marty Hall For live training on JSF 2 and/or PrimeFaces, see or [email protected]. Taught by the author of Core Servlets and JSP, this tutorial, and JSF 2.2 version of Core JSF. Available at public venues, or customized versions can be held on-site at your organization. Courses developed and taught by Marty Hall JSF 2, PrimeFaces, servlets/jsp, Ajax, jquery, Android development, Java 7 or 8 programming, custom mix of topics Courses Customized available in any state Java or country. EE Training: Maryland/DC area companies can also choose afternoon/evening courses. Java Courses 7, Java 8, developed JSF 2.2, PrimeFaces, and taught by JSP, coreservlets.com Ajax, jquery, Spring, experts Hibernate, (edited by RESTful Marty) Web Services, Hadoop, Android. Spring, Hibernate/JPA, GWT, Hadoop, HTML5, RESTful Web Services Developed and taught by well-known author and developer. At public venues or onsite at your location. Contact [email protected] for details
2 Topics in This Section Custom bean names Bean scopes Especially session-scoped beans Getting the raw request and response objects Dependency injection Marty Hall Giving Custom Names to Beans Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location.
3 Main Point The name public class BeanName { You refer to bean with #{anyname.blah, where bean name is exact value of name attribute. Still request scoped by default. Still no entries in faces-config.xml 7 Example 8 Idea (same behavior as Navigator example) Click on button in initial page Get one of three results pages, chosen at random What you need (same except for bean name) A starting page <h:commandbuttonaction="#{customname.choosepage"/> A bean Name: Navigator2 (not related to bean name choosepage returns 3 possible Strings as before "page1", "page2", or "page3" Three results pages as before Names matching method return values page1.xhtml, page2.xhtml, and page3.xhtml
4 start-page2.xhtml 9 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" xmlns:h=" <h:head></h:head> <h:body> <fieldset> <legend>random Results Page</legend> <h:form> Press button to get one of three possible results pages. <br/> <h:commandbutton value="go to Random Page" action="#{customname.choosepage"/> </h:form> </fieldset> </h:body></html> Except for bean name, same as start-page.xhtml from the Programming Basics lecture. Navigator2.java package coreservlets; import public class Navigator2 extends Navigator { Uses the name customname instead of navigator2. Inherits the choosepage method that randomly returns "page1", "page2", or "page3". Since in this simple example the results pages have only static text (no use of beans), this example shares the results pages with the original Navigator example: page1.xhtml, page2.xhtml, and page3.xhtml. 10
5 Results Identical behavior to the original random-navigation example from Programming Basics Marty Hall Controlling Bean Scopes Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location.
6 Bean Scopes 13 Idea Designates how long managed beans will stay alive, and which users and requests can access previous bean instances. JSF 1.x scopes Request, session, application Specified in faces-config.xml Request scope is the default JSF 2.0 scopes request, session, application, view, none, custom Specified either in faces-config.xml or by one of the new annotations Request scope is still the default 14 Annotations to Specify Bean Default. Make a new instance for every HTTP request. Since beans are also used for initial values in input form, this means bean is generally instantiated twice (once when form is displayed, once when form is Put bean in session scope. If same user with same cookie (JSESSIONID) returns before session timeout, same bean instance is used. You should make bean Put bean in application scope. Shared by all users. Bean either should have no mutable state or you must carefully synchronize access. Usually immutable.
7 Annotations to Specify Bean Scope (Continued) Same bean instance is used as long as same user is on same page (e.g., with event handlers or Ajax). New scope in JSF 2.0. Bean should implement Bean is stored in the Map, and programmer can control lifecycle. New scope in JSF Bean is not placed in a scope. Useful for beans that are referenced by other beans that are in scopes. New scope in JSF 2.0 JSF Flow of Control (Updated but Still Simplified) balance.xhtml Uses <h:commandbutton action="#{bankingbean.findbalance"/> and <h:inputtext value="#{bankingbean.customerid"/> When form first displayed, getcustomerid is called. If it is non-empty, it becomes initial value of the textfield. When form submitted, textfield value passed to setcustomerid. submit form POST request balance.jsf Run Setter Methods Find Bean Business Logic results Run Action Controller Method If bean is request-scoped, instantiate it. For other scopes (e.g., session), you might use existing bean instance. return value The results get stored in the placeholder. E.g., a Customer that corresponds to the customer ID is found and placed in an instance variable of main bean. Choose Page This is the method listed in the action of h:commandbutton (e.g., findbalance) forward result1.xhtml result2.xhtml... resultn.xhtml Uses #{bankingbean.someproperty to display bean properties 16 This could be #{bankingbean.customerid, where customerid was passed in by the user, or it could be #{bankingbean.customer.balance, where getcustomer returns the Customer object found by the business logic, and getbalance returns that customer s bank account balance.
8 Main Points You can use annotations to give (same as @NoneScoped Traditionally @SessionScoped public class SomePojo { 17 Application Scope: When Used For beans that have no changeable state Navigation rules only (no getters/setters) As in Navigator example earlier (this is rare in real life) Supplies list of choices for drop down menus <h:selectonemenu value="#{requestscopedbean.choice"> <f:selectitems value="#{appscopedbean.options"/> </h:selectonemenu> Data structures used as properties in main beans See later section For beans you deliberately share Shared across all users and all pages You have to very carefully use synchronization to avoid race conditions Quite rare in real life 18
9 Application Scope: Syntax public class SomeClassNoUserState { Class is instantiated first time it is used. After that, all users and all requests share the same public class SomeClassBigDataNoUserState { Class is instantiated when the app is loaded (which is usually when the server starts). After that, all users and all requests share the same instance. Useful if the class has a big data structure that takes a long time to initialize. Example: Bean with No Changeable State 20 Navigator from Programming Basics lecture There was no state (no instance variables), just an action controller method So, application scope prevents unnecessary object instantiation. In practice, instantiation of small objects is very fast, so this optimization is probably not even measurable. And causes problems if you later go and add input fields and corresponding accessor methods. So, for Navigator example, the benefit of application scope is questionable at best. For large data structures (especially large Maps), this trick can help significantly, though. Large list of choices for drop down menus Maps for business logic» In both cases above, previous examples used static variables to work around this problem. Application scope is a reasonable alternative.
10 Navigator.java package coreservlets; import javax.faces.bean.*; Since there is no mutable state, all users can share the same instance of this bean. For this example, using application scope only saves recreating the tiny array, so has little-to-no measurable performance benefit, and it causes huge problems later if you add accessor methods for storing user-specific data, but forget to Still, if the data structure were large and you had no mutable state, this trick would buy public class Navigator { private String[] resultpages = { "page1", "page2", "page3" ; 21 public String choosepage() { return(randomutils.randomelement(resultpages)); The xhtml pages and results were shown in the Programming Basics lecture. One of page1.xhtml, page2.xhtml, and page3.xhtml is displayed at random. Session Scope: Main Points 22 Bean instance reused if Same user Same browser session Usually based on cookies, but can be based on URL rewriting Useful for Remembering user preferences Prefilling values from previous entries Accumulating lists of user data (ala shopping carts) Normal Java session tracking rules apply Custom classes should be Serializable Some servers save session data to disk on restart Distributed Web apps need this to replicate sessions
11 Session Scope: Example 23 Idea Small variation of banking example Remember previously entered id If end user comes back to input page, the ID they entered last time is already filled in What you need for bean Make bean Serializable Optionally, add faces-redirect=true to end of return values, to tell JSF to redirect (instead of forward) to results pages Allows users to access results pages directly Later, when we use faces-config.xml for navigation rules, we can supply <redirect/> there instead of faces-redirect=true bank-lookup2.xhtml 24 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" xmlns:h=" <h:body> <fieldset> <legend>bank Customer Lookup (Session Scope)</legend> <h:form> Customer ID: <h:inputtext value="#{bankingbean2.customerid"/><br/> Password: <h:inputsecret value="#{bankingbean2.password"/><br/> <h:commandbutton value="show Current Balance" action="#{bankingbean2.showbalance"/> </h:form> Same as bank-lookup.xhtml except for bean name and some minor changes to text. </fieldset> </h:body></html>
12 BankingBean2.java import java.io.*; public class BankingBean2 extends BankingBean implements Serializable public String showbalance() { String origresult = super.showbalance(); return(origresult + "2?faces-redirect=true"); If a page uses the name bankingbean2 and is accessed by the same user in the same browser session, the same bean instance will be used. Results pages are negative-balance2.xhtml, normal-balance2.xhtml, etc. By also appending faces-redirect=true, JSF will redirect instead of forward to the results pages, thus exposing the URLs of the results pages and letting users navigate directly to them later. 25 normal-balance2.xhtml 26 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" xmlns:h=" <h:head> </h:head> <h:body> <ul> <li>first name: #{bankingbean2.customer.firstname</li> <li>last name: #{bankingbean2.customer.lastname</li> <li>id: #{bankingbean2.customer.id</li> <li>balance: $#{bankingbean2.customer.balancenosign</li> </ul> </h:body></html> Same as normal-balance.xhtml except for bean name. negative-balance2.xhtml and high-balance2.xhtml are similar.
13 Results (Initial Access) negative balance normal balance high balance 27 Results (User Returns in Same Browser Session) 28 Question: why wasn t password remembered like the id was?
14 2014 Marty Hall Getting the Request and Response Objects Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location. Issue 30 No automatic access to request & response JSF action controller methods do not have direct access Unlike in Struts, where action controller method (execute) gets request and response automatically Good news In most cases, only use for request and response objects is for explicit user data (request parameters), and JSF provides a much simpler way to get them. Having your form beans be POJOs is very convenient Bad news In the cases where you need the request and response objects, code is more awkward JSF programmers forget how valuable the request and response objects are
15 Why You Need Request and Response Objects Uses for request object Explicit session manipulation E.g., changing inactive interval or invalidating session Explicit cookie manipulation (e.g., long-lived cookies) Reading request headers (e.g., User-Agent) Looking up requesting host name Uses for response object Setting status codes Setting response headers Setting long-lived cookies 31 Solution Static methods If they are needed, use static method calls to get them ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); HttpServletRequest request = (HttpServletRequest)context.getRequest(); HttpServletResponse response = (HttpServletResponse)context.getResponse(); Note In some environments, you cast results of getrequest and getresponse to values other than HttpServletRequest and HttpServletResponse E.g., in a portlet environment, you might cast result to PortletRequest and PortletResponse 32
16 Example 33 Idea Collect a search string and a search engine name, show the results of a search with that search engine. Input form Use textfield for arbitrary search string. Use drop down menu to list only search engines that app supports. Managed bean Construct a URL by concatenating a base URL (e.g., with the URLencoded search string Do response.sendredirect Must use static methods to get the HttpServletResponse Return normal strings for error pages Input Form (search-engine-form.xhtml) <!DOCTYPE > <html xmlns=" xmlns:f=" xmlns:h=" <h:head></h:head> <h:body> <h:form> Search String: <h:inputtext value="#{searchcontroller.searchstring"/><br/> Search Engine: <h:selectonemenu value="#{searchcontroller.searchengine"> <f:selectitems value="#{searchcontroller.searchenginenames"/> </h:selectonemenu><br/> <h:commandbutton value="search" action="#{searchcontroller.dosearch"/> </h:form> </h:body></html> 34
17 Managed Bean (Part 1 Properties for Input public class SearchController { private String searchstring="", searchengine; 35 public String getsearchstring() { return(searchstring); public void setsearchstring(string searchstring) { this.searchstring = searchstring.trim(); public String getsearchengine() { return(searchengine); public void setsearchengine(string searchengine) { this.searchengine = searchengine; public List<String> getsearchenginenames() { return(searchutilities.searchenginenames()); Managed Bean (Part 2 Action Controller) 36 public String dosearch() throws IOException { if (searchstring.isempty()) { return("no-search-string"); searchstring = URLEncoder.encode(searchString, "utf-8"); String searchurl = SearchUtilities.makeURL(searchEngine, searchstring); if (searchurl!= null) { ExternalContext context = FacesContext.getCurrentInstance().getExternalContext(); HttpServletResponse response = (HttpServletResponse)context.getResponse(); response.sendredirect(searchurl); return(null); else { return("unknown-search-engine");
18 Results (Input Form) 37 Results (Forwarding Results) 38
19 2014 Marty Hall Advanced Topic: Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location. Main Points JSF supports simple dependency injection That is, you can assign values to a managed bean property (i.e., a value the main bean depends on) without hardcoding it into the class definition Not as powerful as with Spring, but still lets you do this with private SomeType somefield; <managed-property> lets you do it in faces-config.xml This is same as in JSF 1.x Setter method for the property is required E.g., in example above, you must have setsomefield You can use name attribute if setter method name does not match field name
20 @ManagedProperty: Secondary Points 41 You can instantiate beans at app public class SomePojo { This is useful for the bean that you inject into the main bean. The injected bean is often something shared like a lookup service, whereas the main bean usually contains user-specific data faces-config better than annotations (?) One of the points of dependency injection is to let you change the concrete class without changing Java code Using annotations in the Java code partially violates that principle faces-config.xml lets you specify Map elements The annotation does not Spring is best of all (?) For situations that warrant the extra complexity, Spring has nice JSF integration, so you can directly use Spring configuration files (e.g., applicationcontext.xml). See separate Example 42 Idea Refactoring of banking example Customer lookup service will be injected into main bean Lookup service will be application scoped and created at application load time What you need Main private CustomerLookupService service; public void setservice() { Lookup service bean (the bean
21 bank-lookup3.xhtml 43 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <html xmlns=" xmlns:h=" <h:body> <fieldset> <legend>bank Customer Lookup</legend> <h:form> Customer ID: <h:inputtext value="#{bankingbean3.customerid"/><br/> Password: <h:inputsecret value="#{bankingbean3.password"/><br/> <h:commandbutton value="show Current Balance" action="#{bankingbean3.showbalance"/> </h:form> Same as bank-lookup.xhtml except for bean name and some minor changes to text. </fieldset> </h:body></html> public class BankingBean3 extends BankingBeanBase private CustomerLookupService service; 44 public void setservice(customerlookupservice service) { this.service = service; public String showbalance() { if (!password.equals("secret")) { return("wrong-password3"); customer = service.findcustomer(customerid); if (customer == null) { There is now no explicit reference to the concrete class that provides the lookup service. So, it is easier to change among test implementations and real implementations without changing this code. However, when you use annotations only, the bean name is often tied closely to the bean class. The bean name need not be the class name, but you still specify the name in the Java code. So, although it is clear that dependency injection of some sort can make your code more flexible (you can change the lookup service without any changes to the main class), is not entirely clear that the JSF 2 annotation-based way of doing dependency injection is better than the JSF 1.x way of doing dependency injection using faces-config.xml. Even though you must put before the field (instance variable), the setter is what is called by JSF. If the setter name does not match the field name, value).
22
23 Results (Same Behavior as First Banking Example) negative balance normal balance high balance Marty Hall Wrap-Up Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location.
24 Summary Custom bean Scopes Session scope commonly used for user preferences and other userspecific data that must survive from request to The raw request and response objects Needed for general redirects, headers, long-lived cookies, etc. Use static method calls with ExternalContext to get them Dependency injection Code can be more flexible if services (and other classes that commonly change) are passed in instead of hard coded We but also consider declaring in facesconfig or using the Spring framework (not covered yet) Marty Hall Questions? JSF 2, PrimeFaces, Java 7 or 8, Ajax, jquery, Hadoop, RESTful Web Services, Android, HTML5, Spring, Hibernate, Servlets, JSP, GWT, and other Java EE training. Also see JSF 2 tutorial and PrimeFaces tutorial. Customized Java EE Training: Java 7, Java 8, JSF 2.2, PrimeFaces, JSP, Ajax, jquery, Spring, Hibernate, RESTful Web Services, Hadoop, Android. Developed and taught by well-known author and developer. At public venues or onsite at your location.
The Google Web Toolkit (GWT): The Model-View-Presenter (MVP) Architecture Official MVP Framework
2013 Marty Hall & Yaakov Chaikin The Google Web Toolkit (GWT): The Model-View-Presenter (MVP) Architecture Official MVP Framework (GWT 2.5 Version) Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/gwt.html
Session Tracking Customized Java EE Training: http://courses.coreservlets.com/
2012 Marty Hall Session Tracking Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 2 Customized Java EE Training: http://courses.coreservlets.com/
Hadoop Streaming. 2012 coreservlets.com and Dima May. 2012 coreservlets.com and Dima May
2012 coreservlets.com and Dima May Hadoop Streaming Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses (onsite
Map Reduce Workflows
2012 coreservlets.com and Dima May Map Reduce Workflows Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses (onsite
Advanced Java Client API
2012 coreservlets.com and Dima May Advanced Java Client API Advanced Topics Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop
Hadoop Distributed File System (HDFS) Overview
2012 coreservlets.com and Dima May Hadoop Distributed File System (HDFS) Overview Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized
Virtual Machine (VM) For Hadoop Training
2012 coreservlets.com and Dima May Virtual Machine (VM) For Hadoop Training Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop
The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics
2013 Marty Hall & Yaakov Chaikin The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics (GWT 2.5 Version) Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/gwt.html
Application Security
2009 Marty Hall Declarative Web Application Security Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
Building Web Services with Apache Axis2
2009 Marty Hall Building Web Services with Apache Axis2 Part I: Java-First (Bottom-Up) Services Customized Java EE Training: http://courses.coreservlets.com/ Servlets, JSP, Struts, JSF/MyFaces/Facelets,
Java with Eclipse: Setup & Getting Started
Java with Eclipse: Setup & Getting Started Originals of slides and source code for examples: http://courses.coreservlets.com/course-materials/java.html Also see Java 8 tutorial: http://www.coreservlets.com/java-8-tutorial/
Apache Pig Joining Data-Sets
2012 coreservlets.com and Dima May Apache Pig Joining Data-Sets Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses
HBase Key Design. 2012 coreservlets.com and Dima May. 2012 coreservlets.com and Dima May
2012 coreservlets.com and Dima May HBase Key Design Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses (onsite
Official Android Coding Style Conventions
2012 Marty Hall Official Android Coding Style Conventions Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
HBase Java Administrative API
2012 coreservlets.com and Dima May HBase Java Administrative API Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses
Handling the Client Request: Form Data
2012 Marty Hall Handling the Client Request: Form Data Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 3 Customized Java EE Training: http://courses.coreservlets.com/
Android Programming: Installation, Setup, and Getting Started
2012 Marty Hall Android Programming: Installation, Setup, and Getting Started Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training:
JHU/EP Server Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html
2010 Marty Hall Deploying Apps to the JHU/EP Server Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 2 Customized Java EE Training: http://courses.coreservlets.com/
Web Development in Java Live Demonstrations (Live demonstrations done using Eclipse for Java EE 4.3 and WildFly 8)
Web Development in Java Live Demonstrations (Live demonstrations done using Eclipse for Java EE 4.3 and WildFly 8) Java Servlets: 1. Switch to the Java EE Perspective (if not there already); 2. File >
Android Programming: 2D Drawing Part 1: Using ondraw
2012 Marty Hall Android Programming: 2D Drawing Part 1: Using ondraw Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
HDFS Installation and Shell
2012 coreservlets.com and Dima May HDFS Installation and Shell Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses
Android Programming Basics
2012 Marty Hall Android Programming Basics Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
Web Applications. For live Java training, please see training courses at
2009 Marty Hall Using and Deploying Web Applications Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
The Google Web Toolkit (GWT): Overview & Getting Started
2013 Marty Hall & Yaakov Chaikin The Google Web Toolkit (GWT): Overview & Getting Started (GWT 2.5 Version) Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/gwt.html
Controlling Web Application Behavior
2006 Marty Hall Controlling Web Application Behavior The Deployment Descriptor: web.xml JSP, Servlet, Struts, JSF, AJAX, & Java 5 Training: http://courses.coreservlets.com J2EE Books from Sun Press: http://www.coreservlets.com
Web Anwendungen Entwickeln mit JSF, Spring und Tomcat
Entwickeln mit JSF, Spring und Tomcat Ulm, AOI-Systeme Schulung, Beratung, Entwicklung Januar 2011 Übersicht 1 System Architecture Übersicht 1 System Architecture 2 Übersicht 1 System Architecture 2 3
Creating Java EE Applications and Servlets with IntelliJ IDEA
Creating Java EE Applications and Servlets with IntelliJ IDEA In this tutorial you will: 1. Create IntelliJ IDEA project for Java EE application 2. Create Servlet 3. Deploy the application to JBoss server
Web Applications. Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html
2009 Marty Hall Using and Deploying Web Applications Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
Servlet and JSP Filters
2009 Marty Hall Servlet and JSP Filters Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
An introduction to creating JSF applications in Rational Application Developer Version 8.0
An introduction to creating JSF applications in Rational Application Developer Version 8.0 September 2010 Copyright IBM Corporation 2010. 1 Overview Although you can use several Web technologies to create
Managing Data on the World Wide-Web
Managing Data on the World Wide-Web Sessions, Listeners, Filters, Shopping Cart Elad Kravi 1 Web Applications In the Java EE platform, web components provide the dynamic extension capabilities for a web
HDFS - Java API. 2012 coreservlets.com and Dima May. 2012 coreservlets.com and Dima May
2012 coreservlets.com and Dima May HDFS - Java API Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses (onsite
Integrating Servlets and JSP: The Model View Controller (MVC) Architecture
2012 Marty Hall Integrating Servlets and JSP: The Model View Controller (MVC) Architecture Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html
Debugging Ajax Pages: Firebug
2010 Marty Hall Ajax: Development and Debugging g Tools Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/ajax.html Customized Java EE Training: http://courses.coreservlets.com/
Complete Java Web Development
Complete Java Web Development JAVA-WD Rev 11.14 4 days Description Complete Java Web Development is a crash course in developing cutting edge Web applications using the latest Java EE 6 technologies from
Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java
Java EE Introduction, Content Component Architecture: Why and How Java EE: Enterprise Java The Three-Tier Model The three -tier architecture allows to maintain state information, to improve performance,
Web Container Components Servlet JSP Tag Libraries
Web Application Development, Best Practices by Jeff Zhuk, JavaSchool.com ITS, Inc. [email protected] Web Container Components Servlet JSP Tag Libraries Servlet Standard Java class to handle an HTTP request
An introduction to web programming with Java
Chapter 1 An introduction to web programming with Java Objectives Knowledge Objectives (continued) The first page of a shopping cart application The second page of a shopping cart application Components
2011 Marty Hall An Overview of Servlet & JSP Technology Customized Java EE Training: http://courses.coreservlets.com/
2011 Marty Hall An Overview of Servlet & JSP Technology Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 3 Customized Java EE Training: http://courses.coreservlets.com/
Enterprise Application Development In Java with AJAX and ORM
Enterprise Application Development In Java with AJAX and ORM ACCU London March 2010 ACCU Conference April 2010 Paul Grenyer Head of Software Engineering [email protected] http://paulgrenyer.blogspot.com
Liferay Enterprise ecommerce. Adding ecommerce functionality to Liferay Reading Time: 10 minutes
Liferay Enterprise ecommerce Adding ecommerce functionality to Liferay Reading Time: 10 minutes Broadleaf + Liferay ecommerce + Portal Options Integration Details REST APIs Integrated IFrame Separate Conclusion
Tutorial: Building a Web Application with Struts
Tutorial: Building a Web Application with Struts Tutorial: Building a Web Application with Struts This tutorial describes how OTN developers built a Web application for shop owners and customers of the
MapReduce on YARN Job Execution
2012 coreservlets.com and Dima May MapReduce on YARN Job Execution Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training
Copyright 2008 The Pragmatic Programmers, LLC.
Extracted from: Stripes... and Java Web Development Is Fun Again This PDF file contains pages extracted from Stripes, published by the Pragmatic Bookshelf. For more information or to purchase a paperback
Java EE 6 Development with NetBeans 7
P U B L I S H I N G community experience distilled Java EE 6 Development with NetBeans 7 David R. Heffelfinger Chapter No. 4 "Developing Web Applications using JavaServer Faces 2.0" In this package, you
What servlets and JSP are all about
2012 Marty Hall An Overview of Servlet & JSP Technology Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 3 Customized Java EE Training: http://courses.coreservlets.com/
Course Number: IAC-SOFT-WDAD Web Design and Application Development
Course Number: IAC-SOFT-WDAD Web Design and Application Development Session 1 (10 Hours) Client Side Scripting Session 2 (10 Hours) Server Side Scripting - I Session 3 (10 hours) Database Session 4 (10
Recommended readings. Lecture 11 - Securing Web. Applications. Security. Declarative Security
Recommended readings Lecture 11 Securing Web http://www.theserverside.com/tt/articles/content/tomcats ecurity/tomcatsecurity.pdf http://localhost:8080/tomcat-docs/security-managerhowto.html http://courses.coreservlets.com/course-
JSF Melih Sakarya. Java Server Faces PrimeFaces. www.mergecons.com. www.mergecons.com 1
JSF Melih Sakarya JSF Java Server Faces PrimeFaces www.mergecons.com www.mergecons.com 1 PrimeFaces Açık kaynak. Türkçe desteği. Türkçe dokümantasyon. Zengin bileşen desteği. TouchFaces ile mobile ortam
Advanced Web Development SCOPE OF WEB DEVELOPMENT INDUSTRY
Advanced Web Development Duration: 6 Months SCOPE OF WEB DEVELOPMENT INDUSTRY Web development jobs have taken thе hot seat when it comes to career opportunities and positions as a Web developer, as every
SSC - Web development Model-View-Controller for Java web application development
SSC - Web development Model-View-Controller for Java web application development Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics Java Server
Object-Oriented Programming in Java: More Capabilities
coreservlets.com custom onsite training Object-Oriented Programming in Java: More Capabilities Originals of slides and source code for examples: http://courses.coreservlets.com/course-materials/java.html
Building and Using Web Services With JDeveloper 11g
Building and Using Web Services With JDeveloper 11g Purpose In this tutorial, you create a series of simple web service scenarios in JDeveloper. This is intended as a light introduction to some of the
www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk
CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling
Introduction to web development using XHTML and CSS. Lars Larsson. Today. Course introduction and information XHTML. CSS crash course.
using CSS using CSS 1 using CSS 2 3 4 Lecture #1 5 6 using CSS Material using CSS literature During this, we will cover server side web with JavaServer Pages. JSP is an exciting technology that lets developers
2.8. Session management
2.8. Session management Juan M. Gimeno, Josep M. Ribó January, 2008 Session management. Contents Motivation Hidden fields URL rewriting Cookies Session management with the Servlet/JSP API Examples Scopes
Modern Web Application Framework Python, SQL Alchemy, Jinja2 & Flask
Modern Web Application Framework Python, SQL Alchemy, Jinja2 & Flask Devert Alexandre December 29, 2012 Slide 1/62 Table of Contents 1 Model-View-Controller 2 Flask 3 First steps 4 Routing 5 Templates
CrownPeak Java Web Hosting. Version 0.20
CrownPeak Java Web Hosting Version 0.20 2014 CrownPeak Technology, Inc. All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical,
Web Service Caching Using Command Cache
Web Service Caching Using Command Cache Introduction Caching can be done at Server Side or Client Side. This article focuses on server side caching of web services using command cache. This article will
Building an Agile PLM Web Application with JDeveloper and Agile 93 Web Services
Building an Agile PLM Web Application with JDeveloper and Agile 93 Web Services Tutorial By: Maneesh Agarwal,Venugopalan Sreedharan Agile PLM Development October 2009 CONTENTS Chapter 1 Overview... 3
For live Java EE training, please see training courses
2012 Marty Hall Basic Java Syntax Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/java.htmlcoreservlets com/course-materials/java html 3 Customized Java
Implementing the Shop with EJB
Exercise 2 Implementing the Shop with EJB 2.1 Overview This exercise is a hands-on exercise in Enterprise JavaBeans (EJB). The exercise is as similar as possible to the other exercises (in other technologies).
How To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post
Understanding Architecture and Framework of J2EE using Web Application Devadrita Dey Sarkar,Anavi jaiswal, Ankur Saxena Amity University,UTTAR PRADESH Sector-125, Noida, UP-201303, India Abstract: This
Hadoop Introduction. 2012 coreservlets.com and Dima May. 2012 coreservlets.com and Dima May
2012 coreservlets.com and Dima May Hadoop Introduction Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop training courses (onsite
SSC - Web applications and development Introduction and Java Servlet (II)
SSC - Web applications and development Introduction and Java Servlet (II) Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics Servlet Configuration
AN OVERVIEW OF SERVLET AND JSP TECHNOLOGY
AN OVERVIEW OF SERVLET AND JSP TECHNOLOGY Topics in This Chapter Understanding the role of servlets Building Web pages dynamically Looking at servlet code Evaluating servlets vs. other technologies Understanding
An Overview of Servlet & JSP Technology
2007 Marty Hall An Overview of Servlet & JSP Technology 2 Customized J2EE Training: http://courses.coreservlets.com/ Servlets, JSP, Struts, JSF, EJB3, Ajax, Java 5, Java 6, etc. Ruby/Rails coming soon.
Web Performance, Inc. Testing Services Sample Performance Analysis
Web Performance, Inc. Testing Services Sample Performance Analysis Overview This document contains two performance analysis reports created for actual web testing clients, and are a good example of the
Localization and Resources
2012 Marty Hall Localization and Resources Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence
Web Development Owen Sacco ICS2205/ICS2230 Web Intelligence Introduction Client-Side scripting involves using programming technologies to build web pages and applications that are run on the client (i.e.
Specialized Programme on Web Application Development using Open Source Tools
Specialized Programme on Web Application Development using Open Source Tools Objective: At the end of the course, Students will be able to: Understand various open source tools(programming tools and databases)
Getting Started Guide. Version 1.8
Getting Started Guide Version 1.8 Copyright Copyright 2005-2009. ICEsoft Technologies, Inc. All rights reserved. The content in this guide is protected under copyright law even if it is not distributed
Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation
Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish Ludovic Champenois Oracle Corporation The following is intended to outline our general product direction. It is intended for information
OUR COURSES 19 November 2015. All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan 32 411 19 Göteborg Sweden
OUR COURSES 19 November 2015 Solid Beans AB Kungsgatan 32 411 19 Göteborg Sweden Java for beginners JavaEE EJB 3.1 JSF (Java Server Faces) PrimeFaces Spring Core Spring Advanced Maven One day intensive
<Insert Picture Here> Betting Big on JavaServer Faces: Components, Tools, and Tricks
Betting Big on JavaServer Faces: Components, Tools, and Tricks Steve Muench Consulting Product Manager, JDeveloper/ADF Development Team Oracle Corporation Oracle's Betting Big on
Java EE Web Development Course Program
Java EE Web Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive types, variables, basic operators, expressions,
& JSP Technology Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html
2009 Marty Hall An Overview of Servlet & JSP Technology Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 2 Customized Java EE Training: http://courses.coreservlets.com/
ACM Crossroads Student Magazine The ACM's First Electronic Publication
Page 1 of 8 ACM Crossroads Student Magazine The ACM's First Electronic Publication Crossroads Home Join the ACM! Search Crossroads [email protected] ACM / Crossroads / Columns / Connector / An Introduction
Model-View-Controller. and. Struts 2
Model-View-Controller and Struts 2 Problem area Mixing application logic and markup is bad practise Harder to change and maintain Error prone Harder to re-use public void doget( HttpServletRequest request,
Web Presentation Layer Architecture
Chapter 4 Web Presentation Layer Architecture In this chapter we provide a discussion of important current approaches to web interface programming based on the Model 2 architecture [59]. From the results
Web Applications and Struts 2
Web Applications and Struts 2 Problem area Problem area Separation of application logic and markup Easier to change and maintain Easier to re use Less error prone Access to functionality to solve routine
Creating Web Services Applications with IntelliJ IDEA
Creating Web Services Applications with IntelliJ IDEA In this tutorial you will: 1. 2. 3. 4. Create IntelliJ IDEA projects for both client and server-side Web Service parts Learn how to tie them together
Specialized Programme on Web Application Development using Open Source Tools
Specialized Programme on Web Application Development using Open Source Tools A. NAME OF INSTITUTE Centre For Development of Advanced Computing B. NAME/TITLE OF THE COURSE C. COURSE DATES WITH DURATION
Step One Check for Internet Connection
Connecting to Websites Programmatically with Android Brent Ward Hello! My name is Brent Ward, and I am one of the three developers of HU Pal. HU Pal is an application we developed for Android phones which
Spring Web Flow Reference Guide
Reference Guide Keith Donald, Erwin Vervaet, Jeremy Grelle, Scott Andrews, Rossen Stoyanchev, Phillip Webb Copyright Copies of this document may be made for your own use and for distribution to others,
White Paper. JavaServer Faces, Graphical Components from Theory to Practice
White Paper JavaServer Faces, Graphical Components from Theory to Practice JavaServer Faces, Graphical Components from Theory to Practice White Paper ILOG, April 2005 Do not duplicate without permission.
Web development... the server side (of the force)
Web development... the server side (of the force) Fabien POULARD Document under license Creative Commons Attribution Share Alike 2.5 http://www.creativecommons.org/learnmore Web development... the server
2. Follow the installation directions and install the server on ccc
Installing a Web Server 1. Install a sample web server, which supports Servlets/JSPs. A light weight web server is Apache Tomcat server. You can get the server from http://tomcat.apache.org/ 2. Follow
JBoss Portlet Container. User Guide. Release 2.0
JBoss Portlet Container User Guide Release 2.0 1. Introduction.. 1 1.1. Motivation.. 1 1.2. Audience 1 1.3. Simple Portal: showcasing JBoss Portlet Container.. 1 1.4. Resources. 1 2. Installation. 3 2.1.
Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga
Web Development with NetBeans 5.0 Quick Start in Basic Web and Struts pplications Geertjan Wielenga Web Development with NetBeans 5 This tutorial takes you through the basics of using NetBeans IDE 5.0
JSF (Java Server Faces) Melih Sakarya www.melihsakarya.com [email protected]
JSF (Java Server Faces) Melih Sakarya www.melihsakarya.com [email protected] JSF Nedir? MVC (Model-View-Controller) JSR Standartı (JSR-127, JSR 252) Component Oriented Event Driven Farklı JSF implementasyonları
Core Java+ J2EE+Struts+Hibernate+Spring
Core Java+ J2EE+Struts+Hibernate+Spring Java technology is a portfolio of products that are based on the power of networks and the idea that the same software should run on many different kinds of systems
Developing ASP.NET MVC 4 Web Applications MOC 20486
Developing ASP.NET MVC 4 Web Applications MOC 20486 Course Outline Module 1: Exploring ASP.NET MVC 4 The goal of this module is to outline to the students the components of the Microsoft Web Technologies
Budget Event Management Design Document
Budget Event Management Design Document Team 4 Yifan Yin(TL), Jiangnan Shangguan, Yuan Xia, Di Xu, Xuan Xu, Long Zhen 1 Purpose Summary List of Functional Requirements General Priorities Usability Accessibility
Web Application Development
Web Application Development Introduction Because of wide spread use of internet, web based applications are becoming vital part of IT infrastructure of large organizations. For example web based employee
CommonSpot Content Server Version 6.2 Release Notes
CommonSpot Content Server Version 6.2 Release Notes Copyright 1998-2011 PaperThin, Inc. All rights reserved. About this Document CommonSpot version 6.2 updates the recent 6.1 release with: Enhancements
DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server
DEPLOYMENT GUIDE Version 1.0 Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server Table of Contents Table of Contents Deploying the BIG-IP LTM with Tomcat application servers and Apache web
