分布式块设备复制(DRBD)基本环境搭建
2014-11-29 20:20
246 查看
本文首先感谢网上的Ofbiz的博客文章!!!
从controller.xml中
<request-map uri="login">
<security https="true" auth="false"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="login"/>
<response name="success" type="view" value="main"/>
<response name="error" type="view" value="login"/>
</request-map>
因此:
<view-map name="login" type="screen" page="component://party/widget/partymgr/CommonScreens.xml#login"/>
CommonScreens.xml文件中
<screen name="login">
<section>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<html><html-template location="component://common/webcommon/login.ftl"/></html>
</platform-specific>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
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"/>
从controller.xml中
<request-map uri="login">
<security https="true" auth="false"/>
<event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="login"/>
<response name="success" type="view" value="main"/>
<response name="error" type="view" value="login"/>
</request-map>
因此:
<view-map name="login" type="screen" page="component://party/widget/partymgr/CommonScreens.xml#login"/>
CommonScreens.xml文件中
<screen name="login">
<section>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<platform-specific>
<html><html-template location="component://common/webcommon/login.ftl"/></html>
</platform-specific>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
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"/>
相关文章推荐
- Android开发环境的搭建之(四)虚拟设备AVD的基本配置
- [NUST-Wangpeis]基于i.MX287学习Linux[1]---基本环境搭建及设备信息
- mysql 复制 总结(一) 基本概念以及环境搭建
- Ubuntu Server基本的环境搭建
- iPad开发学习之一环境搭建和基本概念
- java开发环境的搭建-----mysql的基本命令(五)
- 用RMAN复制 搭建 物理 Data Gurad 环境
- lamp环境的基本搭建
- 精品教程--Android基本概念以及开发环境搭建
- iPad开发环境搭建和基本概念
- iPad开发环境搭建和基本概念
- Cisco设备及网络环境搭建模拟利器
- Eclipse基本J2EE开发环境的搭建
- 使用drbd搭建一个存储复制的集群
- Linux高可用集群(二):DRBD分布式复制块设备简介和使用
- WinCE设备仿真器+虚拟串口+GPS模拟器搭建开发测试环境
- lamp环境的基本搭建
- ubuntu下c/c++基本编译环境的搭建
- 用RMAN复制 搭建 物理 Data Gurad 环境
- spring的原理,基本API,开发流程,环境搭建.