Parameters to initialize context for a managed bean adfc-config file. XML
HelloI posted a question on SO: http://stackoverflow.com/questions/14467013/context-initialization-parameters-for-managed-bean
In fact, why the following works in faces - config.xml:
< managed-bean >
reportBean < managed-bean-name > < / managed-bean-name >
ca.corp.report.view.OracleReportBean < managed-bean-class > < / managed-bean-class >
application of < managed-bean-scope > < / managed-bean-scope >
< managed property >
> property name < reportServerProtocol < / property-name >
java.lang.String < class property > < / class property >
< value > #{initParam ['reporting.server.protocol']} < / value >
< / the managed property >
...
< / managed-bean >
But does not work in adfc - config.xml?
Thank you!
Hello
should work the same. If it isn't then it's a bug that should be filed against the latest version of the release of JDeveloper you use
Frank
Tags: Java
Similar Questions
-
ADF 11 g: unable to get the value managed bean
Hello
I am facing a strange problem in ADF 11 g.
The backup of my main page bean is known as MainC.java
From this file, I am setting some parameters in a file called PIn.java (PInis a simple bean with getter and setter methods)
Code parameter set is running successfully to support bean (MainC.java).
But when am retrieving data I'm not getting any value.
I tried the same thing by using a java class instead of backing bean, but there, too, the problem is same value sets but not able to recover.
My faces - config.xml is to be entered for the managed - bean PIn.java and I have tried with all eligible scopes for the bean.
Please give pointers to resolve this problem.
Thanks in advanceSRY... my mistake :-)
FacesContext context = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession)context.getExternalContext().getSession(true); sessionInstance = (PiV)session.getAttribute("PiV"); if(sessionInstance == null) { sessionInstance = new PiV(); session.setAttribute("PiV", sessionInstance); }
The clause if the new statement was erroneous. It has been created a new body, whose only knews by your method :-) Now your variable overall "sessionInstance" has been completed.
Majo
-
Difference between the managed bean scopes.
Hello.
I have jdeveloper 11g and I wanted to know what is the difference between the scopes when managed beans (FlowScope, request, Backed Bean, etc.).
Kind regards.
Refer
-
parameters to initialize database 10g 11i
Hello
Apps version: 11.5.10.2
Database: 10.2.0.4
Windows o/s
I'm referring to parameters to initialize database for Oracle Applications Release 11i [216205.1 ID].
I have the following two parameters the value in my file of parameters in the document mentioned above, these are in the deletion list.
join_enabled index
query_rewrite_enabled
Is it safe to remove my file of Pará.
Concerning
TaherTaher,
I have the following two parameters the value in my file of parameters in the document mentioned above, these are in the deletion list.
indexjoin_enabled
query_rewrite_enabledIs it safe to remove my file of Pará.
If both in the elimination list, then it should be safe to do so. Try this on a test first instance before applying it on your production instance.
Kind regards
Hussein -
@EJB does not not for controlled in adfc-config beans
using adf 11.1.1.3
We have an application that uses the EJB (deployed on the WLS even our application). We notice that when we create beans controlled in the adfc-config and use the @EJB annotation to get an instance of the sessionbean, it does not work.
The error we get is a simple nullPointerexception pointing to the EJB.
When we register the bean in faces - config.xml, instead of the adfc - config.xml, we receive an instance of the EJB.
I also have a nullpointerException when I add the bean managed a taskflow instead of the adfc-config.
It is an example of the bean:
When I sign this adfc-config bean I get a nullpointer on service.public class HomeTest { @EJB MyService service; public HomeTest() { } public List getData(){ return service.getSomedata(); } }
When I join the bean in faces-config, it works.Hello
I think that if the solution is then JSF supports this
1. use @EJB in a managed bean added to a servlet (application session request) scope in faces-config. XML
2. in the managed bean ADFc, use EL to resolve access to the bean managed in faces - config.xml and pass the handle of the EJB instance
Frank
-
Hi experts,
In what two places you configure controlled beans?
A. in the definition of page file
B. in the faces-config file. XML
C. in the adfc-config. XML
D. in the Properties Inspector
E. in the workflow definition files
Thank you
In the faces-config file. XML
. In the config.xml file - adfc
-
Need help for managed bean - to the values of the extraction of data loading of jsf is
Hello
in the construction of managed bean, I wrote code to extract values from database.
but for each action (such as button clicks, drop-down list changes etc...) this constructor is called I don't want.
I tried to over come this using beforePhase event of the jsf. but sometimes it doesn't property.
Someone please help me to retrieve the values of data base loading of jsf is.
Thank you
VeeraVeera
If you want to execute a method in a method beforePhase only once (when loading the page) then you can check the expression #{adfFacesContext.initialRender} before running all you want.import javax.el.ELContext; import javax.el.ExpressionFactory; import javax.el.ValueExpression; import javax.faces.application.Application; import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; public class Test { public boolean isInitialrender() { FacesContext fctx = FacesContext.getCurrentInstance(); Application application = fctx.getApplication(); ExpressionFactory expressionFactory = application.getExpressionFactory(); ELContext context = fctx.getELContext(); ValueExpression createValueExpression = expressionFactory.createValueExpression(context, "#{adfFacesContext.initialRender}", Object.class); Boolean isInitialrender = (Boolean)createValueExpression.getValue(context); return isInitialrender; } public void beforePhaseMethod(PhaseEvent phaseEvent) { // Add event code here... if (isInitialrender()) { System.out.println("This statement is shown once... when the page is loaded"); } } }
-
How to call a function with parameters in jsf managed Bean
Hello
1. I created a Bean managed to manage chains of jsf to 11.1.1.7 WebCenter spaces:
public class ManageStrings {}
/ * Converts all characters in a string to uppercase. */
public String getToUpperCase (String str) {}
Dim retVal = str.toUpperCase ();
Return retVal;
}
}
2. I registered managed Bean:
" < managed-bean id ="swc_3"xmlns =" http://xmlns.Oracle.com/ADF/controller "> "
< id managed-bean-name = "swc_2" > tools < / managed-bean-name >
< managed-bean-class id = "swc_1" > cat.badalona.webcenter.utilities.ManageStrings < / managed-bean-class >
< managed-bean-scope id = "swc_4" > backingBean < / managed-bean-scope >
< / managed-bean >
3 to code jsf, I tried different options, but they do not work
" < = xmlns:af af:outputText ' http://xmlns.Oracle.com/ADF/faces/rich "value="#{backingBeanScope.utilities.getToUpperCase['hello']}"/ > "
...
" < = xmlns:af af:outputText ' http://xmlns.Oracle.com/ADF/faces/rich "value="#{backingBeanScope.utilities.toUpperCase['hello']}"/ > "
..
" < = xmlns:af af:outputText ' http://xmlns.Oracle.com/ADF/faces/rich "value =" #{backingBeanScope.utilities.getToUpperCase ('hello')} "" / >
What I am doing wrong?
Thaks in advance
Hello Carles,
I did it with the content presenter where I need to pass the ID of the component selected in backing bean. Please try below option
Now add following code in your binding
Private RichOutputText outputText1;
then the getter for this outputtext set.
and in your action method to read the value of the output text.
Hope this helps with your problem.
Thank you
Amey
-
The flow of work, Servlet, popup and a managed Bean validation
Hello
We try to display a PDF file in a pop-up window by calling a Servlet in a JSF page using a workflow in JDeveloper 11 g R2.
The relevant part of JSF:
The /pdfservlet points to a Servlet with a method doGet as follows:<af:inlineFrame id="if1" shortDesc="Report" source="/pdfservlet" styleClass="AFStretchWidth"></af:inlineFrame>
The Servlet is trying to get the FacesContext, but we met with the following exception:protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.reset(); OutputStream out = response.getOutputStream(); FacesContext context = this.getFacesContext(request, response); OracleReportBean bean = context.getApplication().evaluateExpressionGet(context, "#{reportBean}", OracleReportBean.class); bean.run(context, out); removeFacesContext(); out.close(); }
We have removed the following lines to the getFacesContext() method:Caused By: javax.faces.FacesException: Cant instantiate class: oracle.adfinternal.view.faces.component.AdfViewRoot.
This avoids the exception above, however... We try to get the settings of the form that was submitted. Here is an example of the form element:UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, ""); facesContext.setViewRoot(view);
When the Servlet calls the Bean managed to retrieve the value, it uses:<h:inputHidden value="MyMedicationList_Report" id="system_REPORT_RESOURCE"/>
Where getRequestParameters() tries to get the external context to retrieve the map of query parameter values:Map<String, String[]> requestParameters = getRequestParameters(); Parameters p = getParameters(); for( String key : requestParameters.keySet() ) { for( String value : requestParameters.get( key ) ) { int i = key.indexOf( ':' ); if( i >= 0 ) { key = key.substring( i + 1 ); } p.put( key, value ); } }
The card is empty.return getExternalContext().getRequestParameterValuesMap();
I tried after http://www.oracle.com/technetwork/developer-tools/adf/learnmore/oct2010-otn-harvest-183714.pdf by assigning the web.xml file:
And set the data bindings on:<!-- JspFilter must be configured before adfBindings. --> <filter-mapping> <filter-name>JpsFilter</filter-name> <servlet-name>PDFServlet</servlet-name> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping> <filter-mapping> <filter-name>adfBindings</filter-name> <servlet-name>PDFServlet</servlet-name> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping>
The Servlet is running, called the managed bean instantiated, but cannot read the query parameters.<pageMap> <page path="/pdfservlet" usageId="ca_bcpra_promis_reporting_view_PDFServletPageDef"/> </pageMap> <pageDefinitionUsages> <page id="ca_bcpra_promis_reporting_view_PDFServletPageDef" path="ca.bcpra.promis.reporting.view.PDFServletPageDef"/> </pageDefinitionUsages>
Is the button used to start the workflow in a dialog box:
By using a workflow, the user input are validated before the opening of the pop-up window. We want to keep this behavior. The PDF file opens and then returned with a NullPointerException:<af:commandButton text="Run Report" id="submitReport" useWindow="true" windowEmbedStyle="inlineDocument" windowModalityType="applicationModal" windowHeight="500" windowWidth="700" action="runReport"/>
http://pastebin.com/raw.php?i=PaM64jL4
The Servlet, through the managed bean, made a request to the report server to pass parameters and generate a PDF file. The PDF is sent to the browser via the Servlet.
What other steps can we take to:
1. send user and system parameters.
2. generate a PDF file on a remote server.
3 distribute the PDF file to the user in a pop-up window.
Thank you.Here you go
https://www.EverNote.com/shard/S48//sh/ae8f58be-c4d3-4AB9-8F94-3e01d0e967d0/923ab115aca22fd1e2fccbf6321cbf09Timo
-
Accesing EJB in an other managed Bean
Hello
I just wanted to check.
When you want to access an EJB that runs on another weblogic managed server, you should always use a PROVIDER_URL pointing to the t3 of the managed server protocol.
Fix?
Hello
Yes. You will need to provide the url property provider to search for a remote bean.
Java.naming.Provider.URL = t3: / /
: /*
Hashtable env = new Hashtable(); env.put (Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); env.put (Context.PROVIDER_URL, "t3: / /
: " ""); InitialContext context = new InitialContext (env);
*/
It will be useful.
-
Generate PDFS using Managed Bean with custom HTTP headers
Background
Generate a report in various formats (PDF, delimited, Excel, HTML, etc.) using JDeveloper 11 g Release 2 (11.1.2.3.0) when you click on an af:commandButton. See also the version StackOverflow about this issue:
http://StackOverflow.com/q/13654625/59087
Problem
The HTTP headers are sent twice: once by the framework and once by a bean.
Source code
The source code includes:
-Action button
-Managed Bean
-Task flow
Action button
The action of the button:
< af:commandButton text = 'Report' id = 'submitReport' action = "Execute" / >
Managed bean
The managed Bean is relatively complex. The code "responseComplete" get called, however, it does not seem to be called early enough to avoid the framework application writes the HTTP headers.
Substitution of HTTP response header
/**
* Defines the HTTP headers must indicate to the browser that the
* the report must be downloaded (not displayed in the current
* window).
*/
protected void setDownloadHeaders() {}
HttpServletResponse response = getServletResponse();
response.setHeader ("Content-Description", getContentDescription());
response.setHeader ("Content-Disposition", 'attachment filename ='
(+ getFilename());
response.setHeader ("Content-Type", getContentType());
response.setHeader ("Content-Transfer-Encoding',
getContentTransferEncoding());
}
Question answer full
The bean indirectly says infrastructure that the answer is managed (by the bean):
getFacesContext () .responseComplete ();
Bean, run and configure
public void run() {}
try {}
Report = getReport();
Configures (Report.GetParameters ());
Report.Run ();
} catch (Exception e) {}
e.printStackTrace ();
}
}
private void configuration (parameters p) {}
p.put (ReportImpl.SYSTEM_REPORT_PROTOCOL, "http");
p.put (ReportImpl.SYSTEM_REPORT_HOST, "localhost");
p.put (ReportImpl.SYSTEM_REPORT_PORT, "7002");
p.put (ReportImpl.SYSTEM_REPORT_PATH, "/ reports/rwservlet" "");
p.put (Parameters.PARAM_REPORT_FORMAT, 'pdf');
p.put ("report_cmdkey", getReportName());
p.put ("report_ORACLE_1", getReportDestinationType());
p.put ("report_ORACLE_2", getReportDestinationFormat());
}
Workflow
The workflow calls Execute, which refers to the 'run()' of the bean method:
entry-> Home-> run-> ReportBeanRun
Where:
<-l' call the method id = "ReportBeanRun" >
< description > running a report < / description >
Report to run < display name > < / display-name >
< method > #{reportBean.run} < / method >
< result >
success of < fixed-result > < / fixed-results >
< / results >
< / method >
The bean is assigned to the scope of the "demand", with a few managed properties:
< rule of flow control = "__3" id >
hand < of-activity-id > < /-activity-id >
< control-flow-case id = "ExecuteReport" >
run < from outcome > < / de-results >
ReportBeanRun < to-activity-id > < / to-activity-id >
< / control-flow-case >
< / control-flow-rule >
< managed-bean id = "ReportBean" >
< description > running a report < / description >
< display name > ReportBean < / display-name >
application of < managed-bean-scope > < / managed-bean-scope >
...
< / managed-bean >
The "success < fixed-result > < / fixed-result > ' strikes me as wrong - I don't want to not the method call to return to another task."
Restrictions
The report server receives requests from the web server only. The URL of the report server cannot use browsers to download directly, for security reasons.
Error messages
The error message is generated:
Duplicate received headers from the server
349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION) error: multiple headers received separate Content-Disposition. It is not allowed to protect themselves against HTTP response splitting attacks. Nevertheless, the report is generated. Prevents the framework to write headers HTTP would solve this problem.
Question
How can define you HTTP headers in ADF using a workflow to generate a PDF file by calling a managed bean?
Ideas
Some additional ideas:
-Substitute the listener of the Phase of the lifecycle of Page ("ADFPhaseListener" + "PageLifecycle")
-Develop a customized web server Servlet
Related links
-http://www.oracle.com/technetwork/middleware/bi-publisher/adf-bip-ucm-integration-179699.pdf
-http://www.slideshare.net/lucbors/reports-no-notes#btnNext
-http://www.techartifact.com/blogs/2012/03/calling-oracle-report-from-adf-applications.html?goback=%2Egde_4212375_member_102062735
-http://docs.oracle.com/cd/E29049_01/web.1112/e16182/adf_lifecycle.htm#CIABEJFB
Thank you!The problem was that the HTTP headers have been actually written twice:
1. the report server returns the HTTP response headers.
2. the bean was his own (as mentioned in the question) HTTP response headers.
3. the bean was copy all the contents of the report server response, including headers, to the output stream.Firefox has ignored the header in double, but not Google Chrome errors.
-
How to call separate partial trigger on managed bean JSFF component?
Guys and girls,
With the help of JDev 11.1.1.2.0. Looked on the forums and google. The first results are not so large.
Is it possible to call a PPR on a component JSFF from a separate managed bean? He seems to call the FacesContext in this instance calls the JSPX root that contains only a child: the RichDocument.
UIComponent component = FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:table1"); if (component != null) { AdfFacesContext context = AdfFacesContext.getCurrentInstance(); context.addPartialTarget(component); }
Returns 1 :(System.out.println(FacesContext.getCurrentInstance().getViewRoot().getChildCount());
Ideas for a workaround?
Published by: LovettWB on November 17, 2010 03:39
Published by: LovettWB on November 17, 2010 04:11
Published by: LovettWB on November 17, 2010 04:12So maybe this post will help (assuming that your fragment is added to the page as a region): http://biemond.blogspot.com/2009/11/find-uicomponent-in-adf-task-flow.html
-
the managed bean error message display
HIE
on my page there are 3 data related to text entry boxes, and all are mandatory.
There is a text box more input that is not bound to a data control.
the button submit, I have a managed bean action method. In this action method I get the value of these data - not related to the input area and make a logic.
From the I want to launch an error message on the UI for this component.
How to do this?
Vik
http://adfjsf.blogspot.com
http://Twitter.com/vikceoHello
You can do this using the FacesMessage class and this can be written anywhere within action/actionlistener/valuechangelistener/post etc...
Example Code:
//adding global message, which is displayed with af:messages tag FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "Value entered is invalid"); context.addMessage(null, msg); //Component level message, need to use af:message tag. This component level message is also displayed under af:messages tag unless globalOnly property is set to true msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, "component level message - Value entered is invalid"); context.addMessage(FacesContext.getCurrentInstance().getViewRoot().findComponent("
Jean Lou
-
Our security policy requires that all web pages admin must be signed by our CA business. I have successfully implemented a SSL certificate 3rd party Auth Web our WLAN of comments, but I need to install a self-signed certificate for the management of the WLC himself. I followed the instructions here:
http://www.Cisco.com/en/us/Tech/tk722/tk809/technologies_configuration_example09186a00806e367a.shtml
but it was more useful for Web auth. I can't find a specific document explaining how it should be done for the management interface.
Any help much appreciated.
(1) Please use a password. Empty passwords regularly give problems.
(2) you don't recombine the key with the certificate before you download to the WLC:
Combine the CA.pem certificate with the private key, and then convert the file to a .pem file.
Type this command in the OpenSSL application:
openssl>pkcs12 -export -in CA.pem -inkey mykey.pem -out CA.p12 -clcerts
-passin pass:check123 -passout pass:check123
!--- This command should be on one line.
openssl>pkcs12 -in CA.p12 -out final.pem -passin pass:check123 -passout pass:check123
Note: In this command, you must enter a password for the parameters -passin' and -passout . The password is set to the setting -passout must match the setting SubscriptionId is configured on the WLC. In this example, the password is configured at the time the -passin' and settings -passout is check123. Step 4 of the procedure in the section download the WLC third certificate of this document deals with the configuration of the SubscriptionId parameter.
The final.pem is the file that is transferred via TFTP to the Cisco WLC.
Now that you have the certificate of the third-party CA, you must download the certificate to the WLC.
-
Using @Interceptors with ADF managed beans
Hi Experts,
I am using the annotation javax.interceptor.Interceptors on my methods of ADF managed beans, but my methods of interception are not get called.
Is it possible to use it with controlled beans? Has anyone tried this before?
JDev: 11.1.1.7
Java: 1.7
MyInterceptor.java
=========
public class MyInterceptor {}
public MyInterceptor() {}
Super();
}
@AroundInvoke
public object intercept (InvocationContext context) throws Exception {}
System.out.println ("MyInterceptor - logging BEFORE calling method:"+ context.getMethod () .getName () ");
Object result = context.proceed ();
System.out.println ("MyInterceptor - logging AFTER calling method:"+ context.getMethod () .getName () ");
return the result;
}
}
=========
SomeBean.java
=============
public class SomeBean {}
@Interceptors (MyInterceptor.class)
{} public void doReset (ActionEvent actionEvent)
do something
System.out.println ("In reset");
}
}
=============
Thank you
Soham
As far as I KNOW, JSF(and ADF) can't stand the interceptors.
Maybe you can try this in 12.2.1 jdev because with this version is packaged 2.2 JSF (which should support the CDI)
Dario
Maybe you are looking for
-
HP Pavilion g125ds 17: HP Pavilion g125ds 17
It bought nine and Win10 of hatred. Wipe the disk and put Win7 Ultimate on and nothing works, no USBs, no Ethernet, NOTHING. I downloaded ALL the drivers for Win 7 and Win 10 and still NOTHING! I have to burn it to a cd/dvd, because nothing works...
-
How can I connect my V5 Aspire to my TV so I can watch Marie-Paule etc. on TV?
-
MrFixit for the repairman to Inbox
Need help how to find the Inbox Repair - I get a message saying that some errors are in my Outlook 2007 e-mail program, when I try to open it!
-
When you use Internet Explorer 7, internet browsing, etc... I continually get this box pops up that says: "a website wants to open web content using this program on your computer" and it lists the program as 'csc.exe' by Microsoft. This happens on a
-
Cannto connect you to xbox live
I have reset my password today because it has been some time since the last one, I signed, on my ire that the new password is not accepted when I tried to connect to xbox live, but works fine on my account live on the internet on the PC