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

智能推荐

分布式光纤传感器的全球与中国市场2022-2028年:技术、参与者、趋势、市场规模及占有率研究报告_预计2026年中国分布式传感器市场规模有多大-程序员宅基地

文章浏览阅读3.2k次。本文研究全球与中国市场分布式光纤传感器的发展现状及未来发展趋势,分别从生产和消费的角度分析分布式光纤传感器的主要生产地区、主要消费地区以及主要的生产商。重点分析全球与中国市场的主要厂商产品特点、产品规格、不同规格产品的价格、产量、产值及全球和中国市场主要生产商的市场份额。主要生产商包括:FISO TechnologiesBrugg KabelSensor HighwayOmnisensAFL GlobalQinetiQ GroupLockheed MartinOSENSA Innovati_预计2026年中国分布式传感器市场规模有多大

07_08 常用组合逻辑电路结构——为IC设计的延时估计铺垫_基4布斯算法代码-程序员宅基地

文章浏览阅读1.1k次,点赞2次,收藏12次。常用组合逻辑电路结构——为IC设计的延时估计铺垫学习目的:估计模块间的delay,确保写的代码的timing 综合能给到多少HZ,以满足需求!_基4布斯算法代码

OpenAI Manager助手(基于SpringBoot和Vue)_chatgpt网页版-程序员宅基地

文章浏览阅读3.3k次,点赞3次,收藏5次。OpenAI Manager助手(基于SpringBoot和Vue)_chatgpt网页版

关于美国计算机奥赛USACO,你想知道的都在这_usaco可以多次提交吗-程序员宅基地

文章浏览阅读2.2k次。USACO自1992年举办,到目前为止已经举办了27届,目的是为了帮助美国信息学国家队选拔IOI的队员,目前逐渐发展为全球热门的线上赛事,成为美国大学申请条件下,含金量相当高的官方竞赛。USACO的比赛成绩可以助力计算机专业留学,越来越多的学生进入了康奈尔,麻省理工,普林斯顿,哈佛和耶鲁等大学,这些同学的共同点是他们都参加了美国计算机科学竞赛(USACO),并且取得过非常好的成绩。适合参赛人群USACO适合国内在读学生有意向申请美国大学的或者想锻炼自己编程能力的同学,高三学生也可以参加12月的第_usaco可以多次提交吗

MySQL存储过程和自定义函数_mysql自定义函数和存储过程-程序员宅基地

文章浏览阅读394次。1.1 存储程序1.2 创建存储过程1.3 创建自定义函数1.3.1 示例1.4 自定义函数和存储过程的区别1.5 变量的使用1.6 定义条件和处理程序1.6.1 定义条件1.6.1.1 示例1.6.2 定义处理程序1.6.2.1 示例1.7 光标的使用1.7.1 声明光标1.7.2 打开光标1.7.3 使用光标1.7.4 关闭光标1.8 流程控制的使用1.8.1 IF语句1.8.2 CASE语句1.8.3 LOOP语句1.8.4 LEAVE语句1.8.5 ITERATE语句1.8.6 REPEAT语句。_mysql自定义函数和存储过程

半导体基础知识与PN结_本征半导体电流为0-程序员宅基地

文章浏览阅读188次。半导体二极管——集成电路最小组成单元。_本征半导体电流为0

随便推点

常用机器学习的模型和算法_常见机器学习模型算法整理和对应超参数表格整理-程序员宅基地

文章浏览阅读102次。本篇介绍了常用机器学习的模型和算法_常见机器学习模型算法整理和对应超参数表格整理

【Unity3d Shader】水面和岩浆效果_unity 岩浆shader-程序员宅基地

文章浏览阅读2.8k次,点赞3次,收藏18次。游戏水面特效实现方式太多。咱们这边介绍的是一最简单的UV动画(无顶点位移),整个mesh由4个顶点构成。实现了水面效果(左图),不动代码稍微修改下参数和贴图可以实现岩浆效果(右图)。有要思路是1,uv按时间去做正弦波移动2,在1的基础上加个凹凸图混合uv3,在1、2的基础上加个水流方向4,加上对雾效的支持,如没必要请自行删除雾效代码(把包含fog的几行代码删除)S..._unity 岩浆shader

广义线性模型——Logistic回归模型(1)_广义线性回归模型-程序员宅基地

文章浏览阅读5k次。广义线性模型是线性模型的扩展,它通过连接函数建立响应变量的数学期望值与线性组合的预测变量之间的关系。广义线性模型拟合的形式为:其中g(μY)是条件均值的函数(称为连接函数)。另外,你可放松Y为正态分布的假设,改为Y 服从指数分布族中的一种分布即可。设定好连接函数和概率分布后,便可以通过最大似然估计的多次迭代推导出各参数值。在大部分情况下,线性模型就可以通过一系列连续型或类别型预测变量来预测正态分布的响应变量的工作。但是,有时候我们要进行非正态因变量的分析,例如:(1)类别型.._广义线性回归模型

HTML+CSS大作业 环境网页设计与实现(垃圾分类) web前端开发技术 web课程设计 网页规划与设计_垃圾分类网页设计目标怎么写-程序员宅基地

文章浏览阅读69次。环境保护、 保护地球、 校园环保、垃圾分类、绿色家园、等网站的设计与制作。 总结了一些学生网页制作的经验:一般的网页需要融入以下知识点:div+css布局、浮动、定位、高级css、表格、表单及验证、js轮播图、音频 视频 Flash的应用、ul li、下拉导航栏、鼠标划过效果等知识点,网页的风格主题也很全面:如爱好、风景、校园、美食、动漫、游戏、咖啡、音乐、家乡、电影、名人、商城以及个人主页等主题,学生、新手可参考下方页面的布局和设计和HTML源码(有用点赞△) 一套A+的网_垃圾分类网页设计目标怎么写

C# .Net 发布后,把dll全部放在一个文件夹中,让软件目录更整洁_.net dll 全局目录-程序员宅基地

文章浏览阅读614次,点赞7次,收藏11次。之前找到一个修改 exe 中 DLL地址 的方法, 不太好使,虽然能正确启动, 但无法改变 exe 的工作目录,这就影响了.Net 中很多获取 exe 执行目录来拼接的地址 ( 相对路径 ),比如 wwwroot 和 代码中相对目录还有一些复制到目录的普通文件 等等,它们的地址都会指向原来 exe 的目录, 而不是自定义的 “lib” 目录,根本原因就是没有修改 exe 的工作目录这次来搞一个启动程序,把 .net 的所有东西都放在一个文件夹,在文件夹同级的目录制作一个 exe._.net dll 全局目录

BRIEF特征点描述算法_breif description calculation 特征点-程序员宅基地

文章浏览阅读1.5k次。本文为转载,原博客地址:http://blog.csdn.net/hujingshuang/article/details/46910259简介 BRIEF是2010年的一篇名为《BRIEF:Binary Robust Independent Elementary Features》的文章中提出,BRIEF是对已检测到的特征点进行描述,它是一种二进制编码的描述子,摈弃了利用区域灰度..._breif description calculation 特征点