NutzCN Logo
问答 js有根据java实体类创建表单的插件吗?
发布于 646天前 作者 码农 404 次浏览 复制 上一个帖子 下一个帖子
标签:

如题,有什么插件能支持吗?

6 回复

swagger也许行吧

@wendal 使用单元测试的时候

 @Test
    public void  doJson(){
        Entity<ExcelModel> model = dao.getEntity(ExcelModel.class);
        List<MappingField> compositePKFields = model.getCompositePKFields();
        MappingField idField = model.getIdField();
        List<EntityIndex> indexes = model.getIndexes();
        List<MappingField> mappingFields = model.getMappingFields();
        Map<String, Object> metas = model.getMetas();
        MappingField nameField = model.getNameField();
        String viewName = model.getViewName();
        Class<ExcelModel> type = model.getType();
        String tableComment = model.getTableComment();
        System.err.println(12);
    }
package com.ws.module.bean;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

import java.io.Serializable;

public class ExcelModel implements Serializable {
    @Id
    private String id;
    @Column
    @Comment("姓名")
    private String name;
    @Column
    @Comment("昵称")
    private String nickname;
    @Column
    @Comment("年龄")
    private String age;
    @Column
    @Comment("邮箱")
    private String email;
    @Column
    @Comment("电话")
    private String phone;
    @Column
    @Comment("地址")
    private String address;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}

D:\Dev\jdk1.8-191\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:F:\DevSoft\IntelliJ IDEA 2018.3\lib\idea_rt.jar=56181:F:\DevSoft\IntelliJ IDEA 2018.3\bin" -Dfile.encoding=UTF-8 -classpath "F:\DevSoft\IntelliJ IDEA 2018.3\lib\idea_rt.jar;F:\DevSoft\IntelliJ IDEA 2018.3\plugins\junit\lib\junit-rt.jar;F:\DevSoft\IntelliJ IDEA 2018.3\plugins\junit\lib\junit5-rt.jar;D:\Dev\jdk1.8-191\jre\lib\charsets.jar;D:\Dev\jdk1.8-191\jre\lib\deploy.jar;D:\Dev\jdk1.8-191\jre\lib\ext\access-bridge-64.jar;D:\Dev\jdk1.8-191\jre\lib\ext\cldrdata.jar;D:\Dev\jdk1.8-191\jre\lib\ext\dnsns.jar;D:\Dev\jdk1.8-191\jre\lib\ext\jaccess.jar;D:\Dev\jdk1.8-191\jre\lib\ext\jfxrt.jar;D:\Dev\jdk1.8-191\jre\lib\ext\localedata.jar;D:\Dev\jdk1.8-191\jre\lib\ext\nashorn.jar;D:\Dev\jdk1.8-191\jre\lib\ext\sunec.jar;D:\Dev\jdk1.8-191\jre\lib\ext\sunjce_provider.jar;D:\Dev\jdk1.8-191\jre\lib\ext\sunmscapi.jar;D:\Dev\jdk1.8-191\jre\lib\ext\sunpkcs11.jar;D:\Dev\jdk1.8-191\jre\lib\ext\zipfs.jar;D:\Dev\jdk1.8-191\jre\lib\javaws.jar;D:\Dev\jdk1.8-191\jre\lib\jce.jar;D:\Dev\jdk1.8-191\jre\lib\jfr.jar;D:\Dev\jdk1.8-191\jre\lib\jfxswt.jar;D:\Dev\jdk1.8-191\jre\lib\jsse.jar;D:\Dev\jdk1.8-191\jre\lib\management-agent.jar;D:\Dev\jdk1.8-191\jre\lib\plugin.jar;D:\Dev\jdk1.8-191\jre\lib\resources.jar;D:\Dev\jdk1.8-191\jre\lib\rt.jar;G:\codeResporty\ExcelDemo\target\classes;E:\repository\org\nutz\nutz\1.r.60\nutz-1.r.60.jar;E:\repository\com\alibaba\druid\1.0.26\druid-1.0.26.jar;E:\repository\com\oracle\ojdbc6\11.2.0.3\ojdbc6-11.2.0.3.jar;E:\repository\junit\junit\4.12\junit-4.12.jar;E:\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;E:\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;E:\repository\com\ibeetl\beetl\2.9.3\beetl-2.9.3.jar;E:\repository\org\antlr\antlr4-runtime\4.2\antlr4-runtime-4.2.jar;E:\repository\org\abego\treelayout\org.abego.treelayout.core\1.0.1\org.abego.treelayout.core-1.0.1.jar;E:\repository\org\antlr\antlr4-annotations\4.2\antlr4-annotations-4.2.jar;E:\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;E:\repository\com\alibaba\easyexcel\1.1.2-beta4\easyexcel-1.1.2-beta4.jar;E:\repository\org\apache\poi\poi\3.17\poi-3.17.jar;E:\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;E:\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar;E:\repository\org\apache\poi\poi-ooxml\3.17\poi-ooxml-3.17.jar;E:\repository\org\apache\poi\poi-ooxml-schemas\3.17\poi-ooxml-schemas-3.17.jar;E:\repository\org\apache\xmlbeans\xmlbeans\2.6.0\xmlbeans-2.6.0.jar;E:\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar;E:\repository\com\github\virtuald\curvesapi\1.04\curvesapi-1.04.jar;E:\repository\cglib\cglib\3.1\cglib-3.1.jar;E:\repository\org\ow2\asm\asm\4.2\asm-4.2.jar;E:\repository\org\nutz\nutz-plugins-mock\1.r.60\nutz-plugins-mock-1.r.60.jar;E:\repository\org\mockito\mockito-core\2.6.3\mockito-core-2.6.3.jar;E:\repository\net\bytebuddy\byte-buddy\1.6.2\byte-buddy-1.6.2.jar;E:\repository\net\bytebuddy\byte-buddy-agent\1.6.2\byte-buddy-agent-1.6.2.jar;E:\repository\org\objenesis\objenesis\2.5\objenesis-2.5.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 cn.ws.module.test.SimpleTest,doJson
[DEBUG] 2018-12-18 16:18:05,881 org.nutz.resource.Scans.<init>(Scans.java:509) - Locations for Scans:
[Dir[path=G:\codeResporty\ExcelDemo], Jar[path=E:\repository\org\nutz\nutz\1.r.60\nutz-1.r.60.jar], Dir[path=G:\codeResporty\ExcelDemo\target\classes], Jar[path=F:\DevSoft\IntelliJ IDEA 2018.3\lib\idea_rt.jar], Jar[path=F:\DevSoft\IntelliJ IDEA 2018.3\plugins\junit\lib\junit-rt.jar], Jar[path=F:\DevSoft\IntelliJ IDEA 2018.3\plugins\junit\lib\junit5-rt.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\charsets.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\deploy.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\access-bridge-64.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\cldrdata.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\dnsns.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\jaccess.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\jfxrt.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\localedata.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\nashorn.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\sunec.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\sunjce_provider.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\sunmscapi.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\sunpkcs11.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\ext\zipfs.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\javaws.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\jce.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\jfr.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\jfxswt.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\jsse.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\management-agent.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\plugin.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\resources.jar], Jar[path=D:\Dev\jdk1.8-191\jre\lib\rt.jar], Jar[path=E:\repository\com\alibaba\druid\1.0.26\druid-1.0.26.jar], Jar[path=E:\repository\com\oracle\ojdbc6\11.2.0.3\ojdbc6-11.2.0.3.jar], Jar[path=E:\repository\junit\junit\4.12\junit-4.12.jar], Jar[path=E:\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar], Jar[path=E:\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar], Jar[path=E:\repository\com\ibeetl\beetl\2.9.3\beetl-2.9.3.jar], Jar[path=E:\repository\org\antlr\antlr4-runtime\4.2\antlr4-runtime-4.2.jar], Jar[path=E:\repository\org\abego\treelayout\org.abego.treelayout.core\1.0.1\org.abego.treelayout.core-1.0.1.jar], Jar[path=E:\repository\org\antlr\antlr4-annotations\4.2\antlr4-annotations-4.2.jar], Jar[path=E:\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar], Jar[path=E:\repository\com\alibaba\easyexcel\1.1.2-beta4\easyexcel-1.1.2-beta4.jar], Jar[path=E:\repository\org\apache\poi\poi\3.17\poi-3.17.jar], Jar[path=E:\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar], Jar[path=E:\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar], Jar[path=E:\repository\org\apache\poi\poi-ooxml\3.17\poi-ooxml-3.17.jar], Jar[path=E:\repository\org\apache\poi\poi-ooxml-schemas\3.17\poi-ooxml-schemas-3.17.jar], Jar[path=E:\repository\org\apache\xmlbeans\xmlbeans\2.6.0\xmlbeans-2.6.0.jar], Jar[path=E:\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar], Jar[path=E:\repository\com\github\virtuald\curvesapi\1.04\curvesapi-1.04.jar], Jar[path=E:\repository\cglib\cglib\3.1\cglib-3.1.jar], Jar[path=E:\repository\org\ow2\asm\asm\4.2\asm-4.2.jar], Jar[path=E:\repository\org\nutz\nutz-plugins-mock\1.r.60\nutz-plugins-mock-1.r.60.jar], Jar[path=E:\repository\org\mockito\mockito-core\2.6.3\mockito-core-2.6.3.jar], Jar[path=E:\repository\net\bytebuddy\byte-buddy\1.6.2\byte-buddy-1.6.2.jar], Jar[path=E:\repository\net\bytebuddy\byte-buddy-agent\1.6.2\byte-buddy-agent-1.6.2.jar], Jar[path=E:\repository\org\objenesis\objenesis\2.5\objenesis-2.5.jar]]
[DEBUG] 2018-12-18 16:18:05,892 org.nutz.resource.Scans.scan(Scans.java:274) - Found 1 resource by src( conf/ioc/ ) , regex( ^(.+[.])(js|json)$ )
[DEBUG] 2018-12-18 16:18:05,893 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) - loading ioc js config from [dao.js]
[DEBUG] 2018-12-18 16:18:05,919 org.nutz.castor.Castors.reload(Castors.java:115) - Using 95 castor for Castors
[DEBUG] 2018-12-18 16:18:05,921 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) - Loaded 2 bean define from path=[conf/ioc/] --> [dataSource, dao]
[DEBUG] 2018-12-18 16:18:05,928 org.nutz.resource.Scans.scan(Scans.java:274) - Found 2 resource by src( cn/ ) , regex( ^.+[.]class$ )
[DEBUG] 2018-12-18 16:18:05,929 org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:74) - Found @IocBean : class cn.ws.module.test.SimpleTest
[INFO ] 2018-12-18 16:18:05,932 org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:50) - Found 1 classes in 1 base-packages!
beans = ["simpleTest"]
[DEBUG] 2018-12-18 16:18:05,933 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:40) - Loaded 5 bean define from reader --
[txREPEATABLE_READ, txSERIALIZABLE, txNONE, txREAD_UNCOMMITTED, txREAD_COMMITTED]
[INFO ] 2018-12-18 16:18:05,934 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) - NutIoc init begin ...
[INFO ] 2018-12-18 16:18:05,935 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) - ... NutIoc init complete
[DEBUG] 2018-12-18 16:18:05,935 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'simpleTest'<class cn.ws.module.test.SimpleTest>
[DEBUG] 2018-12-18 16:18:05,936 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
[DEBUG] 2018-12-18 16:18:05,936 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) - 	 >> Load definition name=simpleTest
[DEBUG] 2018-12-18 16:18:05,937 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) - Found IocObject(simpleTest) in AnnotationIocLoader(packages=[cn])
[DEBUG] 2018-12-18 16:18:05,937 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) - 	 >> Make...'simpleTest'<class cn.ws.module.test.SimpleTest>
[DEBUG] 2018-12-18 16:18:05,938 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) - Load class cn.ws.module.test.SimpleTest without AOP
[DEBUG] 2018-12-18 16:18:05,938 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) - Save object 'simpleTest' to [app] 
[DEBUG] 2018-12-18 16:18:05,941 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'dao'<interface org.nutz.dao.Dao>
[DEBUG] 2018-12-18 16:18:05,941 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) - 	 >> Load definition name=dao
[DEBUG] 2018-12-18 16:18:05,941 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) - Loading define for name=dao
[DEBUG] 2018-12-18 16:18:05,943 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) - Found IocObject(dao) in JsonLoader(paths=[conf/ioc/])
[DEBUG] 2018-12-18 16:18:05,943 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) - 	 >> Make...'dao'<interface org.nutz.dao.Dao>
[DEBUG] 2018-12-18 16:18:05,947 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) - Load class org.nutz.dao.impl.NutDao without AOP
[DEBUG] 2018-12-18 16:18:05,948 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) - Save object 'dao' to [app] 
[DEBUG] 2018-12-18 16:18:05,948 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'dataSource'<>
[DEBUG] 2018-12-18 16:18:05,948 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) - 	 >> Load definition name=dataSource
[DEBUG] 2018-12-18 16:18:05,948 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) - Loading define for name=dataSource
[DEBUG] 2018-12-18 16:18:05,952 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) - Found IocObject(dataSource) in JsonLoader(paths=[conf/ioc/])
[DEBUG] 2018-12-18 16:18:05,952 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) - 	 >> Make...'dataSource'<>
[DEBUG] 2018-12-18 16:18:05,961 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) - Load class com.alibaba.druid.pool.DruidDataSource without AOP
[DEBUG] 2018-12-18 16:18:05,961 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) - Save object 'dataSource' to [app] 
[INFO ] 2018-12-18 16:18:06,022 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:715) - {dataSource-1} inited
[DEBUG] 2018-12-18 16:18:06,023 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'dataSource'<>
[INFO ] 2018-12-18 16:18:06,037 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:23) - Init file-pool by: C:\Users\Administrator/.nutz/tmp/dao/ [200000]
[DEBUG] 2018-12-18 16:18:06,038 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:37) - file-pool.home: 'C:\Users\Administrator\.nutz\tmp\dao'
[INFO ] 2018-12-18 16:18:06,038 org.nutz.filepool.NutFilePool.<init>(NutFilePool.java:66) - file-pool.cursor: 0
[DEBUG] 2018-12-18 16:18:06,043 org.nutz.dao.jdbc.Jdbcs.<clinit>(Jdbcs.java:90) - Jdbcs init complete
[INFO ] 2018-12-18 16:18:06,043 org.nutz.dao.jdbc.Jdbcs.getExpert(Jdbcs.java:103) - Get Connection from DataSource for JdbcExpert, if you lock at here, check your database server and configure
[DEBUG] 2018-12-18 16:18:06,192 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:188) - select expert : org.nutz.dao.impl.jdbc.oracle.OracleJdbcExpert
[DEBUG] 2018-12-18 16:18:06,195 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:199) - JDBC Driver --> 11.2.0.3.0
[DEBUG] 2018-12-18 16:18:06,195 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:200) - JDBC Name   --> Oracle JDBC driver
[DEBUG] 2018-12-18 16:18:06,195 org.nutz.dao.impl.DaoSupport$1.invoke(DaoSupport.java:202) - JDBC URL    --> jdbc:oracle:thin:@192.168.154.132:1521:orcl
[DEBUG] 2018-12-18 16:18:06,195 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:221) - Database info --> ORACLE:[Oracle - Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options]
[WARN ] 2018-12-18 16:18:06,207 org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:116) - No @Table found, fallback to use table name='excel_model' for type 'com.ws.module.bean.ExcelModel'

org.nutz.dao.DaoException: Field(private java.lang.String com.ws.module.bean.ExcelModel.id) annotation @Id , but not Number type!!

	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.lang.Lang.makeThrow(Lang.java:149)
	at org.nutz.dao.impl.entity.info._Infos.createMappingInfo(_Infos.java:134)
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:184)
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:71)
	at org.nutz.dao.impl.NutDao.getEntity(NutDao.java:655)
	at cn.ws.module.test.SimpleTest.doJson(SimpleTest.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.nutz.mock.NutTestRunner.runChild(NutTestRunner.java:33)
	at org.nutz.mock.NutTestRunner.runChild(NutTestRunner.java:14)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

[INFO ] 2018-12-18 16:18:06,218 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:255) - org.nutz.ioc.impl.NutIoc@1077199500 is closing. startup date [18-12-18 16:18:05.934]
[DEBUG] 2018-12-18 16:18:06,218 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:108) - Depose object 'dao' ...
[DEBUG] 2018-12-18 16:18:06,218 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:108) - Depose object 'simpleTest' ...
[DEBUG] 2018-12-18 16:18:06,218 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:113) - Depose object 'dataSource' ...
[INFO ] 2018-12-18 16:18:06,221 com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1444) - {dataSource-1} closed
[INFO ] 2018-12-18 16:18:06,221 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:262) - org.nutz.ioc.impl.NutIoc@1077199500 is deposed. startup date [18-12-18 16:18:05.934]

Process finished with exit code -1

@wendal @Id改成@Name可行,但是不知道原因是什么

@wendal
使用@Ok("json")
返回到前端的是json对象还是json字符串?

@Ok("json")
public Object test(){
 HashMap<String, String> map= new HashMap<>();

return map;
}
添加回复
请先登陆
回到顶部