首页 技术 正文
技术 2022年11月10日
0 收藏 781 点赞 3,439 浏览 2512 个字

  关于Java JDK/JRE、Tomcat的配置等等都没什么好说的,主要记录一下使用Eclipse创建web工程时的一些点以及说一说自己用IDEA的创建失败的过程(IDEA没运行成功。。。暂时不想弄了)。

  先说说IDEA吧。本来用的又是社区版,所以不支持tomcat,于是只有通过maven在中央仓库下载tomcat8-maven-plugin插件来使用tomcat,也就是说主要问题就是pom.xml配置文件的问题,网上找了好多tomcat插件,总算把所有错误都消除了,还有一些compile插件,但最后都没有build成功,给看看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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>darkchii</groupId>
<artifactId>AnimeWeb</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>AnimeWeb Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<id>alfresco-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>beardedgeeks-releases</id>
<url>http://beardedgeeks.googlecode.com/svn/repository/releases</url>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>compile</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.3</version>
<configuration>
<groups>unit</groups>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<compilerVersion>1.5</compilerVersion>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat8-maven-plugin</artifactId>
<version>3.0-r1756463</version>
<configuration>
<path>/</path>
<uriEncoding>UTF-8</uriEncoding>
<server>tomcat8</server>
</configuration>
</plugin>
</plugins>
</build>
</project>

  于是转向用idea试用版,这个因为配置都是齐全的,所以创建过程都没什么问题,之后就是运行,结果还是运行失败了,报错误:

Error:during artifact deloyment.

  网上查资料,都说是Artifact没配置好,但我的都是配置好的。没深入研究,暂时没找到解决方案。

  接下来说说eclipse,用她的时候轻松很多,创建过程也不复杂,运行也良好。。。所以写到这里,突然感觉创建过程也没啥好说的。。。网上也都有详细的教程。。。emmm,我想想有没有什么值得注意的地方可以说…感觉设置超时应该值得注意,如果只是一个简单的demo Web程序可能不会超时(一般默认为45s),但如果是一个比较复杂的web项目,那么就需要注意这一点了,还有就是注意编码问题,有些IDE的jsp文件编码默认不是utf-8等等。

  给看看我自己的一个简单的demo web项目结构:

使用eclipse创建一个简单的Java Web应用程序

   运行结果:

使用eclipse创建一个简单的Java Web应用程序

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295