com.silentgo:framework

Light Java MVC Framework

License

License

MIT
GroupId

GroupId

com.silentgo
ArtifactId

ArtifactId

framework
Last Version

Last Version

0.0.49
Release Date

Release Date

Type

Type

jar
Description

Description

Light Java MVC Framework

Download framework

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
cglib : cglib-nodep jar 3.2.4

provided (4)

Group / Artifact Type Version
com.silentgo : utils jar 0.1.15
com.silentgo : orm jar 0.3.1
javax.servlet : javax.servlet-api jar 3.1.0
net.sf.ehcache : ehcache jar 2.10.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

SilentGo Framework

a light web mvc framework.

framework CN Readme
framework Readme
Demo

TODO LIST

  • dao支持linq语法糖
  • framework route部分规整
  • sql template render , support cusotm syntax , xml, yaml

How to Use

add maven dependency

<dependency>
    <groupId>com.silentgo</groupId>
    <artifactId>framework</artifactId>
    <version>0.0.33</version>
</dependency>

IOC

use with @Inject

AOP

class implements Interceptor.

public interface Interceptor {

    default boolean build(SilentGo me) {
        return true;
    }

    default int priority() {
        return Integer.MIN_VALUE;
    }

    Object resolve(AOPPoint point, boolean[] isResolved) throws Throwable;
}

route

match path , you can use :
	@Controller(value="/path")  
	@Route(value="/{id}/{name}") or @Route(value="/[0-9a-z]+" , regex = true)
match parameters
	public void index(Response reponse,Resquest request ,@PathVariable(value="id") Integer id ,@PathVariable(value="name") String myname, 
	@RequestParam @RequestString( required = true , range = { 5 , 10}) String name)

validate parameters class implements IValidator you can custom validator for parameters yourself

restful
    @Route("/")
    public String index() {
        return "index.jsp";
    }

    @Route("/{string}")
    @ResponseBody
    public String test(@PathVariable String string) {
        LOGGER.info("msg:{}", string);
        return string;
    }

    @Route("/{string}")
    @ResponseBody
    @RouteMatch(method = RequestMethod.POST)
    public String testpost(@PathVariable String string) {
        return "post method :" + string;
    }

    @Route("/{string}")
    @ResponseBody
    @RouteMatch(method = RequestMethod.POST, params = "name=1")
    public String testpost2(@PathVariable String string) {
        return "post method name 1:" + string;
    }

dao

generate dao and db model by tools in framework

how to use

dao class

@Service
public interface SysMenuDao extends BaseDao<SysMenu> {

    SysMenu queryOneWhereId(String id);
}

use

    @Inject
    public SysMenuDao sysMenuDao;

    public String functodo() {
        //function name with rules
        //you can use directly without code;
        SysMenu menuone = sysMenuDao.queryOneWhereId("1");
        
        //for baseDao
        List<SysMenu> menu = sysMenuDao.queryAll();
    }

Versions

Version
0.0.49
0.0.48
0.0.47
0.0.46
0.0.44
0.0.43
0.0.42
0.0.41
0.0.39
0.0.38
0.0.37
0.0.36
0.0.33
0.0.32
0.0.31
0.0.30
0.0.29
0.0.28
0.0.27
0.0.25
0.0.24
0.0.22
0.0.21
0.0.20
0.0.18
0.0.17
0.0.15
0.0.14
0.0.13
0.0.12
0.0.11
0.0.10
0.0.9
0.0.8