This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang='en'> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
| <title> | |
| JSON Tutorial | |
| </title> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
| <script> | |
| function successFn(jsonData,status, xhr){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstdlib> | |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <cstring> | |
| #include <iterator> | |
| #include <algorithm> | |
| #include <math.h> | |
| #include <sstream> | |
| #include <cmath> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class App { | |
| private Service service; | |
| // A service object will be injected by Spring IoC container | |
| public App (Service service) { | |
| this.service = service; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <!-- ... --> | |
| <properties> | |
| <springframework.version>4.3.4.RELEASE</springframework.version> | |
| </properties> | |
| <dependencies> | |
| <!-- Apache Common Logging API --> | |
| <dependency> | |
| <groupId>commons-logging</groupId> | |
| <artifactId>commons-logging</artifactId> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class App { | |
| private int id; | |
| private String name; | |
| public App(){ | |
| } | |
| public App(int id){ | |
| this.id = id; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <beans xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xmlns:context="http://www.springframework.org/schema/context" | |
| xsi:schemaLocation=" | |
| http://www.springframework.org/schema/beans | |
| http://www.springframework.org/schema/beans/spring-beans-3.0.xsd | |
| http://www.springframework.org/schema/context | |
| http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- A simple bean definition --> | |
| <bean id="..." class="..."> | |
| <!-- dependencies and configuration for this bean go here --> | |
| </bean> | |
| <!-- App bean --> | |
| <bean id="app" class="App" lazy-init="true"></bean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.support.ClassPathXmlApplicationContext; | |
| public class Test { | |
| public static void main(String[] args) { | |
| ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.context.support.ClassPathXmlApplicationContext; | |
| public class Test { | |
| public static void main(String[] args) { | |
| ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); | |
| App app = context.getBean("app", App.class); | |
| // App app = (App) context.getBean("app"); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class App { | |
| private Service mainService; | |
| private Service[] services; | |
| /* same as before */ | |
| public App(Service main){ | |
| this.mainService = main; | |
| } | |
OlderNewer