SlideShare ist ein Scribd-Unternehmen logo
1 von 80
Building Java Portlets with Spring MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],© Copyright Unicon, Inc., 2008.  Some rights reserved.  This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. To view a copy of this license, visit  http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Speaker Background ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlet Review ,[object Object]
Diagram from Java ™  Portlet Specification, Version 2.0 Public Draft
Java Portlet Standards ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlets and Servlets ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Multiple Request Phases ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Diagram from Java ™  Portlet Specification, Version 2.0 Public Draft
Portlet Modes ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlet Window States ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlet URL Handling ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Spring MVC Framework ,[object Object]
Using A Framework ,[object Object],[object Object],[object Object],[object Object]
Spring MVC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dispatcher (Servlet/Portlet) Request Handler Mapping View Resolver Response Controller View ModelAndView Map (Model) viewName
Spring Views ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spring Controllers ,[object Object],[object Object],[object Object],[object Object]
Other MVC Features ,[object Object],[object Object],[object Object],[object Object],[object Object]
Spring Web MVC Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Spring Portlet MVC Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Configuring Spring Portlet MVC ,[object Object]
web.xml: ContextLoaderLister ,[object Object],[object Object],<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> No different from Servlet Spring Web MVC
web.xml: contextConfigLocation ,[object Object],<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/service-context.xml /WEB-INF/data-context.xml </param-value> </context-param> No different from Servlet Spring Web MVC
web.xml: ViewRendererServlet ,[object Object],<servlet> <servlet-name>view-servlet</servlet-name> <servlet-class> org.springframework.web.servlet.ViewRendererServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>view-servlet</servlet-name> <url-pattern>/WEB-INF/servlet/view</url-pattern> </servlet-mapping>
ViewRendererServlet ,[object Object],[object Object],[object Object],[object Object]
portlet.xml <portlet> <portlet-name>example</portlet-name> <portlet-class> org.springframework.web.portlet.DispatcherPortlet </portlet-class> <init-param> <name> contextConfigLocation </name> <value> /WEB-INF/context/example-portlet.xml </value> </init-param> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> <portlet-mode>edit</portlet-mode> <portlet-mode>help</portlet-mode> </supports> <portlet-info> <title>Example Portlet</title> </portlet-info> </portlet>
DispatcherPortlet ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
View Resolver &  Exception Resolver ,[object Object]
Resolving Views ,[object Object],<bean id=&quot;viewResolver&quot; class=&quot;org.springframework.web.servlet.view. InternalResourceViewResolver&quot;> <property name=&quot;cache&quot; value=&quot;false&quot; /> <property name=&quot;viewClass&quot; value=&quot;org.springframework.web.servlet.view.JstlView&quot; /> <property name=&quot;prefix&quot; value=&quot;/WEB-INF/jsp/&quot; /> <property name=&quot;suffix&quot; value=&quot;.jsp&quot; /> </bean> Can be shared between multiple portlets & servlets
Map  Exceptions  to  View Names  (used by View Resolver) <bean id=&quot;exceptionResolver&quot; class=&quot;org.springframework.web.portlet.handler. SimpleMappingExceptionResolver&quot;> <property name=&quot;defaultErrorView&quot; value=&quot;error&quot;/> <property name=&quot;exceptionMappings&quot;> <value> javax.portlet.PortletSecurityException=unauthorized javax.portlet.UnavailableException=unavailable </value> </property> </bean> Resolving Exceptions ,[object Object]
More on Resolvers ,[object Object],[object Object],[object Object]
Internationalization & Localization ,[object Object]
Internationalization ,[object Object],button.home = Home button.edit = Edit button.next = Next button.previous = Previous button.finish = Finish button.cancel = Cancel exception.notAuthorized.title = Access Not Permitted exception.notAuthorized.message = You do not have permission to access this area.
MessageSource ,[object Object],<bean id=&quot;messageSource&quot; class=&quot;org.springframework.context.support. ResourceBundleMessageSource&quot;> <property name=&quot;basenames&quot;> <list> <value>messages</value> </list> </property> </bean>
Using Messages in Views ,[object Object],[object Object],<%@ taglib prefix=&quot;spring&quot; uri=&quot;http://www.springframework.org/tags&quot; %> ... <p><spring:message code=&quot;exception.contactAdmin&quot;/></p>
Localization ,[object Object],[object Object],[object Object],[object Object],[object Object]
Handler Mapping ,[object Object]
HandlerMapping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Most of these become obsolete in Spring 2.5 because the Annotation-based Mapping is now preferred
PortletModeHandlerMapping <bean id=&quot;portletModeHandlerMapping&quot; class=&quot;org.springframework.web.portlet.handler. PortletModeHandlerMapping&quot;> <property name=&quot;portletModeMap&quot;> <map> <entry key=&quot;view&quot; value-ref=&quot;viewController&quot;/> <entry key=&quot;edit&quot; value-ref=&quot;editController&quot;/> <entry key=&quot;help&quot; value-ref=&quot;helpController&quot;/> </map> </property> </bean> <bean id=&quot;viewController&quot; class=&quot;ViewController&quot;/> ...
ParameterHandlerMapping ,[object Object],<bean id=&quot;handlerMapping“ class=&quot;org.springframework.web.portlet.handler. ParameterHandlerMapping&quot;> <property name=&quot;parameterMap&quot;> <map> <entry key=&quot;add&quot; value-ref=&quot;addHandler&quot;/> <entry key=&quot;remove&quot; value-ref=&quot;removeHandler&quot;/> </map> </property> </bean>
PortletModeParameterHandlerMapping <bean id=&quot;handlerMapping&quot; class=&quot;…PortletModeParameterHandlerMapping&quot;>  <property name=&quot;portletModeParameterMap&quot;> <map> <entry key=&quot;view&quot;> <map> <entry key=&quot;add&quot; value-ref=&quot;addHandler&quot;/> <entry key=&quot;remove&quot; value-ref=&quot;removeHandler&quot;/> </map> </entry> <entry key=&quot;edit&quot;> <map> <entry key=&quot;prefs” value-ref=&quot;prefsHandler&quot;/> </map> </entry> </map> </property> </bean>
More on  HandlerMapping ,[object Object],[object Object]
Mapping and Portlet Lifecycle ,[object Object],[object Object],[object Object]
Controllers & AbstractController ,[object Object]
Controllers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Most of these become obsolete in Spring 2.5 because the Annotation-based Mapping is now preferred
The Controller Interface public interface  Controller  { ModelAndView  handleRenderRequest  ( RenderRequest request, RenderResponse response)  throws Exception; void  handleActionRequest  ( ActionRequest request, ActionResponse response)  throws Exception; }
PortletModeNameViewController ,[object Object],[object Object],[object Object]
AbstractController ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Form Controllers ,[object Object]
Command Controllers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleFormController ,[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleFormController Form ,[object Object],[object Object],[object Object],[object Object],[object Object]
SimpleFormController Submit ,[object Object],[object Object],[object Object],[object Object]
AbstractWizardFormController ,[object Object],[object Object],[object Object],[object Object],[object Object]
More AbstractWizardFormController ,[object Object],[object Object],[object Object],[object Object],[object Object]
Annotation-Based Controllers ,[object Object]
Annotation-Based Controllers ,[object Object],[object Object],[object Object],[object Object]
Annotation Bean Definitions <context:annotation-config/> <bean class=&quot;org.springframework.web.portlet.mvc. annotation.DefaultAnnotationHandlerMapping&quot;> <property name=&quot;interceptors&quot;> <bean class=&quot;org.springframework.web.portlet.handler. ParameterMappingInterceptor&quot;/> </property> </bean> <bean class=&quot; org.sample.MyView Controller&quot;/> <bean class=&quot;org.sample.MyEditController&quot;/> <bean class=&quot;org.sample.MyHelpController&quot;/>
Spring MVC Annotations ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dispatching Annotation Examples @Controller @RequestMapping(&quot;VIEW&quot;) @SessionAttributes(&quot;item&quot;) public class  MyViewController  { @RequestMapping public String listItems(Model model) { model.addAttribute(&quot;items&quot;,  this.itemService.getAllItems()); return &quot;itemList&quot;; } @RequestMapping(params=&quot;action=view&quot;) public String viewPet( @RequestParam(&quot;item&quot;)  int itemId, Model model) { model.addAttribute(&quot;item&quot;, this.itemService.getItem(itemId)); return &quot;itemDetails&quot;; } ...
Dispatching Annotation Examples ... @ModelAttribute(&quot;dateFormat&quot;) protected String dateFormat(PortletPreferences prefs) { return preferences.getValue(&quot;dateFormat&quot;,  itemService.DEFAULT_DATE_FORMAT); } @InitBinder public void initBinder(PortletRequestDataBinder binder, PortletPreferences preferences) { String format = preferences.getValue(&quot;dateFormat&quot;, ItemService.DEFAULT_DATE_FORMAT); SimpleDateFormat dateFormat =  new SimpleDateFormat(formatString); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); } ...
Handler Interceptors ,[object Object]
HandlerInterceptor ,[object Object],[object Object],[object Object],[object Object]
HandlerInterceptor Interface public interface  HandlerInterceptor  { boolean  preHandleAction ( ActionRequest request, ActionResponse response, Object handler) throws Exception; void  afterActionCompletion ( ActionRequest request, ActionResponse response, Object handler, Exception ex) throws Exception; boolean  preHandleRender ( RenderRequest request, RenderResponse response, Object handler) throws Exception; void  postHandleRender ( RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) throws Exception; void  afterRenderCompletion ( RenderRequest request, RenderResponse response, Object handler, Exception ex) throws Exception; }
Useful Portlet Interceptors ,[object Object],[object Object]
Configuring Interceptors <bean id=&quot;parameterMappingInterceptor&quot;  class=&quot;org.springframework.web.portlet.handler. ParameterMappingInterceptor&quot; /> <bean id=&quot;portletModeParameterHandlerMapping&quot; class=&quot;org.springframework.web.portlet.handler. PortletModeParameterHandlerMapping&quot;> <property name=&quot;interceptors&quot;> <list> <ref bean=&quot;parameterMappingInterceptor&quot;/> </list> </property> <property name=&quot;portletModeParameterMap&quot;> ... </property> </bean>
File Uploads & Redirects ,[object Object]
Handling File Uploads ,[object Object],[object Object],[object Object],[object Object],[object Object],<bean id=&quot;portletMultipartResolver&quot; class=&quot;org.springframework.web.portlet.multipart. CommonsPortletMultipartResolver&quot;> <property name=&quot;maxUploadSize“ value=“2048”/> </bean>
Performing Redirects ,[object Object],[object Object],[object Object]
Adapting Other Frameworks ,[object Object]
Adapting Other Frameworks ,[object Object],[object Object],[object Object],[object Object],[object Object]
Reuse Existing Portlets ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlet 2.0 (JSR 286) Support ,[object Object]
Major Changes in Portlet 2.0 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlet 2.0 In Spring 3.0 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Annotations for Portlet 2.0 Support ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Portlet 2.0 Examples @ActionMapping(”delete”) public void deleteItem(...) { ... } @EventMapping(”reload”) public void reloadData(...) { ... } @RenderMapping(&quot;maximized&quot;, params=&quot;action=search&quot;) public String displaySearch(...) { ... } @ResourceMapping(”picklist”) public ModelAndView pickList (...) {...}
Questions & Answers John A. Lewis Chief Software Architect Unicon, Inc. [email_address] www.unicon.net

Weitere ähnliche Inhalte

Was ist angesagt?

Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Tuna Tore
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture TutorialJava Success Point
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVCDzmitry Naskou
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892Tuna Tore
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Courseguest764934
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depthVinay Kumar
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component BehaviorsAndy Schwartz
 
Sun JSF Presentation
Sun JSF PresentationSun JSF Presentation
Sun JSF PresentationGaurav Dighe
 

Was ist angesagt? (20)

Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5Java Spring MVC Framework with AngularJS by Google and HTML5
Java Spring MVC Framework with AngularJS by Google and HTML5
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring MVC Architecture Tutorial
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture Tutorial
 
Spring MVC
Spring MVCSpring MVC
Spring MVC
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Spring MVC 3.0 Framework (sesson_2)
Spring MVC 3.0 Framework (sesson_2)Spring MVC 3.0 Framework (sesson_2)
Spring MVC 3.0 Framework (sesson_2)
 
SpringMVC
SpringMVCSpringMVC
SpringMVC
 
springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892springmvc-150923124312-lva1-app6892
springmvc-150923124312-lva1-app6892
 
Struts Introduction Course
Struts Introduction CourseStruts Introduction Course
Struts Introduction Course
 
Jsf2.0 -4
Jsf2.0 -4Jsf2.0 -4
Jsf2.0 -4
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
Spring framework in depth
Spring framework in depthSpring framework in depth
Spring framework in depth
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Sun JSF Presentation
Sun JSF PresentationSun JSF Presentation
Sun JSF Presentation
 

Ähnlich wie Spring Portlet MVC

Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC SeminarJohn Lewis
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksSunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworksSunil Patil
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Shiju Varghese
 
JEE Course - The Web Tier
JEE Course - The Web TierJEE Course - The Web Tier
JEE Course - The Web Tierodedns
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe
 
Spring MVC framework features and concepts
Spring MVC framework features and conceptsSpring MVC framework features and concepts
Spring MVC framework features and conceptsAsmaShaikh478737
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetIndiandotnet
 

Ähnlich wie Spring Portlet MVC (20)

Sprint Portlet MVC Seminar
Sprint Portlet MVC SeminarSprint Portlet MVC Seminar
Sprint Portlet MVC Seminar
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
MVC
MVCMVC
MVC
 
Spring mvc 2.0
Spring mvc 2.0Spring mvc 2.0
Spring mvc 2.0
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
JEE Course - The Web Tier
JEE Course - The Web TierJEE Course - The Web Tier
JEE Course - The Web Tier
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Marata
MarataMarata
Marata
 
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
SoftServe - "ASP.NET MVC як наступний крок у розвитку технології розробки Web...
 
Spring MVC framework features and concepts
Spring MVC framework features and conceptsSpring MVC framework features and concepts
Spring MVC framework features and concepts
 
Spring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 IntegrationSpring MVC 5 & Hibernate 5 Integration
Spring MVC 5 & Hibernate 5 Integration
 
MVC 4
MVC 4MVC 4
MVC 4
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
MVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - IndiandotnetMVC From Beginner to Advance in Indian Style by - Indiandotnet
MVC From Beginner to Advance in Indian Style by - Indiandotnet
 
Session 1
Session 1Session 1
Session 1
 

Mehr von John Lewis

Jasig uMobile - Open Source Enterprise Mobile Campus Solution
Jasig uMobile - Open Source Enterprise Mobile Campus SolutionJasig uMobile - Open Source Enterprise Mobile Campus Solution
Jasig uMobile - Open Source Enterprise Mobile Campus SolutionJohn Lewis
 
IMS LIS Outcomes and Sakai: Standardizing Grade Exchange
IMS LIS Outcomes and Sakai: Standardizing Grade ExchangeIMS LIS Outcomes and Sakai: Standardizing Grade Exchange
IMS LIS Outcomes and Sakai: Standardizing Grade ExchangeJohn Lewis
 
New Opportunites to Connect Learning with LIS and LTI
New Opportunites to Connect Learning with LIS and LTINew Opportunites to Connect Learning with LIS and LTI
New Opportunites to Connect Learning with LIS and LTIJohn Lewis
 
Open Source Your Project (With Jasig)
Open Source Your Project (With Jasig)Open Source Your Project (With Jasig)
Open Source Your Project (With Jasig)John Lewis
 
Sakai uPortal Integration Options
Sakai uPortal Integration OptionsSakai uPortal Integration Options
Sakai uPortal Integration OptionsJohn Lewis
 
Agile Engineering
Agile EngineeringAgile Engineering
Agile EngineeringJohn Lewis
 
Securing Portlets With Spring Security
Securing Portlets With Spring SecuritySecuring Portlets With Spring Security
Securing Portlets With Spring SecurityJohn Lewis
 
Shibboleth Guided Tour Webinar
Shibboleth Guided Tour WebinarShibboleth Guided Tour Webinar
Shibboleth Guided Tour WebinarJohn Lewis
 
Leveraging Open Source
Leveraging Open SourceLeveraging Open Source
Leveraging Open SourceJohn Lewis
 
Java Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJava Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJohn Lewis
 
Open Source Licensing
Open Source LicensingOpen Source Licensing
Open Source LicensingJohn Lewis
 
Real World Identity Managment
Real World Identity ManagmentReal World Identity Managment
Real World Identity ManagmentJohn Lewis
 

Mehr von John Lewis (13)

Jasig uMobile - Open Source Enterprise Mobile Campus Solution
Jasig uMobile - Open Source Enterprise Mobile Campus SolutionJasig uMobile - Open Source Enterprise Mobile Campus Solution
Jasig uMobile - Open Source Enterprise Mobile Campus Solution
 
IMS LIS Outcomes and Sakai: Standardizing Grade Exchange
IMS LIS Outcomes and Sakai: Standardizing Grade ExchangeIMS LIS Outcomes and Sakai: Standardizing Grade Exchange
IMS LIS Outcomes and Sakai: Standardizing Grade Exchange
 
New Opportunites to Connect Learning with LIS and LTI
New Opportunites to Connect Learning with LIS and LTINew Opportunites to Connect Learning with LIS and LTI
New Opportunites to Connect Learning with LIS and LTI
 
Open Source Your Project (With Jasig)
Open Source Your Project (With Jasig)Open Source Your Project (With Jasig)
Open Source Your Project (With Jasig)
 
Sakai uPortal Integration Options
Sakai uPortal Integration OptionsSakai uPortal Integration Options
Sakai uPortal Integration Options
 
Agile Engineering
Agile EngineeringAgile Engineering
Agile Engineering
 
Scrum Process
Scrum ProcessScrum Process
Scrum Process
 
Securing Portlets With Spring Security
Securing Portlets With Spring SecuritySecuring Portlets With Spring Security
Securing Portlets With Spring Security
 
Shibboleth Guided Tour Webinar
Shibboleth Guided Tour WebinarShibboleth Guided Tour Webinar
Shibboleth Guided Tour Webinar
 
Leveraging Open Source
Leveraging Open SourceLeveraging Open Source
Leveraging Open Source
 
Java Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) SpecificationJava Portlet 2.0 (JSR 286) Specification
Java Portlet 2.0 (JSR 286) Specification
 
Open Source Licensing
Open Source LicensingOpen Source Licensing
Open Source Licensing
 
Real World Identity Managment
Real World Identity ManagmentReal World Identity Managment
Real World Identity Managment
 

Kürzlich hochgeladen

Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 

Kürzlich hochgeladen (20)

Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 

Spring Portlet MVC

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Diagram from Java ™ Portlet Specification, Version 2.0 Public Draft
  • 7.
  • 8.
  • 9.
  • 10. Diagram from Java ™ Portlet Specification, Version 2.0 Public Draft
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Dispatcher (Servlet/Portlet) Request Handler Mapping View Resolver Response Controller View ModelAndView Map (Model) viewName
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. portlet.xml <portlet> <portlet-name>example</portlet-name> <portlet-class> org.springframework.web.portlet.DispatcherPortlet </portlet-class> <init-param> <name> contextConfigLocation </name> <value> /WEB-INF/context/example-portlet.xml </value> </init-param> <supports> <mime-type>text/html</mime-type> <portlet-mode>view</portlet-mode> <portlet-mode>edit</portlet-mode> <portlet-mode>help</portlet-mode> </supports> <portlet-info> <title>Example Portlet</title> </portlet-info> </portlet>
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. PortletModeHandlerMapping <bean id=&quot;portletModeHandlerMapping&quot; class=&quot;org.springframework.web.portlet.handler. PortletModeHandlerMapping&quot;> <property name=&quot;portletModeMap&quot;> <map> <entry key=&quot;view&quot; value-ref=&quot;viewController&quot;/> <entry key=&quot;edit&quot; value-ref=&quot;editController&quot;/> <entry key=&quot;help&quot; value-ref=&quot;helpController&quot;/> </map> </property> </bean> <bean id=&quot;viewController&quot; class=&quot;ViewController&quot;/> ...
  • 42.
  • 43. PortletModeParameterHandlerMapping <bean id=&quot;handlerMapping&quot; class=&quot;…PortletModeParameterHandlerMapping&quot;> <property name=&quot;portletModeParameterMap&quot;> <map> <entry key=&quot;view&quot;> <map> <entry key=&quot;add&quot; value-ref=&quot;addHandler&quot;/> <entry key=&quot;remove&quot; value-ref=&quot;removeHandler&quot;/> </map> </entry> <entry key=&quot;edit&quot;> <map> <entry key=&quot;prefs” value-ref=&quot;prefsHandler&quot;/> </map> </entry> </map> </property> </bean>
  • 44.
  • 45.
  • 46.
  • 47.
  • 48. The Controller Interface public interface Controller { ModelAndView handleRenderRequest ( RenderRequest request, RenderResponse response) throws Exception; void handleActionRequest ( ActionRequest request, ActionResponse response) throws Exception; }
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60. Annotation Bean Definitions <context:annotation-config/> <bean class=&quot;org.springframework.web.portlet.mvc. annotation.DefaultAnnotationHandlerMapping&quot;> <property name=&quot;interceptors&quot;> <bean class=&quot;org.springframework.web.portlet.handler. ParameterMappingInterceptor&quot;/> </property> </bean> <bean class=&quot; org.sample.MyView Controller&quot;/> <bean class=&quot;org.sample.MyEditController&quot;/> <bean class=&quot;org.sample.MyHelpController&quot;/>
  • 61.
  • 62. Dispatching Annotation Examples @Controller @RequestMapping(&quot;VIEW&quot;) @SessionAttributes(&quot;item&quot;) public class MyViewController { @RequestMapping public String listItems(Model model) { model.addAttribute(&quot;items&quot;, this.itemService.getAllItems()); return &quot;itemList&quot;; } @RequestMapping(params=&quot;action=view&quot;) public String viewPet( @RequestParam(&quot;item&quot;) int itemId, Model model) { model.addAttribute(&quot;item&quot;, this.itemService.getItem(itemId)); return &quot;itemDetails&quot;; } ...
  • 63. Dispatching Annotation Examples ... @ModelAttribute(&quot;dateFormat&quot;) protected String dateFormat(PortletPreferences prefs) { return preferences.getValue(&quot;dateFormat&quot;, itemService.DEFAULT_DATE_FORMAT); } @InitBinder public void initBinder(PortletRequestDataBinder binder, PortletPreferences preferences) { String format = preferences.getValue(&quot;dateFormat&quot;, ItemService.DEFAULT_DATE_FORMAT); SimpleDateFormat dateFormat = new SimpleDateFormat(formatString); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); } ...
  • 64.
  • 65.
  • 66. HandlerInterceptor Interface public interface HandlerInterceptor { boolean preHandleAction ( ActionRequest request, ActionResponse response, Object handler) throws Exception; void afterActionCompletion ( ActionRequest request, ActionResponse response, Object handler, Exception ex) throws Exception; boolean preHandleRender ( RenderRequest request, RenderResponse response, Object handler) throws Exception; void postHandleRender ( RenderRequest request, RenderResponse response, Object handler, ModelAndView modelAndView) throws Exception; void afterRenderCompletion ( RenderRequest request, RenderResponse response, Object handler, Exception ex) throws Exception; }
  • 67.
  • 68. Configuring Interceptors <bean id=&quot;parameterMappingInterceptor&quot; class=&quot;org.springframework.web.portlet.handler. ParameterMappingInterceptor&quot; /> <bean id=&quot;portletModeParameterHandlerMapping&quot; class=&quot;org.springframework.web.portlet.handler. PortletModeParameterHandlerMapping&quot;> <property name=&quot;interceptors&quot;> <list> <ref bean=&quot;parameterMappingInterceptor&quot;/> </list> </property> <property name=&quot;portletModeParameterMap&quot;> ... </property> </bean>
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79. Portlet 2.0 Examples @ActionMapping(”delete”) public void deleteItem(...) { ... } @EventMapping(”reload”) public void reloadData(...) { ... } @RenderMapping(&quot;maximized&quot;, params=&quot;action=search&quot;) public String displaySearch(...) { ... } @ResourceMapping(”picklist”) public ModelAndView pickList (...) {...}
  • 80. Questions & Answers John A. Lewis Chief Software Architect Unicon, Inc. [email_address] www.unicon.net