tomcat发布web service教程

此命令会直接把需要的包导入到${tomcat}\shared\lib目录下,其实也就是把jaxws RI lib下的包复制到了tomcat安装目录下shared\lib里面。

3、设置Eclipse中的tomcat


由于eclipse是自己定义的tomcat配置文件,所以需要加些东西,把shared\lib加入进来,打开ctalina.properties文件。

打开后为(节选):

Licensed to the Apache Software Foundation (ASF) under one or more

contributor license agreements. See the NOTICE file distributed with

this work for additional information regarding copyright ownership.

The ASF licenses this file to You under the Apache License, Version 2.0

(the “License”); you may not use this file except in compliance with

the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an “AS IS” BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

List of comma-separated packages that start with or equal this string

will cause a security exception to be thrown when

passed to checkPackageAccess unless the

corresponding RuntimePermission (“accessClassInPackage.”+package) has

been granted.

package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.

List of comma-separated packages that start with or equal this string

will cause a security exception to be thrown when

passed to checkPackageDefinition unless the

corresponding RuntimePermission (“defineClassInPackage.”+package) has

been granted.

by default, no packages are restricted for definition, and none of

the class loaders supplied with the JDK call checkPackageDefinition.

package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.

List of comma-separated paths defining the contents of the “common”

classloader. Prefixes should be used to define what is the repository type.

Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.

If left as blank,the JVM system loader will be used as Catalina’s “common”

loader.

Examples:

“foo”: Add this folder as a class repository

“foo/*.jar”: Add all the JARs of the specified folder as class

repositories

“foo/bar.jar”: Add bar.jar as a class repository

common.loader= c a t a l i n a . h o m e / s h a r e d / l i b / ∗ . j a r , {catalina.home}/shared/lib/*.jar, catalina.home/shared/lib/.jar,{catalina.home}/shared/lib, c a t a l i n a . b a s e / l i b , {catalina.base}/lib, catalina.base/lib,{catalina.base}/lib/.jar, c a t a l i n a . h o m e / l i b , {catalina.home}/lib, catalina.home/lib,{catalina.home}/lib/.jar

找到common.loader配置项增加KaTeX parse error: Undefined control sequence: \* at position 28: …me}/shared/lib/\̲*̲.jar,{catalina.home}/shared/lib 这两个路径即可

4、建立项目


新建一个web项目,webservice_web,目录结构如下

HelloService.java是提供web service的一个接口,代码如下:

package com.zxuqian.webservice;

import javax.jws.WebMethod;

import javax.jws.WebService;

@WebService

public interface HelloService {

@WebMethod

String greetings (String name);

}

HelloServiceImpl.java是实现类,代码如下:

package com.zxuqian.webservice.impl;

import javax.jws.WebService;

import com.zxuqian.webservice.HelloService;

@WebService (endpointInterface = “com.zxuqian.webservice.HelloService” )

public class HelloServiceImpl implements HelloService {

@Override

public String greetings(String name) {

return "Hello: " + name;

}

}

5、添加sun-jaxws.xml


sun-jaxws.xml是通过web方式发布web service应用的描述文件,内容如下:

<?xml version="1.0" encoding="UTF-8"?>

<endpoint name=“HelloWorld” implementation=“com.zxuqian.webservice.impl.HelloServiceImpl”

url-pattern=“/hello” />

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:前端)

更多面试题

**《350页前端校招面试题精编解析大全》**内容大纲主要包括 HTML,CSS,前端基础,前端核心,前端进阶,移动端开发,计算机基础,算法与数据结构,项目,职业发展等等

资料获取方式:点击蓝色传送门免费获取

取!!(备注:前端)**

[外链图片转存中…(img-imezJXyS-1713560887123)]

更多面试题

**《350页前端校招面试题精编解析大全》**内容大纲主要包括 HTML,CSS,前端基础,前端核心,前端进阶,移动端开发,计算机基础,算法与数据结构,项目,职业发展等等

资料获取方式:点击蓝色传送门免费获取

[外链图片转存中…(img-KtxnFGFy-1713560887123)]

  • 20
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值