注:转自它处

1.下载 ofbiz 9.04

2.将下载的文件解压在 E:盘下,改名:E:\ofbiz9

3.E:\ofbiz9\hot-deploy 下新建hello文件夹

4.E:\ofbiz9\hot-deploy\hello 下新建 webapp 文件夹和 ofbiz-component.xml 文件

<?xml version="1.0" encoding="UTF-8"?>

<ofbiz-component name="hello"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-component.xsd">
    <resource-loader name="main" type="component"/>
    <webapp name="hello"
         title="My First OFBiz Application"
         server="default-server"
         location="webapp/hello"
         mount-point="/hello"
         app-bar-display="false"/>   
</ofbiz-component>

5.E:\ofbiz9\hot-deploy\hello\webapp下新建 hello 文件夹

6.E:\ofbiz9\hot-deploy\hello\webapp\hello下分别新建 WEB-INF文件夹和 main.ftl文件

<h1>Hello OFbiz</h1> 
<p>我的第一个测试页面正在运行...</p>

7.E:\ofbiz9\hot-deploy\hello\webapp\hello\WEB-INF下新建web.xml文件和controller.xml文件

web.xml:

<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
    <display-name>Hello</display-name>
    <description>The First Hello World Application</description>

<context-param>
        <param-name>entityDelegatorName</param-name>
        <param-value>default</param-value>
        <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>
    </context-param>
    <context-param>
        <param-name>localDispatcherName</param-name>
        <param-value>hello</param-value>
        <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description>
    </context-param>
    <context-param>
        <param-name>serviceReaderUrls</param-name>
        <param-value>/WEB-INF/services.xml</param-value>
        <description>Configuration File(s) For The Service Dispatcher</description>
    </context-param>

<filter>
        <filter-name>ContextFilter</filter-name>
        <display-name>ContextFilter</display-name>
        <filter-class>org.ofbiz.webapp.control.ContextFilter</filter-class>
        <init-param>
            <param-name>disableContextSecurity</param-name>
            <param-value>N</param-value>
        </init-param>
        <init-param>
            <param-name>allowedPaths</param-name>
            <param-value>/control:/select:/index.html:/index.jsp:/default.html:
                               /default.jsp:/images:/includes/maincss.css</param-value>
        </init-param>
        <init-param>
            <param-name>errorCode</param-name>
            <param-value>403</param-value>
        </init-param>
        <init-param>
            <param-name>redirectPath</param-name>
            <param-value>/control/main</param-value>
        </init-param>      
    </filter>
    <filter-mapping>
        <filter-name>ContextFilter</filter-name>
            <url-pattern>/*</url-pattern>
    </filter-mapping>

<listener><listener-class>
              org.ofbiz.webapp.control.ControlEventListener</listener-class></listener>
    <listener><listener-class>
              org.ofbiz.webapp.control.LoginEventListener</listener-class></listener>
    <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface -->
    <!-- <listener><listener-class>
          org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> -->

<servlet>
        <servlet-name>ControlServlet</servlet-name>
        <display-name>ControlServlet</display-name>
        <description>Main Control Servlet</description>
        <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>ControlServlet</servlet-name>
        <url-pattern>/control/*</url-pattern>
    </servlet-mapping>

<session-config>
        <session-timeout>60</session-timeout> <!-- in minutes -->
    </session-config>

<welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>
</web-app>

controller.xml

<?xml version="1.0" encoding="UTF-8" ?>

<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/site-conf.xsd">
    <description>First Hello World Site Configuration File</description>
    <owner>Open For Business Project (c) 2005 </owner>
    <errorpage>/error/error.jsp</errorpage>

<handler name="java" type="request" class="org.ofbiz.webapp.event.JavaEventHandler"/>
    <handler name="soap" type="request" class="org.ofbiz.webapp.event.SOAPEventHandler"/>
    <handler name="service" type="request" class="org.ofbiz.webapp.event.ServiceEventHandler"/>
    <handler name="service-multi" type="request" class="org.ofbiz.webapp.event.ServiceMultiEventHandler"/>
    <handler name="simple" type="request" class="org.ofbiz.webapp.event.SimpleEventHandler"/>

<handler name="ftl" type="view" class="org.ofbiz.webapp.ftl.FreeMarkerViewHandler"/>
    <handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/>
    <handler name="screen" type="view" class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/>

<handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/>

<preprocessor>
        <!-- Events to run on every request before security (chains exempt) -->
        <!-- <event type="java" path="org.ofbiz.webapp.event.TestEvent" invoke="test"/> -->
        <event type="java" path="org.ofbiz.securityext.login.LoginEvents" invoke="checkExternalLoginKey"/>
    </preprocessor>
    <postprocessor>
        <!-- Events to run on every request after all other processing (chains exempt) -->
        <!-- <event type="java" path="org.ofbiz.webapp.event.TestEvent" invoke="test"/> -->
    </postprocessor>

<!-- Request Mappings -->
    <request-map uri="main">
        <response name="success" type="view" value="main"/>
    </request-map>

<!-- end of request mappings -->

<!-- View Mappings -->
    <view-map name="error" page="/error/error.jsp"/>
    <view-map name="main" type="ftl" page="main.ftl"/>
    <!-- end of view mappings -->
</site-conf>

8.运行 E:\ofbiz9 下startofbiz.bat

9.稍等几秒 输入http://localhost:8080/hello/,页面显示如下:

Hello OFbiz

我的第一个测试页面正在运行...

Open For Bussiness (HelloWorld)相关推荐

  1. Docker安装Apache与运行简单的web服务——httpd helloworld

    Docker运行简单的web服务--httpd helloworld目录[阅读时间:约5分钟] 一.Docker简介 二.Docker的安装与配置[CentOS环境] 三.Docker运行简单的web ...

  2. CentOS Docker安装配置部署Golang web helloworld

    目录[阅读时间:约5分钟] 一.Docker简介 二.Docker的安装与配置[CentOS环境] 三.Docker部署Golang web helloworld 四.Docker与虚拟机的区别 五. ...

  3. 简单图文配置golang+vscode【win10/centos7+golang helloworld+解决install failed等情况】

    博客目录(阅读时间:10分钟) 一.win10 0.系统环境 1. win10配置golang环境 ①下载相关软件 ②创建gowork工作空间 ③配置环境变量(GOPATH+PATH) ④验证环境配置 ...

  4. idea java jni 调试_IntelliJ IDEA平台下JNI编程(一)—HelloWorld篇

    JNI(Java Native Interface),出于学习JNI的目的,为了能够更方便快速地运行程序.本文的是在IDEA中进行,而不在AndroidStudio,这样能够对NDK的工作过程有个更深 ...

  5. Apache模块开发helloworld无错版

    环境:CentOS 5.4 第一步:安装Apache的apxs 首先来介绍下apache的一个工具apxs.apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具,用于编译一个或多个源程 ...

  6. 1.1GTK+ 的简单程序HelloWorld

    1.1GTK+ 的简单程序HelloWorld 编译执行如图所看到的:

  7. 项目构建之maven篇:2.HelloWorld项目构建过程

    文件结构说明: 项目构建生命周期: 清理 编译 測试 打包 执行 部署 清理与编译 hello\pom.xml POM:Project Object Model,项目对象模型 pom.xml与ant的 ...

  8. Python基础01-Python环境搭建与HelloWorld

    目录 从今天开始学习Python Python环境搭建 安装gcc Python源码包安装 开始Python第一个代码HelloWorld! 从今天开始学习Python 为啥选择Python,可能是跟 ...

  9. 从HelloWorld看Knative Serving代码实现

    为什么80%的码农都做不了架构师?>>>    摘要: Knative Serving以Kubernetes和Istio为基础,支持无服务器应用程序和函数的部署并提供服务.我们从部署 ...

最新文章

  1. SAP WM Storage Location Reference在项目实践中的使用
  2. C++抽象基类和纯虚成员函数
  3. 四十四、深入Java 的序列化和反序列化
  4. idea 新建一个spring项目
  5. LintCode 386. 最多有k个不同字符的最长子字符串(双指针)
  6. super-smack
  7. [ openwrt ] 添加一个通过GPIO控制的LED
  8. 软件设计师考试考点分析总结
  9. android三星滑动解锁,三星怎样取消滑动解锁
  10. 常见大学机房的计算机设备,长江大学公共机房管理办法
  11. MySQL 的 help 命令你真的会用吗?
  12. 中职计算机教师试讲技巧,中职教师资格面试原来是这样考的的!
  13. 解决Everything无法搜索移动硬盘文件问题(utool搜索不到也是因为Everything的问题)
  14. 婆媳兵法之——短兵相接15天
  15. 计算机营销专业,计算机营销专业自我评价
  16. mysql8设置局域网访问
  17. FST构图可视化详解
  18. MySQL-查询权限索引约束
  19. Java?还是大数据?
  20. 存储芯片引脚和时序:SRAM(HY6264A系列)

热门文章

  1. play框架使用起来(7)
  2. ps去除图片中的文字、图层锁定不能解开问题
  3. ubuntu桌面出现问题,重启x桌面方法
  4. redis数据库(一)
  5. 我对移动端架构的思考
  6. Uncaught DONException: Failed to execute ‘atob‘ on “window ‘: The string to be decoded is not carrec
  7. WIN 7 系统 问题记录
  8. ros入门启动小海龟(ros2版本)
  9. 全新Funtool趣工具iApp软件库源码+工具箱源码
  10. 对于年龄偏小的孩子来讲,学习的好坏可能完全取决于家长