Tag: jsp

使用maven在kotlin中编写JSP – 错误实例化Servlet类,ClassNotFoundException

所以我一直在尝试JSP一段时间,我想用它和kotlin和maven,我有一些问题, 它抛出ClassNotFoundException,这里是我的文件: web.xml中 Archetype Created Web Application Servlet com.erezbiox1.Servlet Servlet /test 的pom.xml 4.0.0 com.erezbiox1 KotlinJsp war 1.0 KotlinJsp http://maven.apache.org junit junit 3.8.1 test org.jetbrains.kotlin kotlin-stdlib 1.2.0 javax.servlet servlet-api 2.5 KotlinJsp org.jetbrains.kotlin kotlin-maven-plugin 1.2.0 compile compile compile Servlet.kt // Tried with, and without this: @file:JvmName(“Servlet”) package com.erezbiox1 import javax.servlet.http.HttpServlet import javax.servlet.http.HttpServletRequest import javax.servlet.http.HttpServletResponse class Servlet : […]

Kotlin,Java,JSTL布尔互操作

我有JSTL和Kotlin互操作的问题。 我有一个2 kotlin布尔字段这个特殊的kotlin类。 class Foo { var isBar1 : Boolean = false var isBar2 : Boolean = false constructor() constructor(isBar1: Boolean, isBar2: Boolean) { this.isBar1 = isBar1 this.isBar2 = isBar2 } } 我必须通过以下方式访问jsp中的这两个字段: Print something Print something else 和isBar2完全相同 问题是,当我运行这段代码时遇到了 java.lang.NoSuchMethodError:packagedeclaration.setBar1(Ljava / lang / Boolean;)V 如果我尝试写下列function: fun getBar1(): Boolean { return this.isBar1 } fun setBar1(isBar1: […]

Tomcat gradle插件 – 失败的跟踪修改

我的老板在我的膝盖上放了一个他用eclipse开发的tomcat web应用程序。 他自己在项目上工作,所以他不使用Maven这样的包管理器。 我结束了在网上下载几个遗失的罐子。 希望它不会在我后面咬我…我正在尝试建立一个新的项目结构,我没有使用Tomcat或Java Web应用程序的经验。 我正在使用gradle tomcat插件,并且正在Failed tracking modifications of '/WEB-INF/lib错误进行Failed tracking modifications of '/WEB-INF/lib 。 我猜我的图书馆软件包没有按照我的设置正确放置。 这是我的项目结构: http : //i.imgur.com/FCjTswP.png 这是我的gradle文件: group 'wdm' version '1.1.1' buildscript { ext.kotlin_version = '1.0.4' repositories { jcenter() mavenCentral() } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5' } } apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'com.bmuschko.tomcat' sourceCompatibility […]