奶头挺立呻吟高潮av全片,成人试看120秒体验区,性欧美极品v,A片高潮抽搐揉捏奶头视频

J2EE培訓

集成spring與Web容器教程

時間:2024-10-06 06:02:06 J2EE培訓 我要投稿
  • 相關推薦

集成spring與Web容器教程

  spring框架的主要優勢之一就是其分層架構,分層架構允許使用者選擇使用哪一個組件,同時為 J2EE 應用程序開發提供集成的框架。下面yjbys小編為大家準備了關于集成spring與Web容器教程,歡迎閱讀。

  1.創建HelloWorld 接口類

  package com.googlecode.garbagecan.cxfstudy.helloworld;

  import javax.jws.WebMethod;

  import javax.jws.WebParam;

  import javax.jws.WebResult;

  import javax.jws.WebService;

  @WebService

  public interface HelloWorld {

  @WebMethod

  @WebResult String sayHi(@WebParam String text);

  }

  2.創建HelloWorld實現類

  package com.googlecode.garbagecan.cxfstudy.helloworld;

  public class HelloWorldImpl implements HelloWorld {

  public String sayHi(String name) {

  String msg = "Hello " + name + "!";

  return msg;

  }

  }

  3.修改web.xml文件

  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

  "http://java.sun.com/dtd/web-app_2_3.dtd" >

  cxfstudy

  cxf

  org.apache.cxf.transport.servlet.CXFServlet

  1

  cxf

  /ws/*

  org.springframework.web.context.ContextLoaderListener

  contextConfigLocation

  classpath*:**/spring.xml

  4.創建spring配置文件并放在classpath路徑下

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"

  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd

  http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

  5.創建測試類

  package com.googlecode.garbagecan.cxfstudy.helloworld;

  import org.springframework.context.ApplicationContext;

  import org.springframework.context.support.ClassPathXmlApplicationContext;

  public class SpringClient {

  public static void main(String[] args) {

  ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");

  HelloWorld helloworld = (HelloWorld)context.getBean("helloworldClient");

  System.out.println(helloworld.sayHi("kongxx"));

  }

  }

  6.測試

  6.1 首先啟動tomcat或者使用maven的jetty,并訪問http://localhost:9000/ws/HelloWorld?wsdl來驗證web service已經啟動并且生效;

  6.2 然后運行測試類來驗證web service。

【集成spring與Web容器教程】相關文章:

Web開發的教程圖解07-29

關于容器定位的CSS教程09-16

WEB教程標準應用標簽09-14

EXCEL集成工具箱詳細教程08-04

web標準與web標準的好處概況08-10

Web Workers加速移動Web應用07-11

電容器有哪些分類-電容器的分類06-03

大學英語作文:A Spring Morning10-27

web項目總結06-13

web項目總結10-20

主站蜘蛛池模板: 同心县| 临澧县| 淳化县| 沙田区| 莱西市| 栾城县| 周宁县| 日土县| 孝义市| 溆浦县| 雷山县| 成安县| 明溪县| 湛江市| 大英县| 府谷县| 博野县| 长兴县| 灵宝市| 太康县| 隆回县| 信阳市| 公安县| 蕲春县| 滕州市| 杭锦旗| 兴隆县| 唐海县| 历史| 皮山县| 陇川县| 子长县| 师宗县| 黎城县| 永宁县| 四川省| 常宁市| 上栗县| 中卫市| 广德县| 曲周县|