servlet

spring和springMVc配置文件

丶灬走出姿态 提交于 2019-12-03 15:33:53
spring      <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org

ssm的各种配置资源

时光总嘲笑我的痴心妄想 提交于 2019-12-03 15:21:27
spring的配置资源(包含mybatis): <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema

Spring的SSM标准配置

只谈情不闲聊 提交于 2019-12-03 15:10:39
一、首先是web.xml文件的配置 <welcome-file-list> <!--设置默认显示登陆界面--> <welcome-file>login.jsp</welcome-file> <!--<welcome-file>index.jsp</welcome-file>--> </welcome-file-list> <!-- spring的ContextLoaderlistener --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- Springmvc 的前端控制器 --> <servlet> <servlet-name>springDispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet

SSM 整合

时光怂恿深爱的人放手 提交于 2019-12-03 15:09:24
整合后文件 配置文件: 1. spring与mybatis配置文件:applicatonContext.xml 导入数据库配置文件 配置数据源信息 配置事务管理器 开启事务注解 配置 mybatis 的 sqlSessionFactoryBean 配置 mapper 扫描器 扫描 service 文件 1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xmlns:aop="http://www.springframework.org/schema/aop" 5 xmlns:context="http://www.springframework.org/schema/context" 6 xmlns:tx="http://www.springframework.org/schema/tx" 7 xsi:schemaLocation="http://www.springframework.org/schema/beans 8 http://www.springframework.org/schema/beans

SSM整合及Maven配置文件

一世执手 提交于 2019-12-03 15:01:13
1. web.xml 1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> 3 <display-name>pms</display-name> 4 <welcome-file-list> 5 <welcome-file>login.jsp</welcome-file> 6 </welcome-file-list> 7 8 <!-- Spring --> 9 <context-param> 10 <param-name>contextConfigLocation</param-name> 11 <param-value>classpath:beans.xml</param-value> 12 </context-param> 13 14 <!-- Spring上下文监视器 --> 15 <listener>

ssm的各种配置资源

你离开我真会死。 提交于 2019-12-03 14:54:21
spring的配置资源(包含mybatis): <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema

使用Axis+Eclipse开发webservice

安稳与你 提交于 2019-12-03 14:30:48
使用Axis+Eclipse开发webservice 什么是webservice? 从架构师的角度来理解:webservice是一个软件系统,为了支持跨网络的机器间相互操作交互而设计。Web Service服务通常被定义为一组模块化的API,它们可以通过网络进行调用,来执行远程系统的请求服务。 从一个程序员的视角来理解:在传统的程序编码中,存在这各种的函数方法调用。通常,我们知道一个程序模块M中的方法A,向其发出调用请求,并传入A方法需要的参数P,方法A执行完毕后,返回处理结果R。这种函数或方法调用通常发生在同一台机器上的同一程序语言环境下。现在的我们需要一种能够在不同计算机间的不同语言编写的应用程序系统中,通过网络通讯实现函数和方法调用的能力,而Web service正是应这种需求而诞生的。 简单来说,webservice就是一个网络组件,一个可以通过网络访问的程序。 Webservice、WSDL、SOAP的关系 Web Service = SOAP + HTTP + WSDL。其中,SOAP Simple Object Access Protocol)协议是web service的主体,它通过HTTP或者SMTP等应用层协议进行通讯,自身使用XML文件来描述程序的函数方法和参数信息,从而完成不同主机的异构系统间的计算服务处理。这里的WSDL(Web Services

Servlet返回的数据js解析问题

陌路散爱 提交于 2019-12-03 14:19:01
Servlet返回的数据js解析问题 方式1:Json 接收函数:ajax.responseText 后面没括号 其实在之前所说的ajax中还遗留了一些问题就是,Servlet返回给js的数据是如何被js解析的呢? 之前只是发送了一句话,所以他就以html的格式进行解析就成功了,但是在实际中我们往往发送的数据是存在一个对象当中的又或者是一组对象当中的,我们应该如何发送呢? json:js当中有一种有一种结构就是json,说白了就是键值对。 例如下面的: { "firstName":"John" , "lastName":"Doe" } 我们可以在Servlet将属性与值进行拼接,得到json格式的字符串,这样js中就能以这样的格式进行数据的解析了。 类似于下面这样: resp.getWriter().write("{name:"+u.getHeroName()+ ",lifenum:"+u.getLifeNum()+ ",type:"+u.getType()+ ",desc:"+u.getDesc() +"}") 但是对于懒癌来说这样的方式是极不友好的,所以就要说到强大的jar包了。 有一款名为gson的jar包可以帮你完成拼接的工作: https://pan.baidu.com/s/1-_lhLxGspqCis5CAPKt-GA 对于使用就是你直接将对象丢进去就好

SSM整合案例

╄→尐↘猪︶ㄣ 提交于 2019-12-03 13:57:20
项目的目录结构 第一步:导入依赖 <?xml version="1.0" encoding="UTF-8"?> <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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.yjc</groupId> <artifactId>InvoicingSystem</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>InvoicingSystem Maven Webapp</name> <!-- FIXME change it to the project's website --> <url>http://www.example.com</url> <properties> <project.build.sourceEncoding>UTF-8<

20191105踩坑记

风流意气都作罢 提交于 2019-12-03 13:42:56
踩坑之JSP 一 jsp中的注释有严格的分明。对jsp代码进行注释必须使用<%----%>. 二 关键词:List与ArrayLIst 在实际开发中,同样这样创建list: List list = new ArrayList(); 这样创建的好处时:因为list有多个实现类。以后可能会改变list的实现类,这样写的话,只需要修改一行代码就可以了。 三 让servlet在服务器启动时自动加载的方法: 在web.xml中的对应servlet标签下添加: . 四 project中的buildAuto...不可随便动呀,否则需要自动手动build项目,这回出现很多问题。 五 /JSPDemo 代表项目根目录。 六 在form表单的action属性中,当要填servlet时,不要填servlet的路径,需要填的是servlet的名字即可,他会和web.xml中配置的相对应。 七 java的substring方法中的两个s都是小写的 substring的参数左闭右开。 来源: https://www.cnblogs.com/WcxyBlog/p/11797643.html