
java
66565906
这个作者很懒,什么都没留下…
展开
-
JaveBean命名规则
JaveBean命名规则:1 ,类名要首字母大写,后面的单词首字母大写 2,方法名的第一个单词小写,后面的单词首字母大写 3,变量名的第一个单词小写,后面的单词首字母大写,不允许第一个字符是大写且第二个字符是小写的情况变量名与其get/set的映射关系如下所示:属性名/类型getter 方法setter 方法xcoordinate原创 2017-02-04 11:49:43 · 445 阅读 · 0 评论 -
mavn web项目标准目录
原创 2018-11-12 14:29:42 · 192 阅读 · 0 评论 -
struts2+tomcat js,css文件引用 404错误但文件存在
在访问url或引用 js /css文件 时 是区分大小写,因为必须保证大小写一致,否则会有404错误原创 2018-12-21 09:50:25 · 503 阅读 · 0 评论 -
maven + struts2 +spring 目录结构
在默认情况下 web.xml存放在 webapp\WEB-INF目录下struts.xml存放在src\main\resources目录下spring的ApplicationContext.xml存放在 src\main\resources目录下原创 2018-12-21 12:28:58 · 329 阅读 · 0 评论 -
spring mvc ajax
Content-Type application/x-www-form-urlencoded 非application/x-www-form-urlencoded @RequestParam 是 否 Get/Post @RequestBody 否 是 Post ...原创 2018-12-24 13:57:24 · 220 阅读 · 0 评论 -
spring hibernate整合: Could not obtain transaction-synchronized Session for current thread
当hibernate 将事务交由 spring管理时, 应将 @Transactional 加入对接的接口层,即其它对象调用的方法上,若将@Transactional加在内部方法上,将会出现 Could not obtain transaction-synchronized Session for current thread 异常...原创 2019-01-04 13:50:33 · 476 阅读 · 0 评论 -
window tomcat9开始远程调试
1:打开C:\apache-tomcat-9.0.12\bin\catcalina.bat2:修改配置原先为:set "JAVA_OPTS=%JAVA_OPTS% -Djava.protocol.handler.pkgs=org.apache.catalina.webresources"修改为:set "JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xr...原创 2019-01-10 16:05:02 · 1272 阅读 · 0 评论 -
eclipse New Server Runtime Environment 列表中没有 Apache Tomcat
该问题主要原因可能是 Eclipse插件不全引起按以下步骤安排插件即可,1:点击工具栏上的Help -> Install New Software2在弹出的对话框的 Work with 输入 http://download.eclipse.org/releases/2018-09 其它 2018-09为Eclipse的版本号3:勾选 Web XML JAVA EE and ...原创 2019-01-02 09:33:40 · 6300 阅读 · 3 评论 -
Cannot change version of project facet Dynamic Web Module to 4.0
经过测试该问题主要原因可能有以下几种:1:.settings\org.eclipse.wst.common.project.facet.core.xml配置的 <installed facet="jst.web" version="2.3"/> version版本不正确,修改为4.02:与web.xml配置不下确 : "http://java.sun.com/dtd/web...原创 2019-01-02 11:13:52 · 962 阅读 · 0 评论 -
Win10 找不到Sql Server 2012 管理工具
Win10中Sql Server 2012管理工具可在 计算管理中找到,若打开时出 现 无法连接到WMI提供程序。您没有权限或者该服务器无法访问......可执行以下操作: 以管理员身份运行“命令提示符”(在附件下面),进入后执行以下命令 1)cd C:\Program Files\Microsoft SQLServer\100\Shared 2)mofcomp...原创 2019-01-02 20:04:46 · 3418 阅读 · 0 评论 -
JSP页面提示 The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
解决步骤:1:打开项目属性页面2:点击Java BuildPath3:点开 Libraries选项卡4:点击Add Library5:选中 Server Runtime6:选择 tomcat7:在order and Export选择卡中 选择中 刚添加的 tomcat服务器项8:点击Apply ...原创 2018-11-12 14:21:52 · 449 阅读 · 2 评论 -
struts action 返回json
若需要action 返回 json格式的数据 需执行以下几个步骤1:引入 struts2-json-plugin包至 WebContent/WEB-INF/lib下2:设置Action所属的包为 json-default@ParentPackage("json-defalut")3:设置Action的 result 类型为json@Result(name="success"...原创 2018-11-08 15:36:06 · 408 阅读 · 0 评论 -
struts package命名空间
struts的命名空间主要功能是对各action进行分组管理,当定义命名空间后,在访问命名空间下Action时需要在Action前引入命名空间@ParentPackage("struts-defalut")@Namespace("/test");public class Login extends ActionSupport{ @Action(value="add", ...原创 2018-11-05 14:22:51 · 211 阅读 · 0 评论 -
Eclipse不能创建Dynamic Web Project?
可能是在安装Eclipse时没有选择正确的版本,可重新下载Eclipse安装程序进行再次安装1:下载Eclipse: 官网网址:https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2018-09/R/eclipse-inst-win64.exe 2双击运行下载后的程序:3:选择 Eclipse ID Fo...原创 2018-09-29 08:48:48 · 1230 阅读 · 0 评论 -
从零开始搭建Eclipse+Struts2+Tomcat 的 HelloWorld示例程序
本文将从零开始一步步搭建基于 Eclipse+Struts2+Tomcat 的Web Application,并以 HelloWorld作为演示程序,主要从以下几个步聚来介绍:下载必备软件 安装软件 创建工程 运行程序 1:下载软件 Eclipse:https://www.eclipse.org/downloads/ Struts2:https:/...原创 2018-09-30 09:58:37 · 966 阅读 · 1 评论 -
jsp 页面中文显示乱码
问题:在jsp页面浏览器端显示会出现乱码原因:页面中存在中文但未设置正确的编码格式解决方案:在jsp文件首行插入<%@page contentType="text/html;charset=utf-8" pageEncoding="utf-8" %> ...原创 2018-10-29 12:44:04 · 2344 阅读 · 0 评论 -
struts.properties messageResource.properties存放路径
可直接放在 src目录下原创 2018-10-29 12:46:11 · 353 阅读 · 0 评论 -
Dynamic Web Project 的Struts2项目中引入Spring框架
在Struts2项目中引入Spring框架主要需要以下几个步骤:引入Spring jar包 修改web.xml 创建bean上下文文件引入Spring.jar包 Spring相关的文件可以直接在官网上下载,或者使用Struts包里的Spring文件,本博主使用的Struts版本为2.5.17, 在该lib目录下包含了spring jar包, 若要在Struts项目中使用Spri...原创 2018-10-31 09:40:19 · 422 阅读 · 0 评论 -
spring基于 XML 构造器注入
值传递<constructor-arg value="value"></constructor-arg>引用Bean<constructor-arg ref="people"></constructor-arg>引用List<constructor-arg > <list&g原创 2018-11-01 10:43:07 · 708 阅读 · 0 评论 -
Dynamic Web Project 默认ClassPath
默认情况下ClassPath指的是WEB-INF/class 目录src目录下所有的文件编译后均会发布到该路径下原创 2018-11-06 08:55:31 · 857 阅读 · 1 评论 -
spring基于XML属性Set方法注入
引用BeanSet代码: public void setPeople(People param) { people = param; }XML代码: <property name="people" ref="people"></property>值传入Set代码: public void setPeople(String param) {...原创 2018-11-02 08:57:18 · 1346 阅读 · 0 评论 -
struts2 Action基于xml配置
在Struts2使用 struts.xml来配置action时,action的xml节点基本格式如下所示:<action name="login" class="com.test.login"><result name="success">/index.jsp</result></action>此时,当在浏览器端发送请原创 2018-11-05 08:52:34 · 249 阅读 · 0 评论 -
struts2 Action基于注解配置
Struts2 在扫描 Action时,先是进行包扫描,再进行类扫描1:扫描所有包名中包含action, actions, strtus, strtus2的包2:再扫描找到的包下所有的com.opensymphony.xwork2.action的实现及以Action结尾的类 ps:需在WEB-INF/lib下引入struts-converention-plugin * .ja...原创 2018-11-05 14:12:25 · 245 阅读 · 0 评论 -
性能调优(一)
性能调优(一)背景当网站出现性能问题时,通常有三种解决办法:l 横向扩展: 人多力量大,通过增加服务器来提高系统吞吐量。l 纵向扩展: 提高单兵作战能力,对软件进行性能优化,在一定程度上可提高系统性能。l 混合方案: 多面开花,纵向扩展之余再横向扩展。简单起见,本文以基于Tomcat的单服务器的网站性能调优为例说明优化思路,后续再介绍如何配置服务器集群优化思路程序性...原创 2019-02-14 16:40:42 · 233 阅读 · 0 评论