package org.xinyu.servlet;
import java.io.IOException;
import java.net.URL;
import org.codehaus.xfire.client.Client;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class LoginServlet extends HttpServlet {
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String userName=request.getParameter("userName");
String passWord=request.getParameter("passWord");
Client client = null;
try {
client = new Client(new URL("http://localhost:8192/Login/?WSDL"));
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//采用Client的invoke方法需要两个参数,第一个是方法的名称,第二个数组类型的参数
try {
Object[] results = client.invoke("checkUser", new Object[] {userName, passWord });
if(results[0].equals(true)) {
response.sendRedirect("loginSucess.jsp");
}else {
response.sendRedirect("loginError.jsp");
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
Servicemix做代理服务器发布WebService
共50个文件
xml:13个
java:5个
class:5个
5星 · 超过95%的资源 需积分: 10 40 下载量 148 浏览量
2011-01-01
13:31:06
上传
评论 2
收藏 53KB ZIP 举报
温馨提示
Servicemix做代理服务器发布WebService,Login登录实际代码。对应博客中ServiceMix做代理服务器发布WebService(附带案例源码) 该篇例子,需要的可以去看看,这个是源码。
资源推荐
资源详情
资源评论
收起资源包目录
Demon.zip (50个子文件)
Demon
LoginDemo
.project 2KB
.settings
.jsdtscope 500B
org.eclipse.jdt.core.prefs 330B
com.genuitec.eclipse.ws.prefs 109B
com.genuitec.eclipse.ws.xfire.prefs 145B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.wst.jsdt.ui.superType.name 6B
.mymetadata 300B
WebRoot
LoginDemo.html 3KB
WEB-INF
web.xml 1KB
lib
classes
org
xinyu
servlet
LoginServlet.class 2KB
client
LoginTest.class 2KB
HttpClient.class 2KB
web
ILoginService.class 183B
LoginServiceImpl.class 656B
META-INF
xfire
services.xml 380B
META-INF
MANIFEST.MF 36B
loginSucess.jsp 841B
loginError.jsp 837B
LoginDemo.jsp 2KB
.myeclipse
src
org
xinyu
servlet
LoginServlet.java 2KB
client
HttpClient.java 867B
LoginTest.java 1KB
web
LoginServiceImpl.java 335B
ILoginService.java 200B
WebServices
services.xml 380B
.classpath 567B
Login
tutorial-wsdl-cxf-service
pom.xml 1KB
my-cxf-bc-su
pom.xml 1KB
target
my-cxf-bc-su-1.0-SNAPSHOT.zip 4KB
my-cxf-bc-su-1.0-SNAPSHOT.jar 4KB
maven-archiver
pom.properties 139B
my-cxf-bc-su-1.0-SNAPSHOT-installer
META-INF
jbi.xml 147B
maven
dependencies.properties 471B
Login.WSDL 3KB
xbean.xml 1KB
classes
META-INF
jbi.xml 147B
maven
dependencies.properties 471B
Login.WSDL 3KB
xbean.xml 1KB
src
main
resources
Login.WSDL 3KB
xbean.xml 1KB
my-cxf-sa
pom.xml 1KB
target
my-cxf-sa-1.0-SNAPSHOT.zip 5KB
maven-archiver
pom.properties 136B
my-cxf-sa-1.0-SNAPSHOT.jar 3KB
my-cxf-sa-1.0-SNAPSHOT-installer
META-INF
jbi.xml 635B
my-cxf-bc-su-1.0-SNAPSHOT.zip 4KB
classes
META-INF
jbi.xml 635B
maven
dependencies.properties 482B
共 50 条
- 1
qiailin
- 粉丝: 59
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页