Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor corrections for clarity and conciseness

...

Step - 6 : Move up one level and create a new directory named 'error'(hot-deploy/practice/webapp/practice/error).
Step - 6.a : Create a file error.jsp inside the "error" directory. Contents of this file can be taken from any of the existing component e.g. example component.
The location of your error page will be specified in the beginning of your controller.xml file like <errorpage>/error/error.jsp</errorpage> . You will need to make or copy over a /webapp/practice/error/error.jsp page to show an error message to the user.
Step - 7 : Create a sub-directory inside your component directory "practice" named "widget"(hot-deploy/practice/widget).
              This directory will contain your forms and , menus, and screens which will be created for UI.
Step - 8 : Create a file inside the directory "widget" named "PracticeScreens.xml".
 Contents of this file can be taken from any of the existing component  e.g. example component.
As now onwards you will be able to create screens views so an important reading at this place will be Best Practices Guide . On this page there links to following:

...

Step - 9 : Now that we have the basic elements in place lets review the basic flow no matter how large or complex your component gets. First, a request will be made by a browser to see a specific resource. Take for example the request:
"localhost:8080/practice/control/main" 1.

  1. When OFBiz sees this request it will look at the /practice section first.

...

  1.  This is because in our ofbiz-component.xml file we said our webapps mount point would be /practice. Now OFBiz knows that our practice component will handle the rest of the request.

...

  1. OFBiz will then look at our controller.xml file. Inside our controller.xml file we have request-maps and view-maps. If it finds a request-map with the name 'main' it will use the associated view-map, as follows. The request-map can either specify a view, or as we will see later an event or a service. If it specifies a view it will look further down in the controller.xml file and see if there is a view-map with the name specified by the value tag in the request-map.

...

  1. For now we will keep it simple and assume that all the views go to a type=screen. If this is the case then the page tag will specify a path to a screen definition file as well as a screen name to display after the "#" sign.

Step - 10 : Now its the time to run you first practice application:!

Start the server by typing the following at the command line : java -Xmx256M -jar ofbiz.jar (the -Xmx256M command just ensures that the program has enough memory) Then, hit the url http://localhost:8080/practice/control/main in your browser.
Browser   Your browser should show "This is first practice" as seen below.

Output Screen :

Step - 11 : Now create Create a file in the webapp directory "practice" by name named index.jsp (Contents of this file can be taken from the "example" component), this . This file is responsible for redirecting the response to control/main if you give url  a url such as  http://localhost:8080/practice/ and if . If you give url like a url such as http://localhost:8080/practice/unknown/requestit will be redirected to the redirectPath specified in web.xml. In that case, ContextFilter will filter out the request and use this use the redirect path to redirect the request.

...