When you log on to OFBiz, a specified module is entered by default.

Source: Internet
Author: User

Disclaimer: this modification is intended for the ofbiz10.04 version. This blog is not legally liable if the modification is ineffective due to different versions!

1. Enter the OFBiz project and press Ctrl + Shift + R to quickly find the controlservlet. Java file.

2. Press Ctrl + L to quickly locate row 152. Add the followingCode:

 
If(Request. getattribute ("targetrequesturi") =Null){If(Request. getsession (). getattribute ("_ previus_request _")! =Null) {Contextpath= "/Myportal ";//Currently, the default logon module is myportal, which is the "My portal" module. If you want to enter another module by default, change it here.!}}

3. Of course, the login user must have the access permission of the default module to log on. Otherwise, the following error is reported: the application cannot be logged on.Program"!

You can log on to a specified module by default in the preceding three steps!

 

Why? I don't quite understand the meaning of the new Code. I am on duty for a long time. I recommend a blog for your reference:

Http://dagmom.iteye.com/blog/1625642

 

========================================================== ========================================================== ========================

(#) Another scenario is: how to implement this function when you enter URL: https: // localhost: 8443 in the address bar to enable the system to automatically jump to a specified function module?

After in-depth analysis of OFBiz source code, we found that there are still solutions!

The announcement is as follows:

Take the myportal module as an example,Find the XML for loading the myportal Module: Ofbiz-component.xml, enter this XML to find this sentence:

<WebappName= "Myportal"Title= "Myportal"App-bar-Display= "True"Base-Permission= "Myportalbase"Server= "Default-server"Location= "Webapp/myportal"Mount-point= "/Myportal"/>

This sentence is mainly used to load the current module! Name: Module name; base-permission: whether you have the permission to enter the current module; Location: module path; mount-point: what I understand is, similar to <URL-pattern> In the <servlet-mapping> label, that is, the page request URL.

To complete the above (#) situation, you just need to append a sentence in the ofbiz-component.xml file:

 
<WebappName= "Myportal"Title= "Myportal"App-bar-Display= "True"Base-Permission= "Myportalbase"Server= "Default-server"Location= "Webapp/myportal"Mount-point= "/"/>

Note that the above Code only has attributes:Mount-pointIn this way, we enter https: // localhost: 8443 in the address bar to jump toMyportal ModuleThe purpose is clear!

 

This article is the author of the original, if you need to reprint, please attach the original link: http://www.cnblogs.com/Ivan-j2ee/archive/2012/08/13/2636603.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.