-
JQuery中鼠标划过一级菜单,有二级菜单的就显示的处理
重点是逻辑,理解了就好了。先直接上html5代码: <!doctype html> <html> <head> <meta charset"utf-8"> <title>鼠标划过一级菜单,有二级菜单的就显示</title> <script src"../js/jqu…
2022/5/21 0:39:35
-
JQuery中toggle被淘汰后的替代方法
在最新的JQuery的程序库中jquery-2.2.3.js中已经有好几个函数被替换到了。应该说版本过1.8或1.9时就淘汰了。 如: .live() 1.9以上被淘汰。 替代函数:.on()。.die() 1.9以上被淘汰。 替代函数:.off()。.size() 1.8以上被淘汰。替代函数&…
2022/5/21 0:38:57
-
jQuery中处理指针移过去时的列表标题显示与隐藏
这里主要用到了hover,index()函数,eq等基本过滤选择器。先看body部分的代码: <body><div id"fq"><div class"one"><div class"top"><span class"iocn…
2022/5/21 0:38:15
-
jQuery中通过animate做一个简单的上下滑动的动画案例
先说一下案例的目的。鼠标移动过去时,做上下切换动作,鼠标离开上下切换动作消失。当然,不是简单的展示和关闭。看源代码: <body> <div id"main"><ul><li>天空<div>1019</div><…
2022/5/21 0:37:31
-
jQuery中,选中一级菜单,二级菜单自动出现的js代码
其实这个不难。 <div id"nav"><ul><li><div class"first">账号管理</div><ul class"second"><li>账号注册</li><li>找回密码</li><li>账户关联登录</li><li>账号…
2022/5/21 0:36:41
-
jQuery中动态添加和删除行
这里,先看网页代码。 <body><table width"800" border"0" cellspacing"0" cellpadding"0"><tr bgcolor"#EBE7DC"><td><input type"checkbox"/></td><td>…
2022/5/21 0:35:57
-
JQuery中图片自动切换和手动切换
先看网页代码: <body> <div id"content"> <div id"top"> <ul> <li class"top1"><a href"#" id"tianmao" class"a_link">天猫</a>精选</li> <li …
2022/5/21 0:35:16
-
jQuery中登录友好提示系列(1)
先看html代码 <form action"" method"post" id"my" >用户名:<input type"text" name"name1" id"user"/><span class"tip" style"display:none">用户名不能为空…
2022/5/21 0:34:40
-
Mapped Statements collection does not contain value for ......
这种问题,只要知道关键字Mapped 就表示是映射文件出错。在根据for后面指定的内容,就可以定位错误了。然后错误只可能是:namespace,id或者是resultType。
2022/5/21 0:34:05
-
An AnnotationConfiguration instance is required to use...等几个异常
1.异常: An AnnotationConfiguration instance is required to use 意思是,用了注解了,自然要用注解类生成SessionFactory private static Configuration configuration new AnnotationConfiguration(); 当然了,如果你用Hibern…
2022/5/21 0:33:25
-
not-null property references a null or transient value: 等关于cinema项目bug
今天改一个项目,遇到好多bug。以下一一说主要bug。 1. not-null property references a null or transient value: entity.Film.name很明显,意思是不能有一个空的属性引用。 解决:检查数据库,允许为空,发现还是报错…
2022/5/21 0:32:48
-
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: 表或视图不存在,分页等关于hibernate测试的几个问题
今天的hibernate出现一个错误 1.异常。 Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: 表或视图不存在 异常很明显。马上想到的是数据库连接是不是改了。我之前的用户名是htest,后面改成htest1。立刻改掉。 <property name"connection.user…
2022/5/21 0:31:51
-
编写xml文件时,The markup in the document preceding the root element must be well-formed.等bug
今天写dtd,xml文件时,连续报bug。 The markup in the document preceding the root element must be well-formed. 错误原因:ELEMENT 写成ElEMENT。 另外:xml区分大小写。 <!DOCTYPE poem system "poem1.dtd" &g…
2022/5/21 0:31:13
-
读取mystruts2的xml文件——dom4j读取
先看mystruts2的xml文件: 这里写<?xml version"1.0" encoding"UTF-8"?> <!DOCTYPE mystruts SYSTEM "mystruts.dtd"><mystruts><actions><action name"register"class"RegisterAction&…
2022/5/21 0:30:36
-
java反射调用方法时,Class . can not access a member of class . with modifiers private 等异常解决
先看javabean类:目的使用反射调用私有方法: package com.imooc.reflect;public class Student {private void add(){System.out.println("增加数据!");}private int id;private String name;public int getId() {return id;}publi…
2022/5/21 0:30:00
-
hibernate与struts2一起时的异常处理
今天项目刚将hibernate与struts2放一起。异常还不少。 ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console... log4j:WARN No appenders could be found for logger (fr…
2022/5/21 0:26:54
-
Caused by: java.sql.BatchUpdateException: ORA-01438: 值大于为此列指定的允许精度如何解决
Caused by: java.sql.BatchUpdateException: ORA-01438: 值大于为此列指定的允许精度 遇到这个问题时,从以下几点找原因 1.检查列所对应的实体的类型是否写错。 2.由于我用Oracle,主键是自增长,检查自增长的配置。若是用注解写的。看看有木…
2022/5/21 0:26:18
-
ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception
出现这个错误的时候,异常后面跟着是我请求的路径。 解决办法1:检查你的Method方法配置 <action name"release" class"actions.HouseAction" method"releaseHouse"><result name"success">/page/f…
2022/5/21 0:25:44
-
Myeclipse导出uml类图和导出javadoc时错误: 编码GBK的不可映射字符解决
1.Myeclipse导出uml类图很简单,项目-右键new-UML2 mode-这时根据自己的需要添加就好了。 选择类图,右键export就可以导出,图片格式。 2。Myeclipse导出javadoc时,如果出现编码GBK的不可映射字符”。一般提示都很友好,…
2022/5/21 0:25:08
-
自定义struts2的mvc时几个异常
D:\myeclipse\my\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201211011550\tomcat\bin\mystruts.dtd (系统找不到指定的文件。) 1,解决方案,把你的dtd文件放那个路径下。或者dtd和xml文件不分开。 See Servlet Spec 2.3, se…
2022/5/21 0:24:31
-
struts2中上传,及注意问题
先看简单的jsp页面 <form action"fileupload.action" method"post" enctype"multipart/form-data"><input type"file" name"image" /><input type"submit" /></form><img alt"&…
2022/5/21 0:23:28
-
Address already in use: JVM_Bind解决办法
早上写的时候。突然myeclipse就报这个错误。 Address already in use: JVM_Bind 网上看到了很多解决办法。但多不靠谱。 比如。重新配个tomcat,或者换个tomcat版本…… 仔细分析英文提示:说明JVM已经被占用了。有其他程序在用,事实上你好…
2022/5/21 0:22:52
-
struts2的下载及注意事项
先看action类。 package actions;import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLEncoder;import org.apache.…
2022/5/21 0:22:16
-
ajax调用时,document.getElementById获取不到值
今天写ajax的一个小例子的时候,document.getElementById居然获取不到值,后来找到了,对自己很是无语。 先看jsp页面 <body><script type"text/javascript">var req null;function test() {var name document.all.na…
2022/5/21 0:21:41
-
The file cannot be validated as the XML definition 异常解决办法
在struts2中配置验证框架时,回报上面的错误。这时候,要学会读懂英文意思。文件不能被验证的XML定义。下面看完整的错误提示。 The file cannot be validated as the XML definition "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd…
2022/5/21 0:21:03
-
java中简单工厂模式
简单工厂模式,其实结合例子来说更容易理解。拿汽车举例子,Car首先是一个接口,有一些抽象的公共的方法。car1,car2……就可以实现这个接口。在做一个接口的类,将Car作为参数去判断car的类型,到底是car1&…
2022/5/21 0:20:18
-
org.hibernate.LazyInitializationException解决办法
ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: [org.hibernate.LazyInitializationException: could not initialize proxy - no Session, could not initialize proxy - no Session]仔细看英文&#x…
2022/5/21 0:19:38
-
商品订购系统时出现的问题汇总 not-null property references a null or transient value 等
最近用hibernate和struts2写的一个小的项目,出现了很多问题。还算顺利。问题点回顾。 1.配置struts2,直接忘记在web.xml配置核心控制器。2.1.3之前是FiltDispatcher,之后是filter.StrutsPrepareAndExecuteFilter.忘记配了,直接不…
2022/5/21 0:18:59
-
ajax入门的一些基本用法
本篇文章,说说ajax的写的几种情况。 最原始的写法。 <script type"text/javascript">function test(){var xmlHttpRequestnull;if (window.XMLHttpRequest) {xmlHttpRequestnew XMLHttpRequest();}else{//IE5和6xmlHttpRequestnew ActiveXObject(…
2022/5/21 0:18:22
-
hibernate+Struts2+jquery easyui 做分页处理时的一些问题
合在一起做的时候,问题就多了。 1. selectcount(*) as col_0_0_ fromJBIT.GOODS goods0_ 看到上面的sql,马上就会想到,获取所有记录时,面对long型的转换,修改Dao中代码。 Integer.parseInt(session.createQuery(&qu…
2022/5/21 0:17:45
-
.NonUniqueObjectException: a different object with the same identifier等的解决
这几天写hibernatestruts2easyuiOracle小项目时遇到的异常。 org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [entity.TbBooks#1] 看英语,就表示主键重复。检查。oracle数…
2022/5/21 0:17:09
-
hibernate的一个分页的写法
直接上代码: // 按条件分页查询投票集合public List<Subject> getSubjectList(String title, Integer pageNumber,Integer pageSize) {if(pageNumbernull){pageNumber 1;}if(pageSizenull){pageSize 5;}Session session null;List<Subject> list nu…
2022/5/21 0:16:06
-
spring的几个问题
今天只看几个问题。 1.BeanFactory与applicationContext BeanFactory 可以理解为含有bean集合的工厂类。BeanFactory 包含了种bean的定义,以便在接收到客户端请求时将对应的bean实例化。 BeanFactory还能在实例化对象的时生成协作类之间的关系。此举将bean自身…
2022/5/21 0:15:31
-
org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException 解决
Failed to instantiate [org.springframework.aop.aspectj.AspectJExpressionPointcut]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException spring没有缺jar包的直接…
2022/5/21 0:14:55
-
ClassSpringJUnit4ClassRunner cannot be resolved to a type spring4.32的junit测试报错解决
直接上bug Class<SpringJUnit4ClassRunner> cannot be resolved to a type 看代码 RunWith(SpringJUnit4ClassRunner.class) ContextConfiguration("/bean-aspect.xml") public class Test1 { 1,记得导入spring的test jar包。 2.记得导入ju…
2022/5/21 0:14:17
-
spring中的增强:注解和schema配置几种情况
这里说一下spring的增强。先看schema的五种情况,如下代码:注意: 环绕增强的参数:ProceedingJoinPoint jp。ProceedingJoinPoint 是JoinPoint的子类。 public class MyAop {public void before(JoinPoint jp){System.out.println…
2022/5/21 0:13:41
-
java.lang.OutOfMemoryError: PermGen space 解决
今天写项目时,突然遇到这个问题。 java.lang.OutOfMemoryError: PermGen space PermGen space,Permanent Generation space,指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决方法也一定是加大内存。 我是…
2022/5/21 0:12:31
-
Invalid bean definition with name 'mailSender' defined in class path resource [office.mail.xml
今天项目出现这个异常。看完整的。 org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name mailSender defined in class path resource [office.mail.xml]: Could not resolve placeholder mail.smtp.host 注意关键字&#x…
2022/5/21 0:11:52
-
if (Build.VERSION.SDK_INT = Build.VERSION_CODES.KITKAT)设置后的效果
android app开发时,查看之前的会有这样的设置。 //如果sdk版本大于4.4则设置状态栏透明化 会导致首页状态栏减少/* if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {Window window getWindow();window.setFlags(WindowManager.LayoutParams.FLAG_TRA…
2022/5/21 0:10:05
-
android studio谁用butterknife(正确地打开方式)
最近在用butterknife。网上有很多引用的方法。好多不太准确。这里就说一哈。 1、在android studio中添加插件:butterknife 2.在项目的build.gradle中添加: classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8’ // 添加这行 3.添加依赖…
2022/5/21 0:09:26