我想为我的Ant项目添加依赖项; 例如,我想将hibernate依赖项添加到我的项目中.
我是Ant的新手.在我使用maven工具构建项目之前.在maven中,很容易将依赖项添加到pom.xml文件中.
我的build.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project name="Demo ANT Project-1" default="run">
<target name="run" depends="compile">
<java classname="com.company.product.RoundTest">
<classpath path="staging"/>
</java>
</target>
<target name="compile">
<javac includeantruntime="false" srcdir="./src" destdir="staging" />
</target>
</project>
Run Code Online (Sandbox Code Playgroud)
我想在上面的Ant xml文件中添加依赖项.
这是我的项目,包含以下Maven模块:
模型,服务,网站
在目标文件夹下仅创建Web模块war文件。.web模块由控制器和网页组成
我的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aitrich.learnware</groupId>
<artifactId>Learnware</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Learnware Cloud Application - Master</name>
<description>This is parent pom for Learnware Cloud Application, where all the generic configurations are defined.</description>
<modules>
<module>LearnwareWeb</module>
<module>LearnwareModel</module>
<module>LearnwareServices</module>
</modules>
<organization>
<name>Aitrich Technologies</name>
<url>http://www.aitrich.com</url>
</organization>
<developers>
<developer>
<id>1</id>
<name>Shaheer</name>
<roles>
<role>Technical Leader</role>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>2</id>
<name>Shinas</name>
<roles>
<role>Team Leader</role>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>3</id>
<name>Prasanth AR</name>
<roles>
<role>Developer</role>
</roles>
</developer>
<developer>
<id>4</id>
<name>Jijesh VU</name>
<roles>
<role>Developer</role>
</roles> …Run Code Online (Sandbox Code Playgroud) 我使用带有 thymeleaf 模板引擎的 spring mvc 框架问题是,我有 1 个页面,其中包含多个复选框迭代唱 thymeleaf th:each iterator。当我单击多个复选框时,我想将复选框值传递给控制器方法..
html内容
<table>
<tr th:each="q : ${questions}">
<h3 th:text="${q.questionPattern.questionPattern}"></h3>
<div>
<p >
<input type="checkbox" class="ads_Checkbox" th:text="${q.questionName}" th:value="${q.id}" name="id"/>
</p>
</div>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
*控制器*
@RequestMapping(value = Array("/saveAssessment"), params = Array({ "save" }))
def save(@RequestParam set: String, id:Long): String = {
var userAccount: UserAccount = secService.getLoggedUserAccount
println(userAccount)
var questionSetQuestion:QuestionSetQuestion=new QuestionSetQuestion
var questionSet: QuestionSet = new QuestionSet
questionSet.setUser(userAccount)
questionSet.setSetName(set)
questionSet.setCreatedDate(new java.sql.Date(new java.util.Date().getTime))
questionSetService.addQuestionSet(questionSet)
var list2: List[Question] = questionService.findAllQuestion
var limit=list2.size
var …Run Code Online (Sandbox Code Playgroud) 我的servlet-context.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing
infrastructure -->
<context:component-scan base-package="com.aitrich.learnware.web" />
<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven />
<!-- Maps '/' requests to the 'home' view -->
<mvc:view-controller path="/" view-name="home" />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving
up static resources in the ${webappRoot}/resources directory -->
<mvc:resources mapping="/resources/css/**" location="/resources/css/" />
<mvc:resources mapping="/resources/js/libs/**" location="/resources/js/libs/" />
<mvc:resources mapping="/resources/img/**" location="/resources/img/" …Run Code Online (Sandbox Code Playgroud)