Woothee Spring

Woothee integration with Spring MVC

License

License

GroupId

GroupId

am.ik.woothee
ArtifactId

ArtifactId

woothee-spring
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Woothee Spring
Woothee integration with Spring MVC
Project URL

Project URL

https://github.com/making/woothee-spring
Source Code Management

Source Code Management

https://github.com/making/woothee-spring

Download woothee-spring

How to add to project

<!-- https://jarcasting.com/artifacts/am.ik.woothee/woothee-spring/ -->
<dependency>
    <groupId>am.ik.woothee</groupId>
    <artifactId>woothee-spring</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/am.ik.woothee/woothee-spring/
implementation 'am.ik.woothee:woothee-spring:1.0.0'
// https://jarcasting.com/artifacts/am.ik.woothee/woothee-spring/
implementation ("am.ik.woothee:woothee-spring:1.0.0")
'am.ik.woothee:woothee-spring:jar:1.0.0'
<dependency org="am.ik.woothee" name="woothee-spring" rev="1.0.0">
  <artifact name="woothee-spring" type="jar" />
</dependency>
@Grapes(
@Grab(group='am.ik.woothee', module='woothee-spring', version='1.0.0')
)
libraryDependencies += "am.ik.woothee" % "woothee-spring" % "1.0.0"
[am.ik.woothee/woothee-spring "1.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework : spring-webmvc jar
is.tagomor.woothee : woothee-java jar 1.0.0

test (1)

Group / Artifact Type Version
junit : junit jar

Project Modules

There are no modules declared in this project.

Woothee Spring

Woothee integration with Spring MVC

<dependency>
    <groupId>am.ik.woothee</groupId>
    <artifactId>woothee-spring</artifactId>
    <version>1.0.0</version>
</dependency>

How to use

This example uses Spring Boot (+ Java Config)

import am.ik.woothee.Woothee;
import am.ik.woothee.spring.WootheeMethodArgumentResolver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

@SpringBootApplication
@RestController
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @Configuration
    static class WootheeConfig extends WebMvcConfigurerAdapter {
        @Override
        public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
            argumentResolvers.add(new WootheeMethodArgumentResolver()); // add
        }
    }

    @RequestMapping(value = "/")
    String hello(Woothee woothee /* add */) {
        System.out.println(woothee); // WootheeData{category='pc', name='Chrome', version='39.0.2171.95', os='Mac OSX', vendor=Google, osVersion=10.9.5}
        return "Hello World!";
    }
}

In case of XML configuration:

<mvc:annotation-driven>
    <mvc:argument-resolvers>
        <bean
            class="am.ik.woothee.spring.WootheeMethodArgumentResolver" /><!-- add -->
    </mvc:argument-resolvers>
</mvc:annotation-driven>

License

Licensed under the Apache License, Version 2.0.

Versions

Version
1.0.0