-
Notifications
You must be signed in to change notification settings - Fork 2
Quickstart
1. With IDE
Milonga is executed on Spring MVC application. Let's start with Spring Tool Suite(STS).
2. New Spring MVC Project
Create new Spring MVC project. (File → New → Spring Project)
Input your own pakcage name and press the 'Next' button.
Spring MVC project created.
3. Milonga Installation
Need to set up Spring MVC 3.1+ version. Modify the version of Spring MVC on pom.xml.
<properties>
<java-version>1.6</java-version>
<org.springframework-version>3.2.3.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
Add the respository and dependency to Maven pom.xml.
<?xml version="1.0" encoding="UTF-8"?>
<project>
…
<dependencies>
…
<!-- Milonga -->
<dependency>
<groupId>com.skplanet</groupId>
<artifactId>milonga</artifactId>
<version>0.9.2</version>
</dependency>
</dependencies>
…
</project>
4. Milonga HandlerMapping 설정
There are two methods of installing Milonga. It depends on Spring configuration ways such as XML configuration and Java configuration.
- Spring XML Configuration
Custom tag for Milonga configuration is provided. Add Milonga tag to Spring configuration file. In this case you can define Milonga configuration to servlet-context.xml file.
<!-- Milonga Handler Mapping 추가 -->
<beans:bean class="com.skp.milonga.servlet.handler.AtmosRequestMappingHandlerMapping">
<beans:property name="userSourceLocation" value="WEB-INF/js" />
</beans:bean>
- Spring Java Configuration
If using Spring Java configuration, attach Milonga annotation to Spring Java configuration class.
...
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
...
import com.skp.milonga.config.annotation.EnableMilonga;
@Configuration
@EnableWebMvc
@EnableMilonga(locations = "WEB-INF/js-test", autoRefreshable = true)
public class AppConfig extends WebMvcConfigurerAdapter {
...
}
That's it. Milonga installation completed.
5. Make some Javascript code
Let's make some code. Create Javascript file in WEB-INF/js directory. Name the file sample.js and save it.
6. Check the result
Deploy web project to web application server(tc server) and start it. Then you can check the result on your browser.