Jeecg-P3 源码解读,实战小例子 Jeecg-P3用途,帮助我们解决的问题? 业务场景: ERP 分模块开发,可插拔集成方便。 jeecg-p3 + dubbo(springcloud) 实战小例子: - 框架解读,源码配置文件等 - 页面渲染机制 ``` VelocityContext velocityContext = new VelocityContext(); String viewName = "helloworld/hello.vm"; ViewVelocity.view(request, response, viewName, velocityContext); ``` - 每个插件独立打成一个jar包 - 引入新的JS插件 前缀: $!{basePath}/content ``` <link rel="stylesheet" href="$!{basePath}/content/plugin-in/bt/bootstrap.min.css"> <script src="$!{basePath}/content/plugin-in/bt/jquery.min.js"></script> <script src="$!{basePath}/content/plugin-in/bt/bootstrap.min.js"></script> ``` - 表单Form编写 ``` <form role="form"> <div class="form-group"> <label for="name">名称</label> <input type="text" class="form-control" id="name" placeholder="请输入名称"> </div> <div class="form-group"> <label for="inputfile">文件输入</label> <input type="file" id="inputfile"> <p class="help-block">这里是块级帮助文本的实例。</p> </div> <div class="checkbox"> <label> <input type="checkbox"> 请打勾 </label> </div> <button type="submit" class="btn btn-default">提交</button> </form> ``` - 如何集成进jeecg pom.xml 配置以下内容 ``` <!-- jeecg plugin --> <!-- p3 core 核心包,必须 --> <dependency> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-core</artifactId> <version>${jeecg-p3-core.version}</version> </dependency> <dependency> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-core-api</artifactId> <version>${jeecg-p3-core.version}</version> <exclusions> <exclusion> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-core</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-core-ui</artifactId> <version>${jeecg-p3-core.version}</version> <exclusions> <exclusion> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-core</artifactId> </exclusion> </exclusions> </dependency> <!-- hello 插件 --> <dependency> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-biz-helloworld</artifactId> <version>1.0.0</version> <exclusions> <exclusion> <groupId>org.jeecgframework.p3</groupId> <artifactId>jeecg-p3-start-quick</artifactId> </exclusion> </exclusions> </dependency> <!-- jeecg plugin --> ```