The document is a presentation on the Spring Expression Language (SpEL). It provides an overview of what SpEL is, how it can be used to configure beans and in programming, and demonstrations of essential SpEL features like literals, operators, and accessing object members. The presentation contains an agenda that covers introducing SpEL, using it, essentials, examples, and Q&A. It encourages downloading example code and dives into SpEL syntax and capabilities.
This document summarizes 15 rumors about the upcoming iPhone 5 release in 2011. Some of the most credible rumors include that Sprint and Verizon will carry the iPhone 5 (★★★), it will be a global phone supporting both CDMA and GSM networks (★★★), and it will feature an upgraded A5 processor twice as fast as the iPhone 4 (★★★★). The rumors also suggest the iPhone 5 may have a larger screen closer to the edge, upgraded 8MP camera, and release in early October.
The document discusses modular Java and OSGi. It introduces OSGi as a modularity specification for Java that provides an intra-VM service-oriented architecture. OSGi addresses issues with modularity in Java by allowing modules, known as bundles, to be installed, started, stopped, updated, and uninstalled dynamically at runtime. This helps solve problems like JAR hell by allowing multiple versions of classes to exist simultaneously. The document provides an overview of OSGi concepts and some popular open source OSGi implementations.
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
Slides from my talk introducing Spring Boot. Unfortunately, this talk is 90% live-coding, so I'll post the relevant video recording here when it's available.
Spring MVC est un framwork qui permet d’implémenter des applications selon le design pattern MVC.
Ce n'est pas un framework événementiel comme pourraient l'être jsf, wicket, tapestry ou struts 2. Mais il possède de nombreux points
d'extensions et utilisé avec Spring Web Flow il devient un framework très puissant.
This document discusses Spring Boot and how it provides automatic configuration for common web application functionalities like JPA, security, and Spring MVC. It also covers how Spring Boot uses starter dependencies to select libraries automatically and provides tools like the CLI and Spring Initializr. The document then demonstrates creating a basic Spring Boot application and discusses testing Spring Boot applications using techniques like mocking Spring MVC and integrating tests.
This document summarizes 15 rumors about the upcoming iPhone 5 release in 2011. Some of the most credible rumors include that Sprint and Verizon will carry the iPhone 5 (★★★), it will be a global phone supporting both CDMA and GSM networks (★★★), and it will feature an upgraded A5 processor twice as fast as the iPhone 4 (★★★★). The rumors also suggest the iPhone 5 may have a larger screen closer to the edge, upgraded 8MP camera, and release in early October.
The document discusses modular Java and OSGi. It introduces OSGi as a modularity specification for Java that provides an intra-VM service-oriented architecture. OSGi addresses issues with modularity in Java by allowing modules, known as bundles, to be installed, started, stopped, updated, and uninstalled dynamically at runtime. This helps solve problems like JAR hell by allowing multiple versions of classes to exist simultaneously. The document provides an overview of OSGi concepts and some popular open source OSGi implementations.
Spring boot is a great and relatively a new project from Spring.io. The presentation discusses about basics of spring boot to advance topics. Sample demo apps are available here : https://github.com/bhagwat/spring-boot-samples
Slides from my talk introducing Spring Boot. Unfortunately, this talk is 90% live-coding, so I'll post the relevant video recording here when it's available.
Spring MVC est un framwork qui permet d’implémenter des applications selon le design pattern MVC.
Ce n'est pas un framework événementiel comme pourraient l'être jsf, wicket, tapestry ou struts 2. Mais il possède de nombreux points
d'extensions et utilisé avec Spring Web Flow il devient un framework très puissant.
This document discusses Spring Boot and how it provides automatic configuration for common web application functionalities like JPA, security, and Spring MVC. It also covers how Spring Boot uses starter dependencies to select libraries automatically and provides tools like the CLI and Spring Initializr. The document then demonstrates creating a basic Spring Boot application and discusses testing Spring Boot applications using techniques like mocking Spring MVC and integrating tests.
Building RESTful applications using Spring MVCIndicThreads
REST is an alternate and simpler approach for implementing WebServices. It is based on the HTTP protocol and hence leverages a lot of existing infrastructures. It uses an uniform interface thus making it easy to build client applications. In this session we will look at the fundamental concepts behind REST (Resource, URI, Stateless Conversation ..) and how to apply it in the context of a real applcation. We will also discuss the pros & cons of RESTful vs Soap based webservices. We will discuss the design of RESTful application and then look at how to implement it using Spring MVC.
Spring Framework 4.0 is the latest generation of the popular open source framework for Enterprise Java developers, focusing on the future with support for Java SE 8 and Java EE 7. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models made possible with the adoption of JDK 8 language features and APIs.
Specifically, this talk will cover support for lambda expressions and method references against Spring callback interfaces, JSR-310 Date-Time value types for Spring data binding and formatting, Spring's new @Conditional mechanism for activation of bean definitions, and a new WebSocket endpoint model. The presentation also provides an overview of Spring 4.0's updated support for enterprise APIs such as JMS 2.0, JPA 2.1, Bean Validation 1.1, Servlet 3.1, and JCache. Last but not least, Sam will highlight some of the major themes for the upcoming Spring Framework 4.1 release such as support for JCache 1.0 annotations, annotation-driven JMS listeners, and testing improvements.
Spring Boot is a framework that makes it easy to create stand-alone, production-grade Spring based Applications that can be "just run". It takes an opinionated view of the Spring platform and third-party libraries so that new and existing Spring developers can quickly get started with minimal configuration. Key features include automatic configuration of Spring, embedded HTTP servers, starters for common dependencies, and monitoring endpoints.
Spring Boot is a framework for creating stand-alone, production-grade Spring based Applications that can be "just run". It provides starters for auto-configuration of common Spring and third-party libraries providing features like Thymeleaf, Spring Data JPA, Spring Security, and testing. It aims to remove boilerplate configuration and promote "convention over configuration" for quick development. The document then covers how to run a basic Spring Boot application, use Rest Controllers, Spring Data JPA, Spring Security, and testing. It also discusses deploying the application on a web server and customizing through properties files.
The document discusses building RESTful applications with Spring MVC. It covers the pillars of REST including resources, URIs, HTTP methods, and representations. It provides examples of modeling resources as controllers and mapping HTTP methods to controller actions. It also discusses content negotiation, supporting different data representations like JSON, XML and RSS using Spring views.
SOAP Web Services have a well established role in the enterprise, but aside from the many benefits of the WS-* standards, SOAP and XML also carry additional baggage for developers. Consequently, REST Web Services are gaining tremendous popularity within the developer community. This session will begin by comparing and contrasting the basic concepts of both SOAP and REST Web Services. Building on that foundation, Sam Brannen will show attendees how to implement SOAP-based applications using Spring-WS 2.0. He will then demonstrate how to build a similar REST-ful application using Spring MVC 3.0. The session will conclude with an in-depth look at both server-side and client-side development as well as efficient integration testing of Web Services using the Spring Framework.
Josh Long is a Spring Developer Advocate at Pivotal. He discusses various Spring and microservices related topics including:
- The single responsibility principle and how it relates to microservices and Unix tools.
- Exposing services simply using REST which has no strict rules but embraces HTTP verbs and status codes.
- The Richardson Maturity Model for grading APIs on their REST compliance from Level 0 to Level 3.
- Security topics like OAuth, SSL/TLS, and ensuring applications are production ready with monitoring and management.
A presentation on how to implement RESTful Web Services with Spring MVC. This slide covers how to identify resources, use HTTP verbs, implement representations, use cache and so on.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Building RESTful applications using Spring MVCIndicThreads
REST is an alternate and simpler approach for implementing WebServices. It is based on the HTTP protocol and hence leverages a lot of existing infrastructures. It uses an uniform interface thus making it easy to build client applications. In this session we will look at the fundamental concepts behind REST (Resource, URI, Stateless Conversation ..) and how to apply it in the context of a real applcation. We will also discuss the pros & cons of RESTful vs Soap based webservices. We will discuss the design of RESTful application and then look at how to implement it using Spring MVC.
Spring Framework 4.0 is the latest generation of the popular open source framework for Enterprise Java developers, focusing on the future with support for Java SE 8 and Java EE 7. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models made possible with the adoption of JDK 8 language features and APIs.
Specifically, this talk will cover support for lambda expressions and method references against Spring callback interfaces, JSR-310 Date-Time value types for Spring data binding and formatting, Spring's new @Conditional mechanism for activation of bean definitions, and a new WebSocket endpoint model. The presentation also provides an overview of Spring 4.0's updated support for enterprise APIs such as JMS 2.0, JPA 2.1, Bean Validation 1.1, Servlet 3.1, and JCache. Last but not least, Sam will highlight some of the major themes for the upcoming Spring Framework 4.1 release such as support for JCache 1.0 annotations, annotation-driven JMS listeners, and testing improvements.
Spring Boot is a framework that makes it easy to create stand-alone, production-grade Spring based Applications that can be "just run". It takes an opinionated view of the Spring platform and third-party libraries so that new and existing Spring developers can quickly get started with minimal configuration. Key features include automatic configuration of Spring, embedded HTTP servers, starters for common dependencies, and monitoring endpoints.
Spring Boot is a framework for creating stand-alone, production-grade Spring based Applications that can be "just run". It provides starters for auto-configuration of common Spring and third-party libraries providing features like Thymeleaf, Spring Data JPA, Spring Security, and testing. It aims to remove boilerplate configuration and promote "convention over configuration" for quick development. The document then covers how to run a basic Spring Boot application, use Rest Controllers, Spring Data JPA, Spring Security, and testing. It also discusses deploying the application on a web server and customizing through properties files.
The document discusses building RESTful applications with Spring MVC. It covers the pillars of REST including resources, URIs, HTTP methods, and representations. It provides examples of modeling resources as controllers and mapping HTTP methods to controller actions. It also discusses content negotiation, supporting different data representations like JSON, XML and RSS using Spring views.
SOAP Web Services have a well established role in the enterprise, but aside from the many benefits of the WS-* standards, SOAP and XML also carry additional baggage for developers. Consequently, REST Web Services are gaining tremendous popularity within the developer community. This session will begin by comparing and contrasting the basic concepts of both SOAP and REST Web Services. Building on that foundation, Sam Brannen will show attendees how to implement SOAP-based applications using Spring-WS 2.0. He will then demonstrate how to build a similar REST-ful application using Spring MVC 3.0. The session will conclude with an in-depth look at both server-side and client-side development as well as efficient integration testing of Web Services using the Spring Framework.
Josh Long is a Spring Developer Advocate at Pivotal. He discusses various Spring and microservices related topics including:
- The single responsibility principle and how it relates to microservices and Unix tools.
- Exposing services simply using REST which has no strict rules but embraces HTTP verbs and status codes.
- The Richardson Maturity Model for grading APIs on their REST compliance from Level 0 to Level 3.
- Security topics like OAuth, SSL/TLS, and ensuring applications are production ready with monitoring and management.
A presentation on how to implement RESTful Web Services with Spring MVC. This slide covers how to identify resources, use HTTP verbs, implement representations, use cache and so on.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
2. About me
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
3. About me
• Java, Spring, and OSGi fanatic
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
4. About me
• Java, Spring, and OSGi fanatic
• Principal consultant with
Improving Enterprises
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
5. About me
• Java, Spring, and OSGi fanatic
• Principal consultant with
Improving Enterprises
• Author
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
6. About me
• Java, Spring, and OSGi fanatic
• Principal consultant with
Improving Enterprises
• Author
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
7. Agenda
3
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
8. Agenda
• Introducing SpEL
3
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
9. Agenda
• Introducing SpEL
• Using SpEL
3
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
10. Agenda
• Introducing SpEL
• Using SpEL
• SpEL Essentials
3
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
11. Agenda
• Introducing SpEL
• Using SpEL
• SpEL Essentials
• A few SpEL incantations
3
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
12. Agenda
• Introducing SpEL
• Using SpEL
• SpEL Essentials
• A few SpEL incantations
• Q&A
3
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
13. Download the examples
Approximately the same code...
http://spring.habuma.com/examples/SpEL-examples.zip
4
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
14. Introducing SpEL
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
15. What is SpEL
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
16. What is SpEL
• New in Spring 3.0
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
17. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
18. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
• The Spring Expression Language
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
19. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
• The Spring Expression Language
• Much like Unified EL, OGNL, JBoss EL, and others
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
20. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
• The Spring Expression Language
• Much like Unified EL, OGNL, JBoss EL, and others
• Will be used across entire Spring portfolio
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
21. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
• The Spring Expression Language
• Much like Unified EL, OGNL, JBoss EL, and others
• Will be used across entire Spring portfolio
• Succinctly express complex concepts
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
22. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
• The Spring Expression Language
• Much like Unified EL, OGNL, JBoss EL, and others
• Will be used across entire Spring portfolio
• Succinctly express complex concepts
• Can be used to wire bean properties
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
23. What is SpEL
• New in Spring 3.0
– Originally conceived in Spring.NET
• The Spring Expression Language
• Much like Unified EL, OGNL, JBoss EL, and others
• Will be used across entire Spring portfolio
• Succinctly express complex concepts
• Can be used to wire bean properties
• Can be used outside of Spring
6
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
24. Using SpEL
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
25. Configuring beans with SpEL (XML)
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
26. Configuring beans with SpEL (XML)
<bean id="appConfigurer"
class="com.habuma.spel.tests.Witch">
<property name="name"
value="#{systemProperties['WITCH_NAME']}" />
</bean>
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
27. Configuring beans with SpEL (@Value)
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
28. Configuring beans with SpEL (@Value)
@Component
public class Wizard {
@Value("#{systemEnvironment['WIZARD_NAME']}")
private String name;
// ...
}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
29. Programming with SpEL
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
30. Programming with SpEL
ExpressionParser parser = new SpelAntlrExpressionParser();
StandardEvaluationContext context =
new StandardEvaluationContext(rootObject);
Expression ex =
parser.parseExpression("witches.^[isWicked()]");
Witch wickedWitch = (Witch) ex.getValue(context);
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
31. Essential SpEL
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
32. Literal expressions
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
33. Literal expressions
#{'abracadabra'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
34. Literal expressions
#{'abracadabra'}
#{42}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
35. Literal expressions
#{'abracadabra'}
#{42} #{3.1415926}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
36. Literal expressions
#{'abracadabra'}
#{42} #{3.1415926}
#{1e4}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
37. Literal expressions
#{'abracadabra'}
#{42} #{3.1415926}
#{1e4}
#{true}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
38. Literal expressions
#{'abracadabra'}
#{42} #{3.1415926}
#{1e4}
#{true} #{false}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
39. Literal expressions
#{'abracadabra'}
#{42} #{3.1415926}
#{1e4}
#{true} #{false}
#{null}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
40. Ready-to-use variables
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
41. Ready-to-use variables
#{systemProperties['WIZARD_NAME']}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
42. Ready-to-use variables
#{systemProperties['WIZARD_NAME']}
#{systemProperties.WIZARD_NAME}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
43. Ready-to-use variables
#{systemProperties['WIZARD_NAME']}
#{systemProperties.WIZARD_NAME}
#{systemEnvironment['WIZARD_NAME']}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
44. Ready-to-use variables
#{systemProperties['WIZARD_NAME']}
#{systemProperties.WIZARD_NAME}
#{systemEnvironment['WIZARD_NAME']}
#{systemEnvironment.WIZARD_NAME}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
45. Ready-to-use variables
#{systemProperties['WIZARD_NAME']}
#{systemProperties.WIZARD_NAME}
#{systemEnvironment['WIZARD_NAME']}
#{systemEnvironment.WIZARD_NAME}
#{wizardBean.name}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
46. Ready-to-use variables
#{systemProperties['WIZARD_NAME']}
#{systemProperties.WIZARD_NAME}
#{systemEnvironment['WIZARD_NAME']}
#{systemEnvironment.WIZARD_NAME}
#{wizardBean.name}
Only available when using SpEL in Spring configuration
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
47. Ready-to-use variables
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
48. Ready-to-use variables
#{request.getParameter('wizardId')}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
49. Ready-to-use variables
#{request.getParameter('wizardId')}
#{session.getAttribute('wizard')}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
50. Ready-to-use variables
#{request.getParameter('wizardId')}
#{session.getAttribute('wizard')}
Can only be used to configure appropriately-scoped beans
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
51. Constructors
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
52. Constructors
#{new com.habuma.spel.tests.Wizard('Gandalf')}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
53. Constructors
#{new com.habuma.spel.tests.Wizard('Gandalf')}
#{new String('hokus pokus')}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
54. Accessing object members
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
55. Accessing object members
#{elf.name}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
56. Accessing object members
#{elf.name}
#{elf.Name}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
57. Accessing object members
#{elf.name}
#{elf.Name}
#{elf.getName()}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
58. Accessing object members
#{elf.name}
#{elf.Name}
#{elf.getName()}
#{elf.name?.length()}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
59. Mixing expressions and text
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
60. Mixing expressions and text
Embeds the wizard’s
name in some text
The wizard’s name is #{wizard.name}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
61. Arithmetic operators
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
62. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
63. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
64. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52} #{2.19 + 2.02}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
65. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52} #{2.19 + 2.02}
#{77 - 25}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
66. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52} #{2.19 + 2.02}
#{77 - 25} #{52 - -25}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
67. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52} #{2.19 + 2.02}
#{77 - 25} #{52 - -25}
#{6 * 7}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
68. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52} #{2.19 + 2.02}
#{77 - 25} #{52 - -25}
#{6 * 7} #{42 / 6}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
69. Arithmetic operators
#{'Harry' + ' ' + 'Potter'}
#{25 + 52} #{2.19 + 2.02}
#{77 - 25} #{52 - -25}
#{6 * 7} #{42 / 6}
#{44 % 7}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
70. Relational operators
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
71. Relational operators
#{42 > 7}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
72. Relational operators
#{42 > 7} #{7 > 42}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
73. Relational operators
#{42 > 7} #{7 > 42}
#{10000 == 1e4}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
74. Relational operators
#{42 > 7} #{7 > 42}
#{10000 == 1e4}
#{‘Apple’ == ‘Apple’}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
75. Relational operators
#{42 > 7} #{7 > 42}
#{10000 == 1e4}
#{‘Apple’ == ‘Apple’}
#{‘Apple’ < ‘Orange’}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
76. Relational operators
#{42 > 7} #{7 > 42}
#{10000 == 1e4}
#{‘Apple’ == ‘Apple’}
#{‘Apple’ < ‘Orange’} #{‘Orange’ > ‘Apple’}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
77. Logical operators
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
78. Logical operators
#{witch.isWicked() and witch.name == 'Elphaba'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
79. Logical operators
#{witch.isWicked() and witch.name == 'Elphaba'}
#{witch.isWicked() or witch.name == 'Tattypoo'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
80. Logical operators
#{witch.isWicked() and witch.name == 'Elphaba'}
#{witch.isWicked() or witch.name == 'Tattypoo'}
#{!witch.isWicked()}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
81. Ternary and Elvis operator
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
82. Ternary and Elvis operator
#{wizard.isGood() ? 'Gandalf' : 'Saruman'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
83. Ternary and Elvis operator
#{wizard.isGood() ? 'Gandalf' : 'Saruman'}
#{wizard.name ?: 'unknown'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
84. The type operator : T()
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
85. The type operator : T()
#{T(String)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
86. The type operator : T()
#{T(String)}
#{T(Math)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
87. The type operator : T()
#{T(String)}
#{T(Math)}
#{T(int)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
88. The type operator : T()
#{T(String)}
#{T(Math)}
#{T(int)}
#{T(java.util.Date)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
89. Accessing class members
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
90. Accessing class members
#{T(Math).floor(42.56)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
91. Accessing class members
#{T(Math).floor(42.56)}
#{T(Math).PI}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
92. instanceof
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
93. instanceof
#{‘Sabrina’ instanceof T(String)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
94. instanceof
#{‘Sabrina’ instanceof T(String)}
#{123 instanceof T(Integer)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
95. instanceof
#{‘Sabrina’ instanceof T(String)}
#{123 instanceof T(Integer)}
#{123L instanceof T(Long)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
96. instanceof
#{‘Sabrina’ instanceof T(String)}
#{123 instanceof T(Integer)}
#{123L instanceof T(Long)}
#{1.23 instanceof T(Double)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
97. instanceof
#{‘Sabrina’ instanceof T(String)}
#{123 instanceof T(Integer)}
#{123L instanceof T(Long)}
#{1.23 instanceof T(Double)}
#{true instanceof T(Boolean)}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
98. Regular expressions
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
99. Regular expressions
#{phoneNumber matches 'd{3}-d{3}-d{4}'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
100. Regular expressions
#{phoneNumber matches 'd{3}-d{3}-d{4}'}
#{websiteUrl matches
'http://www.[a-zA-Z0-9]*.(com|edu|net)'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
101. Regular expressions
#{phoneNumber matches 'd{3}-d{3}-d{4}'}
#{websiteUrl matches
'http://www.[a-zA-Z0-9]*.(com|edu|net)'}
#{customerEmail matches
'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}'}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
102. Setting variables
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
103. Setting variables
Assuming that the root object has a name property...
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
104. Setting variables
Assuming that the root object has a name property...
name = 'Broomhilda'
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
106. Accessing collection members
Arrays
#{wizards[0]}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
107. Accessing collection members
Arrays
#{wizards[0]}
Maps and Properties
#{magicWords['abracadabra']}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
108. Collection selection
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
109. Collection selection
Select all witches that aren’t wicked
#{witches.?[!isWicked()]}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
110. Collection selection
Select all witches that aren’t wicked
#{witches.?[!isWicked()]}
Select the first wicked witch
#{witches.^[isWicked()]}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
111. Collection selection
Select all witches that aren’t wicked
#{witches.?[!isWicked()]}
Select the first wicked witch
#{witches.^[isWicked()]}
Select the last wicked witch
#{witches.$[isWicked()]}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
112. Collection projection
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
113. Collection projection
Get the names of all wizards
#{wizards.![name]}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
114. The #this variable
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
115. The #this variable
Get the names of all wizards whose
name is lexically ordered after ‘G’
#{wizards.![name].?[#this > 'G']}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
116. Adding a custom function
Only available with programmatic SpEL
31
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
117. Adding a custom function
Only available with programmatic SpEL
context = new StandardEvaluationContext();
parser = new SpelAntlrExpressionParser();
context.registerFunction("inEnglish",
EnglishNumberInator.class.getDeclaredMethod(
"translate", new Class[] {int.class}));
31
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
118. Adding a custom function
Only available with programmatic SpEL
context = new StandardEvaluationContext();
parser = new SpelAntlrExpressionParser();
context.registerFunction("inEnglish",
EnglishNumberInator.class.getDeclaredMethod(
"translate", new Class[] {int.class}));
Expression ex = parser.parseExpression("#inEnglish(123)");
String englishNumber = ex.getValue(context);
31
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
119. Demo
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
120. A few SpEL incantations
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
121. Wiring in a system property
(with a default)
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
122. Wiring in a system property
(with a default)
<bean class="Wizard">
<property name="name"
value=
"#{systemProperties['WIZARD_NAME'] ?: 'Gandalf'}" />
</bean>
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
123. Wiring bean references
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
125. Wiring bean references
@Value("#{pricingService}")
private PricingService pricingService;
...or...
<property name="pricingService"
value="#{pricingService}" />
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
126. Wiring bean references
@Value("#{pricingService}")
private PricingService pricingService;
...or...
<property name="pricingService"
value="#{pricingService}" />
Don’t do this!
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
127. Wiring bean references
@Value("#{pricingService}")
private PricingService pricingService;
...or...
<property name="pricingService"
value="#{pricingService}" />
Don’t do this!
However...
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
128. Selective bean wiring
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
129. Selective bean wiring
@Value("#{systemProperties['PRICING'] == 'aggressive'"
+ "? aggressivePricing : regularPricing}")
private PricingService pricingService;
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
131. Selective collection wiring
public interface TaxRule {
boolean appliesToState(String state);
double calculateTax(double base);
}
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
132. Selective collection wiring
<util:list id="taxRules">
public interface TaxRule { <ref id="revenueTax" />
boolean appliesToState(String state); <ref id="carpetTax" />
double calculateTax(double base); <ref id="existenceTax" />
} <ref id="justBecauseTax" />
</util:list>
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
133. Selective collection wiring
<util:list id="taxRules">
public interface TaxRule { <ref id="revenueTax" />
boolean appliesToState(String state); <ref id="carpetTax" />
double calculateTax(double base); <ref id="existenceTax" />
} <ref id="justBecauseTax" />
</util:list>
<bean id="taxProcessor" class="TaxProcessor"
scope="session">
<aop:scoped-proxy />
<property name="taxRules" value=
"#{taxRules.?[appliesToState(session.getAttribute('user').state)]}" />
</bean>
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
134. Parting thoughts
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
135. Parting thoughts
• SpEL expressions are great for doing Spring
configuration magic
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
136. Parting thoughts
• SpEL expressions are great for doing Spring
configuration magic
• SpEL expressions are just Strings...no compile-
time help to ensure type-safety, syntax, etc.
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
137. Parting thoughts
• SpEL expressions are great for doing Spring
configuration magic
• SpEL expressions are just Strings...no compile-
time help to ensure type-safety, syntax, etc.
• Don’t abuse SpEL
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
138. Parting thoughts
• SpEL expressions are great for doing Spring
configuration magic
• SpEL expressions are just Strings...no compile-
time help to ensure type-safety, syntax, etc.
• Don’t abuse SpEL
– Remember Goethe’s Sorcerer’s Apprentice
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
139. Parting thoughts
• SpEL expressions are great for doing Spring
configuration magic
• SpEL expressions are just Strings...no compile-
time help to ensure type-safety, syntax, etc.
• Don’t abuse SpEL
– Remember Goethe’s Sorcerer’s Apprentice
– A little bit of magic in the wrong hands can be
dangerous
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
140. Parting thoughts
• SpEL expressions are great for doing Spring
configuration magic
• SpEL expressions are just Strings...no compile-
time help to ensure type-safety, syntax, etc.
• Don’t abuse SpEL
– Remember Goethe’s Sorcerer’s Apprentice
– A little bit of magic in the wrong hands can be
dangerous
• Write tests!!!
38
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.
141. Q&A
Thank you!
Don’t forget to turn in your evaluations!!!
SpringOne 2GX 2009. All rights reserved. Do not distribute without permission.