Friday 25 March 2011

Setting AM Parameters at Server Startup

It is always possible to set the am p[arameters like jbo.ampool.initpoolsize , jbo.dofailover etc while starting a weblogic server. It will be applicable for all the applications deployed in the server. To do this we must set the environ ment variable without tampering the default setDomainEnv.cmd or startWebLogic.cmd file.


To do this I have created one custom script

For my case the domain's bean location is D:\Oracle\Middleware\user_projects\domains\LoanDeliveryDomain\bin

My script looks like below


cd \
D:
cd Oracle\Middleware
cd user_projects\domains\LoanDeliveryDomain\bin
set JAVA_OPTIONS=%JAVA_OPTIONS%
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djbo.ampool.initpoolsize=110
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djbo.ampool.minavailablesize=50
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djbo.dofailover=true
startWebLogic.cmd

as I am using windows environment. It should be almost same for unix environment also.

Now if I start the server it will be automatically set during server startup

Below is the screenshot



Please add comments :)


Monday 7 March 2011

ADF Popup

Like any web application it is required to show pop up window in certain cases in ADF also. In ADF it can be shown in  many ways. Like we can show popup using javascript, using taskflow using pop up component etc. Here I have discussed ADF's popup component for showing the pop up, the simplest one I think. To show popup I first made one web application with one test page.



I have added one command button. I will show the popup for buton action.


I have added one <af:popup> component in the page as shown below in the below page. Added one dialog in that popup window.



Now I want to show the popup window on button action so I have added <af:showPopupBehavior> inside the command button component.



In show popup behavior I have added the popup id and button action.


Now if I run the page and click the button it will show the popup window.




This popup window can be shown from managed bean also.

Custom Filter/Servlet In ADF

Like any web application some time it is required to use custom filter/ servlet in ADF also. Here is the description of for my case. To use my custom filter I have created one Fusion Web application first.


Then I created my custom Filter named MyFilter.java. I have written my custom code in the overridden doFilter method of my custom filter.

I have used the below code in my doFilter method.

        long initialTime = (new Date()).getTime();
        filterChain.doFilter(servletRequest, servletResponse);
        long afterTime = (new Date()).getTime();
        System.out.println("Time To Process Request:"+ (afterTime-initialTime));


Here the filter is added in web.xml with filter name myCustomFilter. The screen shots are below. I want that every pages should pass through this filter. Any one can use directly <filter-mapping> also.



Now I have created one bounded task flow to design page flow from First Page to Second Page. I do not want to create the pages as page fragments. So I unselected this option.



I created the pages as viewq.jspx and view2.jspx . In view1.jspx I have added one button whoose action will redirect me to second page.








Now if I run the taskflow then I can see from the console(sysout from my Custom Filter) that it is showing time to process the requests.

The filters may be added in other ways also. This is just one example.

Please comment.