俞黎敏ID:YuLimin
83425次访问,排名1070好友20人,关注者244
阿敏总司令:简单就是美!
博客:http://YuLimin.JavaEye.com

只有正确地找到问题的根本所在,才能成功地解决掉问题:)
Read a bit and take it out, then come back read some more.
YuLimin的文章
原创 62 篇
翻译 0 篇
转载 0 篇
评论 65 篇
阿敏总司令的公告
三等功
俞黎敏
阿敏总司令
来自:福建莆田@广州
最近评论
yd1221:ǒu lái nǐ de dì pán cǎi cǎi ,hē hē ,xī wàng yě dào wǒ de dì pán zhuǎn zhuǎn ɑ !
偶 来 你 的 地 盘 踩 踩 ,呵 呵 ,希 望 也 到 我 的 地 盘  转  转 啊 !



 — 快典网( http://kdd.cc/ )自动注音
myshijieye:love注册香港公司
健康管理
pvc door
服装批发
jamesqiu:花点时间学习gvim,这是值得的。
007pro:je上核心人员都是极端务实的人群,有时候我觉得怎么可以这样,je的核心会觉的说,最好这样~就是这么简单。
我也是被隐藏扣分之后才明白,所以即便是博客上也对这类事情不做评述,虽然我是很支持你的
所以即便象俞兄这样的用户也不会有特权的,我记得老庄很久以前叹息说多亏有自己的空间,的确如此。
oneyear2008:我刚接触java,这对于我来说是一个很好的学习步骤!谢谢!
文章分类
收藏
    相册
    1大学的我
    2部队当兵
    3生活相片
    CSDN好友
    【HongSoft@业务整合】(RSS)
    axman
    Java憩园
    jini李日贵
    lizongbo
    zxhong(RSS)
    椅子(HERO2008第三会场主持人)
    用耳朵去聆听,用心来感受
    苏酩的Blog空间
    超越黎明(RSS)
    银狐999(RSS)
    青润心情(RSS)
    存档
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 在Web上登录Domino后直接打开用户的邮件收藏

    新一篇: 请大家访问我的这个网址:http://202.101.111.1/123/ | 

    /**
     * <p>Title: MailRedirectServlet</p>
     * <p>Description: 登录Domino服务器后直接打开用户的邮件!</p>
     * <p>前提Domino配置成支持servelt,</p>
     * <p>打开Names.nsf,配置,服务器文档,Internet协议,Domino Web引擎,Java 服务器小程序,选择:Domino 服务器小程序管理器</p>
     * <p>保存后重启Domino</p>
     * <p>把这个编译后的.class文件放到%DOMNIO%\Data\Domino\servlet目录下面</p>
     * <p>然后通过http://%SERVER%/servlet/MailRedirectServlet访问即可</p>
     * <p>Copyright: Copyright (c) 2001 - 2004</p>
     * <p>Company: Beyond DayBreak Office</p>
     * <p>HomePage: http://202.101.111.1/123</p>
     * <p>E-Mail: YuLimin@163.net</p>
     * @author YuLimin
     * @version 1.0
     */

    //package net.echochina.oa;

    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import lotus.domino.Document;
    import lotus.domino.NotesException;
    import lotus.domino.NotesFactory;
    import lotus.domino.NotesThread;
    import lotus.domino.Session;
    import lotus.domino.View;

    public class MailRedirectServlet extends HttpServlet
    {
        final static String DB_NAMES = "Names.nsf";

        public MailRedirectServlet()
        {
        }

        public void init() throws ServletException
        {
        }

        public void destroy()
        {
        }

        public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
        {
            doPost(request,response);
        }

        public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
        {
            String strFullName = request.getRemoteUser();
            String strMailFile = "";

            response.setContentType("text/html; charset=gb2312");
            ServletOutputStream out = response.getOutputStream();
            out.println("直接打开登录用户的邮件开始!<p>");
            out.println("登录的用户名为:" + strFullName + "<p>");

            if(strFullName == null || strFullName.equalsIgnoreCase("Anonymous"))
            {
                out.println("没有登录到Domino服务器!<p>");
                out.println("<script>document.location='/Names.nsf?Login&RedirectTo=/servlet/MailRedirectServlet';</script>");
            }
            else
            {
                NotesThread.sinitThread();
                Session session = null;
                View view = null;
                Document doc = null;
                try
                {
                    session = NotesFactory.createSession();
                    view = session.getDatabase(session.getServerName(),DB_NAMES).getView("People");
                    doc = view.getDocumentByKey(getShortName(strFullName));
                    if(doc != null)
                    {
                        strMailFile = doc.getItemValueString("MailFile");
                        strMailFile = strMailFile.replace('\\','/');
                        if(!strMailFile.toLowerCase().endsWith(".nsf"))
                        {
                            strMailFile += ".nsf";
                        }
                        out.println(strFullName + "用户的邮件为:" + strMailFile + "<p>");
                        String strMailURL = request.getScheme() + "://" + request.getServerName();
                        int strServerPort = request.getServerPort();
                        if(strServerPort != 80)
                        {
                            strMailURL += ":" + strServerPort;
                        }
                        strMailURL += "/" + strMailFile;
                        out.println("邮件地址为:" + strMailURL + "<p>");
                        out.println("<script>");
                        //out.println("alert('开始进入邮件')");
                        out.println("document.location='" + strMailURL + "'");
                        out.println("</script>");
                        //response.sendRedirect(strMailURL);
                        //response.encodeRedirectUrl(strMailURL)
                    }
                    else
                    {
                        out.println("找不到 " + strFullName + " 的邮件文件!<p>");
                    }
                }
                catch(NotesException e)
                {
                    out.println(e.toString() + "<p>");
                    e.printStackTrace();
                    System.out.println(e.id + " " + e.text);
                }
                finally
                {
                    try
                    {
                        if(doc != null)
                        {
                            doc.recycle();
                            doc = null;
                        }
                        if(view != null)
                        {
                            view.recycle();
                            view = null;
                        }
                        if(session != null)
                        {
                            session.recycle();
                            session = null;
                        }
                    }
                    catch(Exception e)
                    {
                        e.printStackTrace();
                    }
                    NotesThread.stermThread();
                }
            }
            out.close();
        }

        //取用户的短名!
        private String getShortName(String strTemp)
        {
            if(strTemp.indexOf("CN=") >= 0 && strTemp.indexOf("/") >= 0)
            {
                return strTemp.substring(3,strTemp.indexOf("/"));
            }
            else
            {
                return strTemp;
            }
        }

        public String getServletInfo()
        {
            return "登录Domino服务器后直接打开用户的邮件!";
        }
    }

    发表于 @ 2003年08月13日 10:27:00|评论(loading...)|编辑

    新一篇: 请大家访问我的这个网址:http://202.101.111.1/123/ | 

    评论

    #大萝卜 发表于2004-09-13 21:18:00  IP: 211.152.8.*
    呵呵,有点无聊,阿敏。
    #wts 发表于2004-11-10 15:56:00  IP: 218.61.80.*
    你在帖子:http://search.csdn.net/Expert/topic/2603/2603934.xml?temp=.412182
    中的回复
    请查阅我的CVSANDJB说明文档

    http://61.131.30.37/123/Develop/Java/CVSAndJB.pdf
    但是现在这个文档找不到了啊?链接已经无效,文档你还有吗?可否发给我一份,wtslh@163.com,非常感谢。
    #俞黎敏 发表于2005-01-12 08:44:00  IP: 221.4.149.*
    上这个网址http://Java.EchoChina.net

    或者从这里下
    http://61.131.30.54/123/Develop/Java/CVSAndJB.pdf
    #俞黎敏 发表于2005-01-12 08:48:00  IP: 221.4.149.*
    奇怪?为何管理评论没有效果??
    #俞黎敏 发表于2005-01-12 08:49:00  IP: 221.4.149.*
    晕,原来要等下一个评论好表一下才有结果:(
    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 阿敏总司令