Login.flt中
<img align=absbottom vspace=2 border=0 src="<@ofbizUrl>/CreateImage?Image=${encryRandom}&Rgb=255|0|0</@ofbizUrl>" title="验证码图片"></p>
<#assign random = Static["org.ofbiz.webapp.control.Picture"].getRandom()>
<#assign encryRandom = Static["org.ofbiz.webapp.control.Picture"].manage(random)>
controller.xml文件中
<!--pht-->
<request-map uri="CreateImage">
<event type="java" path="org.ofbiz.webapp.control.CreateImage" invoke="make"/>
<response name="success" type="none"/>
<response name="error" type="none"/>
</request-map>
LoginWorker.java 类中的login方法:
String attach = null;
String get_attach = null;
if (attach == null)
attach = request.getParameter("attach");
if (get_attach == null)
get_attach = request.getParameter("get_attach");
if (get_attach == null) {
String errMsg = "系统错误,请再次登录!";
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
String tmp = Picture.discrypt(get_attach);
if (!attach.equals(tmp)) {
String errMsg = "请输入正确的验证码!";
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
因此在login.flt 中:
<#assign attach = Static["org.ofbiz.webapp.control.Picture"].discrypt(encryRandom)>
<input type="text" class="inputBox" name="attach" value="${attach}" size="4"/>
分享到:
相关推荐
ofbiz实现oracle平台小例子详解步骤及注意的问题.doc,很详细
OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门OFBIZ快速入门
里面是下载地址,如果逆向开发ofbiz,只要下载它就绝对没错了 Apache+OFBiz+开发初学者指南.rar OFBiz开发快速入门.rar OFBiz-技术文档.rar OFBiz API中文版.rar Apache OFBiz Cookbook Sep 2010.rar Opentaps ...
像 Tomcat, Ant, BeanShell, Jboss 等,构建了一个强大的系统平台,Ofbiz 已经完成了大部分商务类软件系统 都需要的部件,像用户认证、工作流、商务规则处理等,Ofbiz 的核心技术在于 Entity Engine,其他的组件基本...
ofbiz的获取与部署,主要用到了gradle 和 eclipse,注意:cmd部署时,需要一个较好的网络环境以下载gradle
自学整理的ofbiz学习笔记,自学整理的ofbiz学习笔记,自学整理的ofbiz学习笔记,自学整理的ofbiz学习笔记,适合初学者,可以下个看看
ofbiz jar file, some jars for ofbiz
ofbiz sql 表结构
OFBiz集成Spring和Activiti,详细设计说明书。ofbiz版本12.04
ofbiz权限非常介绍,ofbiz进阶之权限介绍!
ofbiz数据结构
浅谈OFBIZ.doc浅谈OFBIZ.doc浅谈OFBIZ.doc浅谈OFBIZ.doc浅谈OFBIZ.doc
apache-ofbiz-16.11.02.zip,ofbiz菜鸟笔记,Apache+OFBiz+开发初学者指南.chm
OFBIZ开发指南 英文2OFBIZ开发指南 英文2OFBIZ开发指南 英文2
关于ofbiz的资料,很多,用ofbiz技术的朋友们赶快下载吧
OFBiz 主题修改文档
ofbiz很好的学习资料,学习了很多,希望对你也能有帮助!
ofbiz一个完整例子,ofbiz学习实战例子.
基于spring封装的ofbiz所有服务,使用spring security进行安全验证,可以方便的发布为微服务,同时实现了一套直接使用ofbiz实体引擎操作ofbiz所有数据库表的spring应用框架设计
ofbiz入门图文讲解,包括入门helloworld 和使用ofbiz 新建实体 操作数据库对实体增删改查