SSH个人相册_ssh开发相册-程序员宅基地

技术标签: ssh  

SSH个人相册

使用Maven环境下创建album相册管理

pom中找不到oracle数据库驱动问题

Missing artifact com.oracle:ojdbc6:jar:11.2.0.1.0

原因:Oracle的ojdbc.jar是收费的,所以maven的中央仓库中没有这个资源,只能通过配置本地库才能加载到项目中去。

废话不多说,解决方案如下:

1.首先确定你是否有安装oracle,如果有安装的话,找到ojdbc6.jar包

D:\app\Administrator\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar(这是我路径,你们的可能与我不同)

2.将ojdbc6.jar包添加到maven,也就是运行下面的语句,注意:不是在C盘下运行,是在该目录下执行下面的语句,如果你不知道你的版本号,可以执行select * from v$version;进行查看

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=ojdbc6.jar

img

安装成功

3.最后找到项目的pom.xml引入如下代码,右击项目名称,找到maven,找到update project更新下就ok了

com.oracle ojdbc6 11.2.0.1.0

作者:viktoria
来源:CSDN
原文:https://blog.csdn.net/viktoria/article/details/77503266/
版权声明:本文为博主原创文章,转载请附上博文链接!

关于在eclipse中web.xml找不到配置文件解决方案

eclipse中基于maven构建的web项目pom.xml中指定的jar包无法发布到tomcat中

1、点击项目然后右键proto

2.在文本框中输入Deployment Assembly 然后点击 add 找到 Java Build Path Entries

3.选择 Maven Dependencies即可

关于ssh整合中遇到找不到action或者是路径不对问题

注意:action即控制器中的方法必须是公开的

1.首先检查路径是否有误

2.检查是否开启动态调用 和 开启白名单

<constant name="struts.enable.DynamicMethodInvocation" value="true"/> 
 		<!-- 设置白名单 -->
		<global-allowed-methods>regex:.*</global-allowed-methods>  

3.如果以上还是出错,检查一下web.xml的struts2的中央控制器

4.如果以上还是出错,那么检查一下你的action中方法必须给public公开的

5.最后还是解决不了,就重新换一下jar包 依赖 可能是依赖冲突

关于js中使用submit会出现两次提交的形式

在from表单中input类型为submit,而提交方式为点击按钮使用ajax方式提交,会出现两次请求后台的情况

即出现表单提交 但是页面没有跳转成功,即出现两次请求后台的信息

解决方法,使用ajax提交时 input提交方式改为button方式,

 //注册
		  $("#registerForm").submit(function(){
		     if(checkuserName() && checkpassword() && checkemail()){  
				 addUserInfo_Ajax();
				 return true;
			 }/* else{
				 return false;
			 }   */
		 })

因为ajax是异步的,当在运行ajax的代码时候,此时程序提交了submit而没有进行进入ajax中,所以会在地址栏后面加上属性

因为使用submit提交方式

##关于sql多条件group by

select ai.albumId,ai.albumName,ai.albumCover,ai.albumDate,count(pi.photoId) as ct 
    from AlbumInfo ai left join PhotoInfo  pi on ai.albumId=pi.albumId 
     group by ai.albumId,ai.albumName,ai.albumCover,ai.albumDate

在hibernate如何使用呢?

一种使用构造函数的方法,即投影查询投影查询有三种方式:

1.直接查

2.查询返回对象

3.查询返回Map键值对

这里使用Map键值对查询

注意:使用键值对必须使用给其要列名创建别名

##关于上传图片 预览图片中遇到的坑?

1558343482038
在这里插入图片描述

<script type="text/javascript">
	function doFileChange(fileElm){
		var reader = new FileReader();//文件读取器
		reader.onload=function(e){    //文件加载
			$("#photoPreview").append("<img src='"+e.target.result+"'/>");
			
			
		}
		
		for(var i=0;i<fileElm.files.length;i++){
			reader.readAsDataURL(fileElm.files[i]);
			
		}
	
	}
</script>

当你添加多个图片的时候,则会在前台控制器报错

1558343570862
在这里插入图片描述
​ 即当前的程序正在读取图片,是什么原因呢?原因是当你第一张图片还没有reader.readAsDataURL(fileElm.files[i]);又在读取第二张图片

解决方法:使用回调函数:递归方法来执行

<script type="text/javascript">
	function doFileChange(fileElm){
    
		var reader = new FileReader();//文件读取器
		var index = 0; //声明第一张图片
		reader.onload=function(e){
        //文件加载
			$("#photoPreview").append("<img src='"+e.target.result+"'/>");
			
			console.log(index);
			index++;//自身加一
			if(index<fileElm.files.length){
    //判断是否还有图片
				reader.readAsDataURL(fileElm.files[index]);//读取第二张 第三张。。。
			}
		}
		reader.readAsDataURL(fileElm.files[index]);//读取第一张图片
	}
</script>
用插件实现预览图片 这里插件引用的时lrz

就不用考虑线程阻塞问题

<script src="${pageContext.request.contextPath }/js/jquery-3.3.1.js"></script>
<script src="${pageContext.request.contextPath }/js/lrz/lrz.bundle.js"></script>
<script type="text/javascript">
		function doFileChange(fileElm){
			for(var i=0;i<fileElm.files.length;i++){
				lrz(fileElm.files[i],{width:900}).then(function(reslutObj){//对图片进行压缩
					$("#photoPreview").append("<img src='"+reslutObj.base64+"'/>");
				})
			}
			
		}


//这里仅仅是显示图片,对图片没有压缩
	/* function doFileChange(fileElm){
		var reader = new FileReader();//文件读取器
		var index = 0; //声明第一张图片
		$("#imgTip").show();
		reader.onload=function(e){    //文件加载
			$("#photoPreview").append("<img src='"+e.target.result+"'/>");
			
			console.log(index);
			index++;//自身加一
			if(index<fileElm.files.length){//判断是否还有图片
				reader.readAsDataURL(fileElm.files[index]);//读取第二张 第三张。。。
			}else{
				$("#imgTip").hide();
			}
		}
		reader.readAsDataURL(fileElm.files[index]);//读取第一张图片
	} */
</script>

关于图片垂直居中的方法

<div class="photoList">
		<s:iterator value="#request.photoList" var="pi">
			<section>
				<span><span> <img src="${rt }/${pi.photoUrl}">
				<label>文字说明</label>
			</section>
		</s:iterator>
	</div>

在图片旁边多加一个span标签;用的原理是 图片与文字垂直居中的方法

css样式的写法

	.photoList section img{
		max-height: 100%;max-width: 100%;
		vertical-align: middle;
	}
	.photoList section span{
		vertical-align: middle;height: 100%;display: inline-block;  <!--处理图片垂直居中的方法-->
	}

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>com.bdqn.album.sys</groupId>
  <artifactId>album</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>album Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
   <!-- servlet的依赖 -->
   <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.1.0</version>
			<scope>provided</scope>
		</dependency>
		<!-- junit -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
		<!-- https://mvnrepository.com/artifact/antlr/antlr -->
		<dependency>
			<groupId>antlr</groupId>
			<artifactId>antlr</artifactId>
			<version>2.7.7</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/aopalliance/aopalliance -->
		<dependency>
			<groupId>aopalliance</groupId>
			<artifactId>aopalliance</artifactId>
			<version>1.0</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.ow2.asm/asm -->
<!-- 		<dependency>
			<groupId>org.ow2.asm</groupId>
			<artifactId>asm</artifactId>
			<version>5.2</version>
		</dependency> -->
		<!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
			<version>1.6.8</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/com.fasterxml/classmate -->
		<dependency>
			<groupId>com.fasterxml</groupId>
			<artifactId>classmate</artifactId>
			<version>1.3.0</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/commons-pool/commons-pool -->
		<dependency>
			<groupId>commons-pool</groupId>
			<artifactId>commons-pool</artifactId>
			<version>1.5.3</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/commons-dbcp/commons-dbcp -->
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<version>1.4</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.3.3</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.5</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.6</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.2</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/dom4j/dom4j -->
		<dependency>
			<groupId>dom4j</groupId>
			<artifactId>dom4j</artifactId>
			<version>1.6.1</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker -->
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<version>2.3.26-incubating</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-jta_1.1_spec -->
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-jta_1.1_spec</artifactId>
			<version>1.1.1</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.hibernate.common/hibernate-commons-annotations -->
		<dependency>
			<groupId>org.hibernate.common</groupId>
			<artifactId>hibernate-commons-annotations</artifactId>
			<version>5.0.1.Final</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>5.1.4.Final</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api -->
		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.1-api</artifactId>
			<version>1.0.0.Final</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.jboss/jandex -->
		<dependency>
			<groupId>org.jboss</groupId>
			<artifactId>jandex</artifactId>
			<version>2.0.3.Final</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.javassist/javassist -->
		<dependency>
			<groupId>org.javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>3.20.0-GA</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.jboss.logging/jboss-logging -->
		<dependency>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
			<version>3.3.0.Final</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>2.10.0</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/ognl/ognl -->
		<dependency>
			<groupId>ognl</groupId>
			<artifactId>ognl</artifactId>
			<version>3.1.15</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.springframework/spring-aop -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-expression -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-expression</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-jdbc</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-orm -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-tx -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>4.2.0.RELEASE</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-core -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-core</artifactId>
			<version>2.5.16</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-json-plugin -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-json-plugin</artifactId>
			<version>2.5.16</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.struts/struts2-spring-plugin -->
		<dependency>
			<groupId>org.apache.struts</groupId>
			<artifactId>struts2-spring-plugin</artifactId>
			<version>2.5.16</version>
		</dependency>
		<!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-all -->
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-all</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>ojdbc5</artifactId>
			<version>11.2.0.1.0</version>
		</dependency>
		<!-- action注解 -->
		<dependency>
		    <groupId>org.apache.struts</groupId>
		    <artifactId>struts2-convention-plugin</artifactId>
		    <version>2.5.16</version>
		</dependency>
	
		
  </dependencies>
  <build>
    <finalName>album</finalName>
    <plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			</plugins>
  </build>
</project>

下载路径
https://download.csdn.net/download/weixin_42736725/11190361

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42736725/article/details/90383739

智能推荐

硬盘挂载出现Structure needs cleaning的情况处理_cust挂载-程序员宅基地

文章浏览阅读2.8w次。使用fsck -vcfy /dev/sda3进行修复,中间可能出现修复到一般的时候aborted的情况,此时处理:Create /etc/e2fsck.conf with the following content:[scratch_files]directory = /var/cache/e2fsckUpdated e2fsck:wget http://downloads.sourcefor..._cust挂载

linux桥接实现交换机功能-程序员宅基地

文章浏览阅读228次。有五台主机。其中一台主机装有linux ,安装了网桥模块,而且有四块物理网卡,分别连接同一网段的其他主机。我们希望其成为一个网桥,为其他四台主机(IP分别为192.168.1.2 ,192.168.1.3,192.168.1.4,192.168.1.5) 之间转发数据包。同时,为了方便管理,希望网桥能够有一个IP(192.168.1.1),那样管理员就..._linux usb口子配置交换机 csdn

c语言综合练习题-程序员宅基地

文章浏览阅读350次,点赞3次,收藏3次。1.编写程序实现键盘输入一个学生的学分绩点 score(合法的范围为:1.0—5.0),根据学生的学分绩点判定该学 生的奖学金的等级,判定规则如下表所示。2.编程实现从键盘输入一个两位数的整数 n,要求计算输出满足小于整数 n(不包含 n 的值)且能被 3 整除、个位数 为奇数这三个条件的两位数的个数。3.自定义一个函数,功能是计算圆的面积。编程实现键盘输入一个半径 r 的值,通过调用该函数计算并输出对应 的圆的面积。

前端知识图谱,前端劝退之前端知识体系(前端面试体系)_知识图谱前端渲染-程序员宅基地

文章浏览阅读1.3k次。前端知识图谱,前端劝退之前端知识体系(前端面试体系)_知识图谱前端渲染

在R中把多条曲线放置在一张图中-程序员宅基地

文章浏览阅读3.5w次。>library(xlsx)>myield>head(myield) time X3m X6m X1y X2y X3y X4y1 2002.010.019889 0.020353 0.021264 0.023014 0.024670 0.0262322 2002.020.020781 0.021131 0.0218

echart 插件实现全国地图-程序员宅基地

文章浏览阅读432次。  最近的项目要用到一个能展现全国地图的功能,并且全国各个省份显示的颜色不同,点击省份后会返回省份名称。经过反复的查找最终确定了echart这个插件,最后的成果还不错,在这里写下来希望对大家有所帮助。话不多说先看最终的效果图。  最终的效果就是这个样子的啦,感觉还是很好看的,echart这个插件使用还是很简单的,按照官网步骤来就好了。官网地址:http://echarts.bai..._echart 全国地图

随便推点

.Net程序员玩转Android开发---(18)Android服务_net能写安卓后台服务吗-程序员宅基地

文章浏览阅读1.2k次。在做.NET开发的时候,我们经常会写windows service服务在后台运行。在android系统中,同样可以写android服务. Service是安卓四大组件一个非常重要的组件,四大组件包括Activity, Service ,BroadCastReceive,Content Provicer, 前几节课中,我们一直讲解activity,这节我们看下怎样使用service 。 并且演示service服务与activity进行通信_net能写安卓后台服务吗

java解析Excel工具easyexcal_easyexce pom-程序员宅基地

文章浏览阅读948次。java解析Excel工具easyexcalEasyExcel 简介1.java领域解析,生成Excel比较有名的框架有Apache poi,jxl等,但是他们都存在一个严重的问题就是非常耗内存,如果你的系统并发量不打还行,但是一旦并发上来后一定会OOM或者JVM频繁full gc2.EasyExcel是阿里巴巴开源的一个excel处理框架,已使用简单,节省内存著称能减少内存主要的原因是在解析Excel时没有将文件数据一次性全部加载到内存中,而是从磁盘文件上一行行读取数据,逐个解析使用ExcelE_easyexce pom

linux解压文件后重命名,tar 解压,重命名-程序员宅基地

文章浏览阅读7.8k次。1、tar: Removing leading `/’ from member names 问题:首先应该明确:*nix系统中,使用tar对文件打包时,一般不建议使用绝对路径。通常是在两台环境相似的机器上进行同步复制的时候,才有需要使用绝对路径进行打包。使用绝对路径打包时如果不指定相应的参数,tar会产生一句警告信息:"tar: Removing leading `/’ from member..._linux系统,tar解压后,再压缩文件夹名字签名会变成.\

【人工智能实验】蚁群算法解决TSP问题_蚁群算法解决tsp问题是人工智能的-程序员宅基地

文章浏览阅读485次。定义了Point类忘了用了结果代码变成了粪山????其中涉及贪婪算法,轮盘赌法,以及看不懂自己写的什么了在这里插入代码片_蚁群算法解决tsp问题是人工智能的

PublicCMS开源CMS系统的部署与安全测试_publiccms idea部署-程序员宅基地

文章浏览阅读1k次。文章目录前言IDEA部署前言为了进一步学习源码审计、提升代码能力,在 Gitee 上找了一个开源的 CMS 项目:PublicCMS ,该项目的知名度还是挺可以的(实际上我在项目中还遇到了客户用该系统的……):官方给出了公网演示站点可直接进行项目体验:演示站点:https://www.publiccms.com/;后台演示:https://cms.publiccms.com/admin/(演示账号/密码 test/test)。本文将下载项目源码进行 IDEA 本地部署搭建,尝试进行源码审计、_publiccms idea部署

Jiangsheng的CSDN Digest (Jan 1 2006)-程序员宅基地

文章浏览阅读528次。CSDN 讨论总结系列:Jiangsheng的CSDN Digest (Dec 2005)(http://blog.csdn.net/jiangsheng/archive/2005/12/24/561501.aspx) Jiangsheng的CSDN Digest (Oct 2005)(http://blog.csdn.net/jiangsheng/archive/2005/12/27/563

推荐文章

热门文章

相关标签