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
package org.springframework.samples.async.chat; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; |
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:mvc="http://www.springframework.org/schema/mvc" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd"> | |
<mvc:annotation-driven/> | |
<mvc:default-servlet-handler /> | |
</beans> |
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
package cantabille.config; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.test.context.ContextConfiguration; | |
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | |
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; | |
/** |
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
package cantabille.config; | |
import cantabille.modules.ModulesPackageMarker; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.servlet.HandlerMapping; | |
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; | |
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
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
package pathvariable; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.test.web.server.MockMvc; | |
import org.springframework.test.web.server.setup.MockMvcBuilders; | |
import org.springframework.web.bind.annotation.PathVariable; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.ResponseBody; |
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 java.security.*; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.FileInputStream; | |
import java.io.DataInputStream; | |
import java.io.ByteArrayInputStream; | |
import java.io.FileOutputStream; | |
import java.security.spec.*; | |
import java.security.cert.Certificate; |
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 SampleWebAppInitializer implements WebApplicationInitializer { | |
@Override | |
public void onStartup(ServletContext servletContext) throws ServletException { | |
AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext(); | |
// ac.register(AppConfig.java); | |
ServletContextListener listener = new ContextLoaderListener(ac); | |
servletContext.addListener(listener); | |
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); |
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 FlashAPI { | |
@Test | |
public void makeFlashMap(){ | |
FlashMap fm = new FlashMap(); | |
fm.put("message", "hi"); | |
fm.setTargetRequestPath("/user/list"); | |
fm.startExpirationPeriod(10); | |
} |
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
<dependency> | |
<groupId>javax.servlet</groupId> | |
<artifactId>javax.servlet-api</artifactId> | |
<version>3.0.1</version> | |
</dependency> |
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
package cors; | |
import org.springframework.web.servlet.ModelAndView; | |
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
/** | |
* @author Keesun Baik |