开发者社区> 问答> 正文

jfinal jsp视图问题?报错

后台报错 

java.lang.ClassNotFoundException: javax.servlet.HttpConstraintElement

pom.xml文件如下 请问还缺失什么包呢

@12叔 @JFinal   

<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.test.base</groupId>
  <artifactId>base_demo</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  
  <dependencies>
  	 <dependency>
            <groupId>com.jfinal</groupId>
            <artifactId>jfinal</artifactId>
            <version>1.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
			<groupId>com.jfinal</groupId>
			<artifactId>jetty-server</artifactId>
			<version>8.1.8</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.jfinal</groupId>
			<artifactId>cos</artifactId>
			<version>26Dec2008</version>
			<scope>provided</scope>
		</dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
		<dependency>
		  <groupId>org.eclipse.jetty.orbit</groupId>
		  <artifactId>org.apache.taglibs.standard.glassfish</artifactId>
		  <version>1.2.0.v201112081803</version>
		  <scope>provided</scope>
		</dependency>
		<dependency>
		  <groupId>org.eclipse.jetty.orbit</groupId>
		  <artifactId>javax.servlet.jsp.jstl</artifactId>
		  <version>1.2.0.v201105211821</version>
		  <scope>provided</scope>
		</dependency>
		
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.9</version>
        </dependency>

        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.1.2</version>
            <scope>provided</scope>
        </dependency>
  </dependencies>
</project>



public void configConstant(Constants me) {
		// TODO Auto-generated method stub
		me.setDevMode(true);
		me.setBaseViewPath("/jsp");
		me.setViewType(ViewType.JSP);
	}



JFinal.start("src/main/webapp", 8081, "/", 5);



public void login(){
		System.out.println("login");
		renderJsp("index.jsp");
	}




展开
收起
爱吃鱼的程序员 2020-06-22 10:42:11 487 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    servlet-api

    回复 @红色是酒:哦,我没看到,那pom就没错。这个类就是servlet-api里的。你是怎么运行的,用什么IDE。是用插件运行的,还是用war包方式。上面有引入2.5的你具体指的是什么呢
    2020-06-22 10:42:29
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载