国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Openfire開發(fā)帶有JSP和Servlet的插件
    在上一例helloworld的基礎(chǔ)上開發(fā)帶有jsp和servlet的插件,目錄結(jié)構(gòu)如下:



1.添加Servlet文件HelloWorldServlet.java

01 package org.jivesoftware.openfire.plugin;
02 
03 
04 import java.io.IOException;
05 import java.io.PrintWriter;
06 import javax.servlet.ServletException;
07 import javax.servlet.http.HttpServlet;
08 import javax.servlet.http.HttpServletRequest;
09 import javax.servlet.http.HttpServletResponse;
10 
11 public class HelloWorldServlet extends HttpServlet {
12 
13 private static final long serialVersionUID = -6093345417438012819L;
14 
15 @Override
16 
17 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
18 
19 throws ServletException, IOException {
20 
21 //super.doGet(req, resp);
22 
23 
24 resp.setContentType("text/plain");
25 
26 PrintWriter out = resp.getWriter();
27 
28 System.out.println("helloworldservlet doget");
29 
30 out.print("helloworldservlet doget");
31 
32 out.flush();
33 
34 }
35 
36 
37 @Override
38 
39 protected void doPost(HttpServletRequest req, HttpServletResponse resp)
40 
41 throws ServletException, IOException {
42 
43 //super.doPost(req, resp);
44 
45 
46 resp.setContentType("text/plain");
47 
48 PrintWriter out = resp.getWriter();
49 
50 System.out.println("helloworldservlet dopost");
51 
52 out.print("helloworldservlet dopost");
53 
54 out.flush();
55 
56 }
57 
58 
59 @Override
60 
61 public void destroy() {
62 
63 super.destroy();
64 
65 }
66 
67 
68 @Override
69 
70 public void init() throws ServletException {
71 
72 super.init();
73 
74 }
75 
76 }


2.配置Servlet,在web/WEB-INF添加web-custom.xml文件




3.添加jsp文件在web目錄下,文件名為helloworld_servlet.jsp



3.重新配置Plugin.xml,主要增加adminconsole字段。


注意:item節(jié)點(diǎn)下的id屬性值對應(yīng)jspservlet"/>content值。


4.重新編譯openfire,在服務(wù)器設(shè)置中可以看到Servlet插件了。




5.點(diǎn)擊HelloWorldServlet 

IE跳轉(zhuǎn)頁面為

同時(shí)在還看到:


至此,帶jsp和servlet的插件開發(fā)到此結(jié)束。





本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊舉報(bào)
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
javax.servlet.http.HttpServlet doGet和doPost方法的簡單介紹
servlet線程不安全 單例 struts2線程安全 多例
android用okhttp搭建網(wǎng)絡(luò)通訊(附服務(wù)器端代碼)
Servlet 編寫三種方式
Servlet方法
jsp+servlet實(shí)現(xiàn)注冊登錄,不用數(shù)據(jù)庫
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服