在Web上登录Domino后直接打开用户的邮件
/**
* 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服务器后直接打开用户的邮件!";
}
}
彩虹女神跃长空,Go语言进阶之Go语言高性能Web框架Iris项目实战-登录与图形验证码(captcha)EP06 书接上回,上一回我们按照“低耦合高内聚”的组织架构方针对项目的整体结构进行了优化,本回将会继续编写业务,那就是用户的登录逻辑,将之前用户管理模块中添加的用户账号进行账号和密码的校验,校验通过后留存当前登录用户的信息,过程中使用图形验证码强制进行人机交互,防止账号的密码被暴力破解。
Web前端登录拼图验证功能,看你是人还是机器 相信大家经常在各种网站上登录、注册、下发短信、活动等会看到,系统会弹出来一个滑块验证,让你把一个滑块滑到指定空缺的位置(还有其他种形式,比如按顺序点击文字或图案等等),系统会校验,校验正确则登录成功,否则即使账号密码输入正确也无法登录。这样做主要是为了系统更安全,减少被机器模拟登录行为破坏网站。今天就来白嫖一下腾讯云提供的图片验证功能。
WebSocket + Redis简单快速实现Web网站单设备登录功能 单设备登录作用很明显,就是为了保护用户账号安全,今天我们不说手机APP,我们来说说PC Web网站如何简单快速实现这种效果。本篇文章重点是实现单设备登录,内容未涉及WebSocket + Redis的概念和使用方法。限于本人经验,如有错误,欢迎指正。
相关文章
- 彩虹女神跃长空,Go语言进阶之Go语言高性能Web框架Iris项目实战-用户系统EP03
- Flask Web 极简教程(四)- Flask WTF Froms(Part A)
- 低代码如何构建支持OAuth2.0的后端Web API
- SerenityOS 作者新作品:跨平台Web浏览器 Ladybird
- web机器人
- 使用Rust编写一个web服务
- 严重:Error configuring application listener of class org.springframework.web.util.IntrospectorCleanupListener详解程序员
- ubuntu中maven建的web项目不能将project facet设置为 dynamic web module 3.0详解程序员
- Spring Boot搭建Web应用详解编程语言
- 极速搭建:使用Linux快速搭建Web服务器(linux搭建web服务器)
- Oracle Web界面:极致用户体验(oracleweb界面)
- Linux下搭建完美Web服务器配置(linux配置web服务器)
- 快速部署Linux环境下Web项目(linux部署web项目)
- Linux为Web服务器带来的福音(linux做web服务器)
- 搭建Linux下构建Web环境:步骤一步步来(linuxweb环境)
- 使用Linux优化Web开发体验(web开发linux)
- Redis Web UI:实现管理更轻松便捷(redis web ui)
- Web即时通讯技术以Redis驱动(web即时通讯redis)
- Web前端快速构建Redis连接(web前端连接redis)
- 让WEB连接REDIS打通数据桥梁(使用web连接redis)
- 单构建基于Oracle Web表单的强大数据库系统(oracle web表)
- Oracle Web服务上的开放端口(oracle web端口)
- WEB标准网页布局中尽量不要使用的HTML标签
- c#封装百度web服务geocodingapi、百度坐标转换示例