JDeveloper 11 g managed bean &; resource bundle mysteries
HelloI literally fight JDeveloper to make the location of my application. I want to set the locale of all my pages to a value of a managed bean (which gets the database for all users), so I put < f: view local = "#{Configuration.language}" > and get all the labels and strings in my UI to a resource group.
Two issues were raised:
1. I created a bean managed and recorded as 'Configuration' in faces-config. XML with scope. The managed bean is a private channel 'language' with accessors. When I use the "expression builder" on any page, it creates the following expression: "#{applicationScope.Configuration.language}". Unfortunately, it returns nothing. Manual change of the expression "#{Configuration.language}" finally returns! Why isn't he created like this by the generator expressions in the first place? I did sth. evil?
2. I created a resource 'view.resources.UIresources' group and registered as "res" in faces - config.Xml. reference manually as #{res ['arbpl.titel ']} works fine. When the regional settings of the page are changed, strings are loaded from the appropriate resource bundle. As there is a lot of hits, I would use the wizard 'Select a resource text' or enter the values directly in the designer.
However, the Assistant to "Select a text resource" refers to some crazy #{viewcontrollerBundle ['arbpl.titel']} and add "< c:set var ="viewcontrollerBundle"value="#{adfBundle['view.resources.UIresources']}"/ >" under the jsp:root. What is everything? The problem is that this way always the default resource group appears to be responsible no matter what locale are defined in the f: view.
Who can help me see clear here?
Thank you
Matt
Matt,
Step 1 - really think you so that it is within reach of the session - if it is different for each user, it should be.
In addition, on the generator, you are using the node called JSF managed Beans and navigate directly on your beans?
John
Tags: Java
Similar Questions
-
Download the managed bean resource file
Hello
Please help me, how can I access and get the values of the resource file in a managed bean?
Thanks in advance
Kind regards
Joseph JobyHello
Check -
How to configure the resource bundle to be referenced by the managed bean file?
I have a class POJO that access a properties file in its constructor:
public ConveroTaskFlowsMapping() {}
resourceBundle = ResourceBundle.getBundle ("com.myapp.MyMappings");
}
The POJO class is used primarily by bean in session managed in the ViewController project. The "MyMappings.properties" was recorded in the corresponding source com/myapp path.
The application works very well in integrated WLS.
When I deploy the application to a standalone WLS 10.3.2, I got the following error when the bean has tried to access the properties file:
JspServlet error: unable to send to the page requested following Servlet: the following exception occurred:javax.el.ELException: java.util.MissingResourceException: can't find bundle for database name
com.myapp.MyMappings, settings regional en_US
I've added what follows to faces - config.xml, but did not help to resolve the error
<>resources-bundle
< name-base > com.myapp.MyMappings < / base-name >
myMappings < var > < / var >
< / resource-bundle >
What did I miss?Hi Priscilla,
It works very well for us. That being said, you should not use ResourceBundle.getBundle ("com.myapp.MyMappings"); in your beans. You should rather inject the bundle name, so the "myMapping' in your example and use:
FacesContext context = FacesContext.getCurrentInstance(); Resourcebundle bundle = context.getApplication().getResourceBundle(context, "myMapping");
This will allow you to declare your Packs in one place, the file faces - config.Xml.
Kind regards
~ Simon
-
Resource bundle file closes automatically - JDeveloper 11 g R1
When I open the resource bundle property file it automatically closes after one or two operations on the other opening files in JDeveloper.
For example, I focus af id property: outputText in the property inspector.
:):) Confirmed!
Pedja
-
Problem of Resource Bundle to the BackingBean
Hello
JDeveloper 11.1.1.3.0
I get null, when I try to retrieve the ResourceBundle using the code below. Help, please.
FacesContext CF = null;
Rb ResourceBundle = null;
CF = FacesContext.getCurrentInstance ();
RB = fc.getApplication () .getResourceBundle (CF, "com.model.ModelBundle");
System.out.println ("rb is:" + rb);
Note: I'm trying to get the default model project resourceBundle value.
Thank you.Hello
Once you have such settings as noted above, you can access the values of the resource bundle in the bean as follows:
Imports
Import oracle.javatools.resourcebundle.BundleFactory;Constants
private static final String RESOURCE_BUNDLE_NAME =
'oracle.apps.sales.mobile.ui.ZmsIPhoneUIBundle ';Code to access all of the resources and get a value associated with a key
ResourceBundle resourceBundle =
BundleFactory.getBundle (RESOURCE_BUNDLE_NAME);
If (resourceBundle! = null)
{
String ActivityName = resourceBundle.getString ("FOLLOW_UP_LABEL");
}Thank you
Nini -
How to reach the property file / resource bundle in webcenter
Hello
How to make a properties file / resource bundle file in webcenter?
I kept a few images on my server. I got all of the URLS. I want to store these URLS in a file and I need a key attribute for each URL.
So if I ever want to change the URL of images, I have to change it in one place, that is to say, that in this properties file.
Please tell me how do to images used on webcenter.
Thank you
A
Well, if it's just a webcenter application properties file, I'll suggest.place your property file in class path and read it. If the user can be updated without changing the code.
Try this
- Add a JVM parameter for managed servers WC_CustomPortal, WC_Portlets, and where your applications are run to find the path of the properties file. Pour-Dtranslation.properties=/opt/translations DS
- Use the Library of Configuration Apache Commons which provides an API to read and add a policy of charging for properties files.
- Create your own helper class to make an easier way to manage properties and deploy in a common shared-lib to be used by all applications.
Where you have saved your image? I will suggest you to store images in WCC or deploy the image, under shared css lib in weblogic file.
-
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
-
Edit the Resource Bundles when running
Hi all
I use JDeveloper 11.1.2.4.0, I created a model project and resource bundle option a Bundle by file then I set the label in the Councils of the user interface for each attribute of the Entity object.
My client wants to be able to change the feature across the screen attribute labels.
is it possible to edit the Resource Bundles when running?
Kind regards
See if this series of blog posts can help you: https://technology.amis.nl/2012/08/15/live-update-of-resource-bundle-from-within-running-adf-application/
Dario
-
Hi all
I have a question, I am a beginner with ADF and learn a lot through these forums and Google
Using Jdeveloper 11.1.1.7
is the question I have, I have a cluster/HA environment (2 knots) and move my application to use HA.
I changed the ADF - config.xml to add the following line:
" < adf-controller-config xmlns =" http://xmlns.Oracle.com/ADF/controller/config "> "
< adf-scope-ha-support > true < / adf-scope-ha-support >
< / adf-controller-config >
I currently have a managed bean (ViewScope) and it has all my actionListeners/valueChange etc... etc... It also has my UIComponent links and I have also several methods that define specific attributes on these components and then do:
AdfFacesContext.getCurrentInstance () .addPartialTarget ("ComponentRefHere");
I am aware that I have to put my beans managed to implement Serializable I also understand that the UI components are not serializable.
I use the ComponentReference method that is to say:
private ComponentReference<RichPanelBox> iframePB; public void setIframePB(RichPanelBox component) { iframePB = ComponentReference.newUIComponentReference(component); } public RichPanelBox getIframePB() { return uiComponentBean.getIframePB(); }
is the question I have, I can leave it like that? or will I move them to a different managed bean?
If so, how should I put the bean, it must also implement serializable, and how do I access them from my managed bean viewScope.
Thank youYou don't have to. Https://docs.oracle.com/javaee/6/tutorial/doc/gjbbk.html documentation
The beans that use the scope of the conversation, application, or session must be serializable, but beans that use the scope of the request need not be serializable.
I personally always add the serializable interface as the bean has never should be selected for serialization, it should not control. It is easier to tell everyone to add it anyway. In this way, you can use the same class in all scopes.
Timo
-
Hi all
I use jdeveloper 11.1.2.4.0
Can someone help on how to get the dbsequence managed bean?
Kind regards
Steve
How to use the trigger in the doDML?
You cannot use db trigger, but you can implement the logic of your trigger, something like:
protected void doDML(int operation, TransactionEvent e) { if(operation==DML_INSERT) BigDecimal yourSeq = new SequenceImpl("Learner_seq",getDBTransaction()).getSequenceNumber(); java.util.Date sysdate = new java.util.Date(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM"); String yourStudentNo = sdf.format(sysdate) + yourSeq.toString(); this.setStudentno(yourStudentNo); } super.doDML(operation, e); }
And in your bean you can retrieve the value of the current row.
One of your previous answers, something like:
AttributeBinding attrStudentno = (AttributeBinding) bindings.getControlBinding ("Studentno"); String studentNo = (String) attrStudentno.getInputValue (); Dario
-
Hi all
OIM 11 G 2,
I want to add a popup to a managed bean.
I added the code corresponding to the managed bean
including the set / get the variable richPopup in the bean.
My question is that I do not know how to add and link the popup of the code of the bean, where and how do I add the popup component (in the files of sandbox?
Thank you
Sahar
Hi all
I managed to solve the problem, and now I have a perfectly called popup when a form of resource value is changed
Thank you
Sahar.
-
Access EJB session bean in JSF managed bean
Components of the project: Weblogic 11 G + 12 c, 12 c EJB3 JPA 2 Jdeveloper-ADF
I need to access EJB session bean in JSF managed bean and some methods of execution by program
Work method and return EJB below
Is this fair? Another waypublic static Object getEjbForDataControl (String name) {}
BindingContainer DCBindingContainer = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();
DCDataControl cDataControl = bindingContainer.findDataControl (name);
Return cDataControl.getDataProvider ();
}Thank you
Mohsen
Hi Isabelle,.
I assumed that his Session EJB bean has not been exposed as a data control (my bad, didn't read any of the discussion).
Antonis
-
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
-
Cannot find Managed Bean in merge custom Application
Hello
We try customize LOV search list in the Fusion Applications. I created an Application of merger with EAR customizations exploded. According to the requirement, I've identified the Managed bean associated with a workflow.
But when I try to search archive in class Application ManagedBean resources personally, I'm not finding anything? Does this mean that bean is not customizable. ?
Thank you
KajaYes to composer page, you can navigate through the tree and you can see the exact location of the page.
For reference, take a look at http://docs.oracle.com/cd/E28271_01/fusionapps.1111/e16691/ext_pages.htm#BJFJACDB
-
Dear experts,
IM using JDeveloper 11.1.2.2.0
I created managed bean for the command button issue in my jsf page.
It is the MB code:
---------------------------------------------------
package common.model.view;
Import javax.faces.event.ActionEvent;
public class abc {}
public abc() {}
}
{} public void getSelectedRow (ActionEvent actionEvent)
Add the code in the event here...
System.out.println ("testing...");
}
}
-------------------------------------------------
But after the execution of the web page, it displays following error when you click the command button.
Pls advice me to solve this problem.
Thank you
Mauricette
**********************************
< MethodExpressionActionListener > < processAction > received 'javax.el.PropertyNotFoundException' when calling action listener "#{xxxxxxxx.yyyyyyy}" for the component "cb1".
< MethodExpressionActionListener > < processAction > javax.el.PropertyNotFoundException: //C:/Users/charithk/AppData/Roaming/JDeveloper/system11.1.2.2.39.61.83.1/o.j2ee/drs/LifePolicy/LifePolicyViewCntWebApp.war/LifePolicyPage.jsf @75,117 actionListener = "#{xxxxxxxx.yyyyyyy}": unattainable target, resolved to null "xxxxxxxx" identifier "
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcast(UIXComponentBase.java:824)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:179)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:112)
to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:130)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:461)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:134)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:106)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:787)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1252)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:970)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:351)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:207)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)It seems that the bean was not found. You set in your config adfc. XML or a btf config? Make sure the names of the bean defined in one of the old config files match. Otherwise, check the exact scope of the bean.
Maybe you are looking for
-
page numbers are screwed up in the middle of the document
I am editing a book. Page numbers are great until I get to page 29 and then he climbs to 93. I went through and manually numbered each page and he always has. Help!
-
Jet 7 keyboard missing keys?
Surprised to not have an "Escape" key, which is pretty standard on keyboards. I can't live without the function keys, but that Esc is used by a lot of program. Someone at - it a good work around? (PS: everybody don't miss his auto of the iPad or pow
-
TDMS.dll error loading file in tiara
I'm trying to load a TDMS file written in LabVIEW 2010 in DIAdem 2010, but the error attached indicating an ACCESS VIOLATION in tdms.dll. I have several machines that this file loads into DIAdem 2010 of course, but of course on what I need to work wa
-
Problems adding a GVLK for 2013 to Office to the KMS server
Hello My KMS server is running and distribute licenses for Windows 7 Enterprise, but I need to add a key for Office 2013. When I run slmgr /dlv I get this: That seems to be a combination of the server license and the CSVLK of my volume license key t
-
have XP and upgaded to the vista
I have averatec with XP and came with vista uprgade. did the upgrade, but now I need a product key. keeps asking for the key to access the computer. It is stuck on the screen of the noncompliance or shtu down. How do as I go back to XP?