How to get Application Module in JDev 10.13 with own java Methode ?

Hello,
I've tried to save a table from my BC4J to file system...
for this i call my class from a jsp page:
<%
try {
// RESPONSE
String aktDbName = request.getParameter("aktDbName");
response.setContentType("text/html");
ByteArrayOutputStream buffer = Err_alertLogPageController.saveAL(pageContext);
String filename = "alert_"+aktDbName+".log";
response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
// DOWNLOAD
DataOutput output = new DataOutputStream(response.getOutputStream());
byte[] bytes = buffer.toByteArray();
response.setContentLength(bytes.length);
for (int i = 0; i < bytes.length; i++) {
output.writeByte(bytes);
} catch (Exception ex) {
%>
Sorry, error...
<% } %>
My Java Methode looks like this:
public static ByteArrayOutputStream saveAL(PageContext ctx) {
ByteArrayOutputStream baos = null;
try {                         
System.out.println("Get container...");
DCBindingContainer bindings = (DCBindingContainer)ctx.getRequest().getAttribute("bindings");
BindingContext bc = bindings.getBindingContext();
System.out.println("get AM...");
DCDataControl dc = bc.findDataControl("AppModuleDataControl");
ApplicationModule am = (ApplicationModule)dc.getDataProvider();
System.out.println("get View");
ViewObject voAL = am.findViewObject("DispAlertLogView");
System.out.println("create streamer...");
baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
System.out.println("loop...");
voAL.first();
ps.println(voAL.getCurrentRow().getAttribute("Line").toString());
while(voAL.hasNext()){
voAL.next();
ps.println(voAL.getCurrentRow().getAttribute("Line").toString());
} catch (Exception e) {
System.out.println("Error on FileSave (alert log): " + e);
return baos;
in principle it works well, but i get a null Pointer exception at:
DCBindingContainer bindings = (DCBindingContainer)ctx.getRequest().getAttribute("bindings");
I already tried to deliver PageLifecycleContext in jsp page, but then an error occur that it is not possible to deliver this variable.
I hope you know a solution to get AppModul,
or even deliver the PageLifecycleContext-Variable then i could get AppModul on my own
Thanks
Sebastian
Message was edited by:
Sebastian_ME

Note that there is an extension called Simple Java Bean Editor that will give you back a similar tab - get it through help->check for updates

Similar Messages

  • How to get application module instance from java bundle?

    Hi!
    I would like to build an application that would get all translations from a database table.
    So I created application module for translations that contains a view object which is selecting translations for specific language from a database table. I exposed a method in application module as client interface which returns HashMap<String, String> for all translations for specific language. When I test my view and client interface method call they work fine.
    Then I created java bundle classes to get translations for specific language. Then I tried to override public Object[][] getContents() method.
    I tried to get my translations application module like this:
    SharedTranslationsAppModuleImpl am = new SharedTranslationsAppModuleImpl();
    Map<String, String> translationsMap = am.getTranslations(this.getLocaleCode); // Client interface method call
    In getTranslations(String LocaleCode) I try to get that view (which would select translations from database) but it returns NULL and I get NPE error message.
    So what is the right way to get application module from java bundle file? Now everytime application wants to get translations, application stops and displays NPE message.
    Regards, Marko
    I use JDeveloper 11.1.2.1.0

    Marko,
    you can't just instantiate an application module. An application module has to be set up, db connections and memory pools have to be initialized and ....
    Can you describe why and when you try to read the resource bundle from the db and where the resource bundle is used?
    This blog may be what you are looking for http://technology.amis.nl/2012/08/10/implement-resource-bundles-for-adf-applications-in-a-database-table/
    Timo

  • How to get IE 6 to start using it's own Java again

    Hi,
    I installed the 1.4 JRE on a co-worker's machine at his request. Unfortunately, without thinking about it, we left checked the Internet Explorer plugin option. Now Java applets that he uses for production tasks no longer work. How can I get IE to use it's original JVM again? Is there any way to do it short of uninstalling?
    Thanks.
    Casey Perkins

    Disabling the use of the Sun Java Plug-in by Internet Explorer from the Control Panel applet does not restore/enable the MS jvm.
    You need to enable the MS vm:
    in IE menu/tools/internet options/advanced/
    Scroll down to 'Microsoft VM' and check 'Java console enabled'
    If 'Java(Sun)' entry exists right above that, make sure it's not checked.
    Restart IE

  • How to get Application Component in RSA1

    Hi Experts,
    I am not find any Application Components (RSA1) all my Data Sources are under the tree of Unsigned Nodes.
    How to get Application Component for my application, I am developing HCM application under that E-Recruiting.
    Can anyone help me regarding this.
    Regards
    Vijay

    Hi
    Whatever you have on infosource,will have same components.
    Goto RSA1 then source systems. double click on source system then right click on ypur R/3 source system then say display datasource tree.
    Chandu.

  • Need to know how to get my apple account to sync up with a new email on my phone and delete the old one in a step by step process??

    Need to know how to get my apple account to sync up with a new email on my phone and delete the old one in a step by step process??

    After you change the account settings as I described below hold your finger on any app until they all wriggle, then tap the "-" on each purchased with her Apple ID. Press the HOME button when done. Then go to the App Store and buy or download the apps you want.

  • How to get Camera RAW / Photoshop CS5 to work with Canon 100D?

    How to get Camera RAW / Photoshop CS5 to work with Canon 100D? I don't want to by this product again and again...

    In what way is ACR not working in Bridge?  Is there no right-click Open in Camera Raw available from Bridge, or there is, but the ACR version is less than ACR 6.7.1 or what exactly is the issue? 
    Also, if you open Photoshop and do Help / About Plug-ins / Camera Raw, is ACR missing from the list, or if not, what version does it say is installed?
    You might also want to describe what methods you have tried to correct the issue, since saying you've tried what you've seen posted and they didn't work, isn't really much to go on.

  • How to get the previous state of my data after issuing coomit method

    How to get the previous state of some date after issuing commit method in entity bean (It should not use any offline storage )

    >
    Is there any way to get the state apart from using
    offline storage ?As I said the caller keeps a copy in memory.
    Naturally if it is no longer in memory then that is a problem.
    >
    and also what do you mean by auditlog?
    You keep track of every change to the database by keeping the old data. There are three ways:
    1. Each table has a version number/delete flag for each record. A record is never updated nor deleted. Instead a new record is created with a new version number and with the new data.
    2. Each table has a duplicate table which has all of the same columns. When the first table is modified the old data is moved to the duplicate table.
    3. A single table is used which has columns for 'table', 'field', 'data' and 'activity' (update, delete). When a change is made in any table then this table is updated. This is generally of limited useability due to the difficulty in recovering the data.
    All of the above can have a user id, timestamp, and/or additional information which is relevant to the data being changed.
    Note that ALL of this is persisted storage.
    I am not sure what this really has to do with "offline storage" unless you are using that term to refer to backed up data which is not readily available.

  • Any info on how to get iCloud calendar, contacts, etc to sync with office 365 on macbook pro?, any info on how to get iCloud calendar, contacts, etc to sync with office 365 on macbook pro?

    Any info on how to get icloud calendar, contacts, etc to sync with office 365 on macbook pro?

    You can't, there is no connection between the services, use one or the other.

  • How to get  shipped orders, unshipped orders and orders with open deliverie

    Hi
    how to get  shipped orders, unshipped orders and orders with open deliveries
    can anybody answer this.
    points would be rewrded
    Thanks

    Hi,
    You can check in the VBUK table for the status of an order. If you do a Query on VBUK table to get all the orders whose delivery status is not 'C' or the total goods movement status is not 'C' you get to know the orders not yet shipped.
    Hope this helps. Reqard points if useful.
    David.

  • How to get the line in the template (smartform) with out using under score

    Hi,
         How to get the line in the template (smartform) with out using under score,
         and how to print the box (line the check box - small squre box (which is used ot mark the tick by the user in front of the item).
         Please provide the valueble answer as early as possible.
    Thanks,
    Ravi

    Hi Ravi,
    Line -
    Use a SMATSTYLE for this purpose.in the smartstyle create a paragraph or character with underline atribute.Then call the smartstyle in the text.
    Search SDN with Key <b>UNDERSCORE</b>.. will get few more posts on the same.
    For Checkbox - refer link
    Re: Quick Question on Smartforms
    Re: putting tick mark into check box in smartform
    Reward points if this Helps.
    Manish
    Message was edited by:
            Manish Kumar

  • How to get iPod 4 to play wifi-nice with my other wireless devices?

    Anyone has this problem? It's either iPod 4 or everything else!
    I just bought a new iPod 4 in additional to my iPod 3. I doesn't feel as good as my current iPod, but that's beside the point. My iPod 3 is still the favorite, even before I found the problem.
    All of my wireless devices at home work just fine:
    . -Motorola Wireless Modem (set to g, wep sec)
    . -iPod 3
    . -Apple Macbook
    . -Gateway laptop
    . -Lenovo laptop
    . -2 Sony laptops
    . -Nokia tablet
    . -HTC winmo phone
    *iPod 4 join my Motorolla wireless
    . +*ONLY IPOD 4 WORKS*
    . +The following wireless STOP working
    . -iPod 3
    . -Apple Macbook
    . -Gateway laptop
    . -Lenovo laptop
    . -2 Sony laptops
    . -Nokia tablet
    . -HTC winmo phone
    *Poweroff iPod 4
    . -All wireless devices work
    *Poweron iPod 4, Airplane on
    . -All wireless devices work
    *Poweron ipod 4, Airplane off
    . -All wireless devices work
    *Poweron iPod 4, but not join Motorola wireless
    . -All wireless devices work
    How to get iPod 4 to play wifi-nice with my other wireless devices?
    Message was edited by: iUser

    Thanks again for you help.  I finally got the music resting on my iPad moved into iTunes and then got the music resting on my iPod backed up in iTunes.  Final step was to get the music on my iPad onto my iPod without loading the iPod music onto the iPad.  I use my iPod strictly for music and don't want to clog my iPad with all those songs.   Anyway, long process but it worked.  Thanks again.

  • How to access application module from ActionForm Execute?

    I've got a very simple ADF/UIX/Struts application where I'm trying to create a simple Login function. I have a /loginAction data action pointing to a login.uix page forward. The login.uix page has a <struts:form> on it with a user and a password field. There is a LoginBean with the corresponding get/set values. I have an ADF model created with a boolean login(String username, String password) function exposed as a client method.
    Eventually, when I have this basic part working, then I'll actually be using an ActionForward mapping to dispatch to different home pages, based on the particular login account (the name of the forward will be stored in the authentication table).
    I've tried overriding Execute(), since that is where you can return the appropriate ActionForward mapping, but that does not have a DataActionContext passed in -- so I can't get to the application module.
    I've also looked at processComponentEvents, but that doesn't have any ActionForward results nor a way to pass back ActionErrors (in case the login fails).
    How do I call my login client method when a user has entered a username/password and pressed the Submit button?

    Here is another solution as provided by Oracle Support in response to a TAR that I opened:
    I had described my need to access a login() function defined in my Application Module, returning true/false if the login succeeds/fails. Here is the reply, posted with permission:
    I have gotten the following information back from one of the development folks pertaining to the question you asked.
    His suggestions are as follows:
    1) Expose the method as a client method on the App module
    2) On the pageflow create a new DataAction
    3) Drag and drop the logon method from the AppModule operations node and drop it onto the new data Action
    3) Edit the set-property values that are created in the Struts metadata for this new DataAction to use the correct expressions to get the logon info to pass to the middle tier.
    e.g.
    <action path="/authenticateUser" className="oracle.adf.controller.struts.actions.DataActionMapping" type="AuthenticateUserAction" name="DataForm"
    unknown="false">
    <set-property property="modelReference" value="authenticateUserUIModel"/>
    <set-property property="methodName" value="authenticateUserUIModel.authenticateUser"/>
    <set-property property="resultLocation" value="${requestScope.methodResult}"/>
    <set-property property="numParams" value="2"/>
    <set-property property="paramNames[0]" value="${param.logonUsername}"/>
    <set-property property="paramNames[1]" value="${param.logonPassword}"/>
    <forward name="fail" path="/logon.do"/>
    <forward name="success" path="/menu.do"/>
    </action>
    So in this case the values of the logonUsername and logonPassword fields in the form that submitted to this DataAction are passed as the two parameters that my authenticateUser method on the AppModule requires.
    I have also overriden the data action class to customise the findForward() method to route the user depending on if the method call worked or not.
    And here's the code for the customized FindForward in the DataAction:
    protected void findForward(DataActionContext actionContext) throws Exception
    HttpServletRequest request = actionContext.getHttpServletRequest();
    HttpSession session = request.getSession();
    String target = "fail";
    //Get the result of the Model Method call
    JUCtrlActionBinding method = actionContext.getCustomMethod();
    boolean successfulLogon = ((Boolean)method.getResult()).booleanValue();
    if (!successfulLogon)
    // If the logon fails we need to do the following
    // 1. Increament the counter once this exceeds 3 any logon will fail
    // 2. Create an error message to display on the logon screen
    // note this is a non specific error to prevent hackers from
    // knowing that they at least got the username right or from
    // knowing that there is a Max attempts value if they are trying
    // an automated attack
    Integer attempts = (Integer)session.getAttribute("logonAttempts");
    int intAttempts = 0;
    if (attempts != null)
    intAttempts = attempts.intValue();
    session.setAttribute("logonAttempts", new Integer(++intAttempts));
    //The error message comes out of the ApplicationResources.properties file.
    actionContext.getActionErrors().add("general",new ActionError("logon.error.logonFailed"));
    this.saveErrors(actionContext.getHttpServletRequest(),
    actionContext.getActionErrors());
    else
    //If connection was OK do we need to save the username in a cookie?
    String remember = (String)request.getParameter("logonRemember");
    int cookieLife = 0; //Expire
    if ( remember != null && remember.length()>0 )
    cookieLife = 2592000;
    String name = (String)request.getParameter("logonUsername");
    Cookie userCookie = new Cookie("CARA_USER_COOKIE",name);
    userCookie.setMaxAge(cookieLife);
    actionContext.getHttpServletResponse().addCookie(userCookie);
    target = "success";
    actionContext.setActionForward(target);
    I hope this helps anyone looking to implement something similar. It also illustrates the "preferred" way of executing a client method and working with the result.

  • What's the best practice to get App Module on Jdev 10.1.3 using Struts/ADF?

    Hi,
    I read Mr. Muench's post stating that the best way to execute an App. Module method is to make the method part of the client interface and then drag and drop it on a form as a button ...
    In another post Muench says that a another way to get the App Module is using getDataProvider() method, I tried and found that this worked in:
    // standard event handler interface
    // on PageController class
    public class MyFormPageController extends PageController
    public void onUpdate(PageLifecycleContext ctx)
    AMServImp am;
    am = (AMServImpl)ctx.getBindingContext().getDefaultDataControl().getDataProvider();
    am.myMethod( ... );
    am.getTransaction().commit();
    I really like the second option because is closer to what I used to do in 10.1.2 with an event handler receiving DataActionContex parameter. Besides, is not clear to me in the former method with the drag and drop how the form inputs are assigned to the method parameters ....
    I would like to know however what is the best way and why ?
    Any comments ?
    -OM
    Message was edited by:
    omar71

    According to JSR 227, which ADFm is implementing, the view/controller portions of your application aren't really supposed to be touching the business services, or even the data controls, at all. They're supposed to do all model manipulation entirely through the databindings.
    This is just another bit of "code separation"--much like MVC code separation--that should make the application a bit easier to maintain. Your application module could change dramatically--maybe even be replaced by an EJB session bean--and all you have to do is change the .dcx file and your page model files, rather than searching through your code. Maintainability and readability is the advantage here; I don't think there could possibly be any slowdown by calling ctx.getBindingContext().getDefaultDataControl().getDataProvider(), since that's what the bindings would do anyway.
    Well, of course there's the "ADF supports going this way declaratively", which is not to be sneezed at as an advantage.
    As to how to put the form values in to the method binding: Look up the <af:setActionListener> tag (e.g., using full-text search in the help). You can nest that into your commandButton or commandLink tags and use it to set method parameters.
    Best,
    Avrom

  • How to configure Application module pooling?

    I want to know wheather bc4j container itself manages Application module pooling if yes then please tell me is there any file to set parameters for congiguration like one which we have for apache web server.
    If no then please let me know how to create applicatiom module pooling.
    Thanks in advance.

    Application module pooling is configurable through an application module configuration. In order to edit an application module configuration you may right click an application module and select Configurations...
    The BC4J data web beans and the BC4J JSP datatags are both application pool clients. The BC4J documentation includes descriptions of the application pool properties. The documentation also includes a code sample which illustrates how to write your own pool client.

  • How to get web module for CUSTCRMPRJ (crm 5.0)?

    Hello all.
    I try to create test CRM 5.0 application with own context root. Here are steps from Extension guide:
    1) Import the Development Configuration into your Netweaver IDE.
    2) Create a new Enterprise Application Development Component in Software Component CRMCUSTPRJ. If you want to extend crm/b2b, create a new development component home/b2b
    3) Add the Web Module you want to extend to the Enterprise Archive
    4) Adjust the context root
    5) Copy all files except application.xml from the META-INF directory of SAP standard Enterprise Archive into the META-INF directory of the new Development Component. If you want to modify or extend the crm/b2b application, open the project for crm/b2b. A project for the previously created development should already be open.
    Open the java perspective and copy the following files from the META-INF directory of the crm/b2b
    component to the META-INF directory of the home/b2b component:
    - application-j2ee-engine.xml
    - data-source-aliases.xml
    - log-configuration.xml
    - monitor-configuration.xml
    - monitor-configuration.dtd
    6) Check in the new Development Component.
    I found that I forgot to include web module to my new app. Oops. According to application.xml web module must be called sap.comcrmisawebb2b.war. I found it in the SAP_SHRAPP.SCA/sap.com_crm~b2b.sda. Should I use that module or no? If yes how I can include it to CUSTCRMPRJ?
    Also I found that other xml files from list above can be found in several components. So I'm confusing and can't decide from which component I have to copy that files and how to set its values.
    Regards, Lev

    Hi Anupam
    I think you need to review the IC Webclient Consultants Cookbook. It gives example sof what you're discussing.
    Regards
    Arden
    Reward with Points if Helpful

Maybe you are looking for