jfinal maven项目jetty如何使用支持jsp
< 返回列表时间: 2016-07-27来源:开源中国
HDC调试需求开发(15万预算),能者速来!>>>
我在IntelliJ 搭建jfinal + maven环境,依赖如下:

<dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>javax.servlet.jsp.jstl-api</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>org.eclipse.jetty.orbit</groupId> <artifactId>org.apache.taglibs.standard.glassfish</artifactId> <version>1.2.0.v201112081803</version> </dependency> <dependency> <groupId>com.jfinal</groupId> <artifactId>jfinal</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>com.jfinal</groupId> <artifactId>jetty-server</artifactId> <version>8.1.8</version> <!--<scope>provided</scope>--> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.3.10.v20160621</version> <configuration> <httpConnector> <port>8080</port> </httpConnector> <stopPort>9966</stopPort> <stopKey>stop</stopKey> <scanIntervalSeconds>5</scanIntervalSeconds> <webApp> <contextPath>/</contextPath> </webApp> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.4</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build>



启动类:



package com.ef.demo.common; import com.jfinal.core.JFinal; public class Stratup { public static void main(String[] args) { JFinal.start("src/main/webapp", 8080, "/", 5); } }



Controller:



public class IndexController extends Controller { public void index(){ // renderText("hello JFinal world!");//正常 renderJsp("index.jsp");//报错: JSP support not configured } }


以上配置启动正常但是访问jsp页面会报错: JSP support not configured
我有2个问题:


1. 如何配置在开发环境(IntelliJ IDEA)maven+jetty+jsp(我已经尝试把官demo的jar的依赖都加进去了但还是不能renderJSP )的依赖?
2. pom.xml 里面 jetty server的依赖的groupid用com.jfinal和用org.eclipse.jetty区别是什么?(如果把jfinal的jettey改成相同版本的eclipse的jetty则启动报错: Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/webapp/WebAppContext )
@JFinal 或者谁能帮忙? 谢谢
热门排行