原创 2004年07月28日 15:40:00

When you are tracing pages, make sure you follow the page description XML file and see what actions are called. 99.9% of the time variables in a page were placed there by an action. Either the page action or some other action which previously ran.

One thing to know which is good for everyone is how a page is rendered.

  1. the view is mapped to a FTL file (via the jpublish ViewHandler)
  2. JP will take the name of the page, drop the extension append .xml to the name and lookup the definition for the page in the defined page definition directory (/WEB-INF/pagedefs).
  3. all page actions are run.
  4. the page is merged with a template and all template actions run
  5. the template will include content, and as it does each action for the content is run. When content is included the definition is looked up just like a page (and they are found in the same place) so it acts just like a page would, except they are not merged with a template.
  6. finally freemarker is called and the page is rendered

This should help some with tracing down and finding things.


We try to explain this in detail for the ecommerce open questions are marked with

The entry point is http://localhost:8080/ecommerce/ it will call index.jsp as specified in the web.xml file at )

First I thought the section > >> > >> redirectPath > >> /control/main > >> is relevant but Andy said > This is a filter setting. The filter is for several purposes. > - Sets up ofbiz objects for events and page processing. (delegator, > dispatcher, security objects) > - Protects the raw templates; restricts access so the raw templates > cannot be downloaded from the server, this "redirectPath" is the > setting to tell the filter where to re-direct these requests to. So, if > you request something invalid rather then getting a 404 you get the > main page.

Ofbiz/components/ecommerce/webapp/ecommerce/index.jsp. This JSP page will redirect to /control/main. statement is <%response.sendRedirect("control/main");%>it will redirect to below URL http://localhost:8080/ecommerce/control/main

When above URL is requested it will look in WEB-INF/controller.xml

in above lines you see the response type as view, than it will look for view-map tag in Controller.xml

this view-map type is jpublish so it will be rendered with jpublish. WEB-INF/jpublish.xml. This means main.ftl is rendered, but first the page in the repository (WEB-INF/pagedefs/main.xml)is rendered

Same chain follows for every request Controller.xml --> --> --> Jpublish.xml --> /pagedef/ --> -->/actions/BSH Scripts. --> than displays appropriate *.ftl file for Presentation to user.

main.xml has this code

<?xml version="1.0" encoding="UTF-8"?> main_lrMain PagePageTitleMainmain
the descriptions of above attributes is.

main_lr this will call webapps/ecommerce/templates/main_lr in this main_lr the layout is defined, This is mainly


this first action goes to Bean shell script of main.bsh (WEB-INF/actions/main.bsh) this will setAttribute("productCategoryId"). which we are see ing (FEATUTRE CATEGORY from DEMOSHOP) than second action

this action goes to category.bsh (web-inf/actions/category/category.bsh). here see the code at last context.put("detailTemplate", detailTemplate); here context is having global access variable. What does this mean?

Then again the main.ftl will be displayed after all this is processed

C:/ofbiz/ofbiz/components/ecommerce/webapp/ecommerce/main.ftl Ups there is not much inside: ${pages.get("/catalog/category.ftl")} Is this true? it renders /catalog/category.ftl This file contains a little bit more <#assign uiLabelMap = requestAttributes.uiLabelMap> <#if productCategory?has_content> ${pages.get(detailTemplate)} <#else>

${uiLabelMap.ProductCategoryNotFoundforCategoryID} ${requestParameters.category_id?if_exists}!
#IF>Is detailTemplate a global variable? Isnt it set via category.bsh as detailTemplate = "/catalog/categorydetail.ftl"; Which possibilities do I have to find out the value it contains during runtime? At which point is specified that the cataloglist in the middle of control/main

Another example http://localhost:8080/ecommerce/control/viewprofile.

In the controller.xml this is mapped and

Lets get into detail of /customer/viewprofile.ftl This must be the lowest level!? Ok the content looks like the form for editing the customers profile. No, its not the form! Just the view! No input-fields!. I found the inputfields in /editperson! So what happens when I invoke the post action?

/createPerson/${donePage}@ofbizUrl>" method=post>mmh? What does that mean? > <@ofbizUrl> will read the controller.xml file to determine > if the next url is to be directed through SSL or not. It also checks > the browser for cookie support and if none is found re-writes the URL > to include the session ID. It is recommended to ALWAYS use this tag (or > transform in freemarker lingo) for your URLs (unless of course they > point somewhere outside of OFBiz).

Ok again consulting the controller.xml invoke mmh The key must be org/ofbiz/party/party/PartySimpleEvents.xml. A find helps and I found it in C:/ofbiz/ofbiz/components/party/src/org/ofbiz/party/party. However I dont see this file in eclipse! Question: Any hints? I tried it in the package exloperer and the It contains the following relevant part: Person successfully created.


2018.2.17李锦浩【第130天】学习完了javaweb的九大内置对象,今天来尝试制作一个简单的登录网站。附:&lt;%@ page language="java" i...
  • star_lord123
  • star_lord123
  • 2018年02月17日 08:45
  • 40


最近的学习笔记,记录一些通俗易懂的学习类文章。更像是好资料参与索引。1、foreach 语句为数组或对象集合中的每个元素重复一个嵌入语句组。foreach 语句用于循环访问集合以获取所需信息,但不应用...
  • metababy
  • metababy
  • 2007年11月12日 16:36
  • 1384


我打算从今天开始记录我的学习历程,也作为激励自己的方式 以后的博文会围绕oracle,python,linux几个主题 可能会掺杂一些目前所在行业的知识,不求有人关注,只求能给刚入门的孩子们有一些...
  • u010680713
  • u010680713
  • 2017年06月08日 14:33
  • 129


  • fantasydragon2
  • fantasydragon2
  • 2007年06月03日 23:21
  • 605


学习经历高考时,我的英语水平是135分左右。大一时学校虽然开设英语课,但是很无聊,加上不知道应该如何学英语,基本上就没怎么学。大二上学期在 Coursera 上参加了一门 Java Programin...
  • dingsanwen
  • dingsanwen
  • 2017年10月08日 11:45
  • 287


  • terence1212
  • terence1212
  • 2017年01月08日 16:11
  • 2050


本人是某普通2本的大一学生,经过了一个学期的迷茫加颓废,第一次在csdn上写文章,想让自己的学习更加有意义。最近学数据结构,学到栈和队列,老师设计了几个实验,就拿其中一个来说说自己的感受吧。 不...
  • qq_37924510
  • qq_37924510
  • 2017年04月20日 20:02
  • 208


//这段代码是在播放页面上的 var long1 = 38; var videoIdStr = 176+""; var c = 0; var t; var d = 3; $(funct...
  • tommycsdn
  • tommycsdn
  • 2016年06月01日 21:16
  • 917


嵌入式学习路线与方法 一、嵌入式开发用到哪些知识 1、编程语言: 第一层次(C语言),第二层次(ARM汇编、shell脚本、C++、Java); 2、操作系统: 第一层次(lin...
  • Wekic
  • Wekic
  • 2017年02月03日 20:14
  • 453


  • u010924878
  • u010924878
  • 2015年08月31日 08:04
  • 856