Not able to set the context

Hi All,
I am not able set the context to an xml file in JFPREAMBLE CONTEXT file. Can any suggest me how to fix it?

context.setAttribute("myTest", "mkmmkmmkm");
String output = (String) getServletContext().getAttribute("testMe");You set "myTest" but try to get "testMe"

Similar Messages

  • Not able to get the context attribute set in ServletContextListener

    Hi all,
    I have written a simple ServletContextListener and set an attribute in it. when i am trying to retrieve the attribute value in my servlet, I am getting as null. Could anybody please let me know about this if i need to add any more changes.
    Below is the complete code of my sample application
    web.xml
    <web-app>
    <servlet>
    <servlet-name>myServlet</servlet-name>
    <servlet-class>com.mypackage.MyServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>myServlet</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <listener>
    <listener-class>
    com.mypackage.MyContextListener
    </listener-class>
    </listener>
    <context-param>
    <param-name>testMe</param-name>
    <param-value>TestedSuccessfully</param-value>
    </context-param>
    </web-app>
    ContextListener
    package com.mypackage;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletContextEvent;
    import javax.servlet.ServletContextListener;
    public class MyContextListener implements ServletContextListener{
    public void contextDestroyed(ServletContextEvent arg0) {
    public void contextInitialized(ServletContextEvent arg0) {
    ServletContext context = arg0.getServletContext();
    String testApplication = context.getInitParameter("testMe");
    context.setAttribute("myTest", "mkmmkmmkm");
    Servlet
    package com.mypackage;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletContext;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class MyServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response){
    ServletContext context = getServletContext();
    if(context != null){
    response.setContentType("text/html");
    try {
    String output = (String) getServletContext().getAttribute("testMe");
    PrintWriter out = response.getWriter();
    out.print("The required value is... "+output);
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    OUTPUT
    When accessed with any url as below:
    http://localhost:8080/helloworld/u
    gettting output as "The required value is... null" . Because i set the context attribute, I am expecting not null. Can anybody suggest me on this.

    context.setAttribute("myTest", "mkmmkmmkm");
    String output = (String) getServletContext().getAttribute("testMe");You set "myTest" but try to get "testMe"

  • Not able to set the variable to the variant in dynamic selections

    HI,
    I got a ticket related to variant. The variant is created to the report and logical database is added in the attributes of the report so that we can have the option to choose the dynamic slections. Variables are created in TVARVC table. I am able to set the variable by pressing F4 in dynamic selections to the variant. When i save and comeback, i am not able to see the variables in the dynamic selections. I can save the variables in static selections and it is working fine. Pleas help me i need this urgently.

    Hi,
    maybe sth wrong with the passing of parameters in the value help of the affected field.... Pls check.
    BTW: do u pay us for solving your customer tickets? (-;
    Cheers,
    André

  • Not able to set the value in marketing context node for BP_HEAD

    Hi,
    I am trying to set the value in marketing node of BP_HEAD from bp_addr component. i am calling the set_property method but it is not changing the value, when i debugg the code, it actually changing the value in bol structure but it is not calling the get/set method of bp head.
    i am working on BP corporate person  creation i.e. in bp_head component and account details view. I added the marketing attributes in UI configuration and also the address attributes.
    this is what i coded in get method of country in standardaddress context node of BP_ADDR
    lv_entity ?= current.
        IF lv_entity IS BOUND.
          lv_parent = lv_entity->get_parent( ).
          IF lv_parent IS BOUND.
            lv_entity_mkt = lv_parent->get_related_entity( iv_relation_name = 'BuilMarketingRel' ).
            IF lv_entity_mkt IS BOUND.
              CALL METHOD lv_entity_mkt->set_property
                EXPORTING
                  iv_attr_name = 'ATTRIBUTE'
                  iv_value     = attribute1.
    Can anyone please guide me on how to set the value cross component and can we call the get/set method of that attribute which is not in same component?
    Regards,
    Kamesh Bathla

    Sorry, what I said was rubbish, because the LSMW and the session run in different external sessions.
    I have searched forum for these terms: "company BUK parameter BDC background"
    These threads Is it possible to set default company code in SM35? and Release BDC in SM35 in background, How to set defaul company code? seem promising, but I'm not sure they really solve.
    In case these threads don't help you, I think you can create your own Z transaction which sets the BUK parameter id and then does a LEAVE TO TRANSACTION 'ABAON'. Then create again the recording on the Z transaction.
    If you are using ECC6, then you may also enhance the standard to reset BUK parameter id at the very beginning of ABAON, in case it's run in batch input (sy-binpt = 'X'). Be careful as sometimes SAP does batch input on some transactions, so that could make the standard fail.
    Last thing, you can contact SAP support, though it might probably be considered as consulting.

  • Not able to set the SMTP timeout session on BIPublisherAPI

    Any of the below parameters are not taking into effect:
    deliveryRequest.addProperty(DeliveryPropertyDefinitions.ASYNC_CHECK_INTERVAL,
    "1");
    deliveryRequest.addProperty(DeliveryPropertyDefinitions.ASYNC_TIMEOUT,
    "1");
         deliveryRequest.addProperty(CommonPropertyDefinitions.TIMEOUT,
    "1");
    Is there any workaround to set the time out on the smtp session using BI publisher java api?

    Sorry, what I said was rubbish, because the LSMW and the session run in different external sessions.
    I have searched forum for these terms: "company BUK parameter BDC background"
    These threads Is it possible to set default company code in SM35? and Release BDC in SM35 in background, How to set defaul company code? seem promising, but I'm not sure they really solve.
    In case these threads don't help you, I think you can create your own Z transaction which sets the BUK parameter id and then does a LEAVE TO TRANSACTION 'ABAON'. Then create again the recording on the Z transaction.
    If you are using ECC6, then you may also enhance the standard to reset BUK parameter id at the very beginning of ABAON, in case it's run in batch input (sy-binpt = 'X'). Be careful as sometimes SAP does batch input on some transactions, so that could make the standard fail.
    Last thing, you can contact SAP support, though it might probably be considered as consulting.

  • Not able to set the where clause params

    Hi,
    My version of apps is 12.1.3.
    I created a page with a searchRN and resultRN (LinesVO). (Not a query/view link) . I am passing the id from header to the VO to restrict the linesVO
    The controller correctly passes the id from searchRN to AM, but in AM, the where clause is not set and I am not getting the desired result:
    My AM Code:
        public void InvokeGo(String Hdrval)
                    LineVOImpl LineVO1 = getLineVO1();
                    LineVO1.setWhereClauseParams(null); // Always reset
                     System.out.println("AMIMPL:Hdrval = "+ Hdrval);
                    <prints the header_Value which is passed from CO>
                       if (Hdrval           == null        
                                            System.out.println("Inside Null If");  
                                            String message = "Please provide atleast one input to any of these search field";
                                            throw new OAException(message, OAException.ERROR);
                                    else   
                                        System.out.println("Not All Parameters are Null.Building Where Clause");
                                         < prints the line above>
                                        LineVO1.setWhereClause
                                        ("Header_name = :1");
                        System.out.println("Paremeter Set are: Header_name:"+Hdrval);
                        <prints the above line like :   Paremeter Set are: Header_name:Hdr_Name_1
                        LineVO1.setWhereClauseParam(0,Hdrval);
                        System.out.println("Inside MainAM invokeGO Method:"+LineVO1.getQuery());
                        < prints:Inside MainAM invokeGO Method:SELECT * FROM (select LINE_ID,hdr.HEADER_ID,LINE_NUMBER,LINE_NAME,Attach,hdr.header_name from xxtr_hdr hdr, xxtr_line line
    where hdr.header_id=line.header_id) QRSLT  WHERE (Header_name = :1)>
                        LineVO1.executeQuery();
    The issue is in the SQL build. I guess after setting the where clause, it should appear like :
    QRSLT  WHERE (Header_name = "Hdr_Name_1"
    Thanks

    Hu Sumit,
    I am doing that:
    LineVO1.setWhereClauseParam(0,Hdrval);
    before executequery. I even hard coded
    LineVO1.setWhereClauseParam(0,"XXXX");
    but still it din't work. I guess I am missing something small. because I have done this thing a lot of times earlier and it had worked.

  • Not able to access the context in custom functoid

    Hi,
    Below is the code referred from
    https://contextaccessor.codeplex.com/,
    Implemented this Custom Pipeline  component in the Resolve Part stage:
    The below code under Class = AccessContext
    [ThreadStatic]
    internal static IBaseMessageContext  context;
    Public  IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
      context= pInMsg.Context;
      return pInMsg;
    Custom Functiond:
    When i try to access in the custom functoid,
    IBaseMessageContext  msgContextFunctoid=  AccessContext.context;
    "msgContextFunctoid" this is returned as "null"
    What i am doing wrong here. Please help.
    Thanks,
    Sathish

    I would suggest to use latest contextaccesor  functiod from below location
    improved-context-accessor-functoid
    You can find the DLL in /ContextAccessor/bin/Debug
    Maps used in a Receive Port
        Grab the .dll
        Save the .dll to \Microsoft BizTalk Server \Developer Tools\Mapper Extensions
        Save the .dll to \Microsoft BizTalk Server \Pipeline Components
        GAC both assemblies
        Add the functoids to your functoid Toolbox
            Toolbox>Right Click>Choose Items…>BizTalk Mapper Functoids
        Drop the functoid into your map, and configure it
    Add the ContextAccessorProvider pipeline component to your pipeline Toolbox
        Toolbox>Right Click>Choose Items…>BizTalk Pipeline Components
    Drop the ContextAccessorProvider pipeline component into a pipeline at the ResolveParty stage

  • I am not able to set high and low limits for each channel seperately using LabWindows/CVI

    I am using AI_StartAcquisition and AI_ReadAcquisition functions to acquire data using PCI 6025E DAQ card and iam using Lab/Wuindows/CVi5.0 software. But one of my transducer has its range in +/- 500 mV soi need to set the high low limits of each channel seperately for that i am using commond string function(cmd) but still i am not able to set the limits properly. Does anyone has any idea about this trouble

    You can set the gain on a per channel basis by using the lower level functions. (As opposed to the easy i/o functions.) For example, look at the "SCANsingleBufSync.C" NI-DAQ shipping example that uses the SCAN_Op() function. It's gain parameter is an array of gains that will allow you to change the input limits for each channel separately.
    -Russell

  • The server principal "XYuser" is not able to access the database "Ydb" under the current security context

    SQL2005 on winserver 2003. I have a view in Xdb that accesses tables in 2 different databases (Xdb and Ydb) on the same server. I have mixed mode security. I have a SQL user (XYuser) that has read access to all tables and views on both databases, yet when I try to access the view using a C# windows application I get the following error:
    The server principal "XYuser" is not able to access the database "Ydb" under the current security context
    This same scenario works under SQL 2000. I looked through the postings and tried to set TRUSTWORTHY ON on both databases but that didn't help. I can access any other views or tables on the SQL 2005 server, just not the one that joins the tables cross databases. Any help is much appreciated... john

    This appears to be a Login/Database Mapping issue.  I was having this problem, but was able to resolve it as follows:
    Using the SQL Server management Studio:
    In the Object explorer, under the SERVER security folder (not the database security folder), expand Logins. 
    That is: ServerName -> Security -> Logins
    NOT: ServerName -> Databases -> DatabaseName -> Security -> Users
    Select the Login that is having the troubles.  Right click on the Login and select ‘Properties.’
    The ‘User Mapping’ page should list all databases on the server with a check mark on the databases that the Login has been mapped to.  When I was getting the error, the database in question was not checked (even though the Login was assigned as a User on the database itself).  Map the Login by checking the box next to the database name.  Set the default schema.  Then select the roles for the Login in the Database role membership list box.  I selected db_datareader and public.  After clicking OK to save the changes, the problem was resolved.
    In order to ‘Map’ the Login, the Login must not already be as User on the database, so you may have to go to the database security (ServerName -> Databases -> DatabaseName -> Security -> Users) and delete the Login from the list of database Users before mapping the Login to the database.

  • I am trying to set up my newly purchased Apple TV but when I enter my network password while setting up, I am not able to enter the Submit button, any idea how to hit the visible submit button that is visible on screen but not responding?

    I am trying to set up my newly purchased Apple TV but when I enter my network password while setting up, I am not able to enter the Submit button, any idea how to hit the visible submit button that is visible on screen but not responding?

    You need to use the right arrow on the remote to go all the way to the right. The submit button will be highlighted and you can then press select on the remote to proceed.

  • I have just recently brought the blackberry curve 8310 and i am not able to access the internet, MSN etc. I rang my phone company(Crazy Johns) and they saif i cannot use the internet on this phone because they don't sell it anymore and i need a setting fo

    I have just recently brought the blackberry curve 8310 and i am not able to access the internet, MSN etc.
    I rang my phone company(Crazy Johns) and they saif i cannot use the internet on this phone because they don't sell it anymore and i need a setting for it to work.
    Can you please help me with this?
    Thanks Matthew.

    Hello,
    The services you listed in your post will require a data plan which is provisioned by your wireless provider. You may want to contact your wireless provider to see if you have the correct plan.
    Cheers,
    -FB
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click "Accept as a Solution" for posts that have solved your issue(s)!

  • I am not able to set up my ipad2 - tried the regular help but nothing seems to working. itune simply wont detect the ipad

    i am not able to set up my ipad2 - tried the regular apple help - did all those routines - but nothing seems to working. itune simply wont detect the ipad

    http://support.apple.com/kb/TS1538

  • Weblogic Classpath setting error not able to pick the properties file

    Hi All,
    We are using a third party jar and create a java Web service on the top of that jar. This jar file need two configuration file .properties and .xml when we deploy war for the application into weblogic server it will give file not found error. Though this file already exists inside the .war but from the application it is not able to pick the files.
    We find that these file need to be put in weblogic domain home and we put it there and application works.
    I decompile the jar and found that inside java class they use FileReader("allXXX.xml") path and when I Google it and found that it will pick the file from weblogic domain directory.
    The issue is that we need to put properties file in specific weblogic folder like /3party/config by setting the class path inside startWebLogic.cmd. Please let us know solution for same
    Thanks in advance
    Edited by: sb**** on Mar 19, 2012 9:08 AM

    Hi , I am also facing the similer issue. I am deploying war file of my Spring MVC application , but its not picking resource bundle .properties files from one of the configuration file.
    <bean id="PropertiesRepository"
              class="LanguageBasedPropertiesRepository">
              <property name="propertiesFiles">
                   <map>
                        <entry key="en" value="classpath:/exceptionMessages.properties" />
                        <entry key="es" value="classpath:/exceptionMessages_es.properties" />
                        <entry key="default" value="classpath:/exceptionMessages.properties" />
                   </map>
              </property>
         </bean>
    Please let me know how we can modify this to make it work.
    thanks .

  • I set up iCloud on my iMac with OS version 10.6.8 but I'm not able to have the icon show on my Dock with the other application icons. What do I do?

    I set up iCloud on my iMac with OS version 10.6.8 but I'm not able to have the iCloud icon show in my Dock with the other application icons. What can I do? Is it because iCloud is not part of the 10.6.8 version? I clicked System Preferences and I saw MobileMe and no iCloud.

    Thanks for your reply! Would my IMac be able to support the Mavericks (10.9) considering that I bought it in June 2011? Not sure if that even matters.

  • I have an ipad2. My email account is on rediffmail. I am not able to set rediffmail on the MAIL icon on ipad2. Can you guide me?

    I have an ipad2. My email account is with rediffmail. I am not able to set rediffmail on the MAIL icon on ipad2. Can you guide me?

    really your going to want to contact verizon to get the proper setting

Maybe you are looking for

  • My ipod touch 4th generation will not connect to Itunes.

    I registered it on a different computer and then was able to connect after that. Now it won't connect to Itunes, but my old Ipod still connects I did the suggestions and also redownloaded Itunes. Any suggestions?

  • Query bios model

    Hi there, I'm using SCCM in my organisation(System center configuration manager), and we have several models of ThinkCntre PC's in our organisation. How can i query the bios type of each ThinkCentre computers.? I have seen that in dell computers they

  • SQL*Loader load 2 tables

    Does anyone know how load a field in 2 tables from a text file with sql loader. I have 2 fields in my text file then i need to concatenate both fields and load in a field in the parent table and in the child table with the same value. My data is: Fie

  • Installation guide Oracle cloud Control Agents on a Windows failover cluste

    Hello Experts, i have to install Oracle cloud control agent on windows fail-over cluster. i could not found any document on oracle support site/ internet. here are the requirement: i have two hosts (host1 and host2) which are in windows cluster envir

  • How to convert hierarchy XML to CSV/Excel format using PI/XI

    posted in PI forum but not many replies, please bear with me as I am in crunch time* Hi All, I am working with SAP PI/XI for the first time and need some help file conversion of complex hierarchy XML to CSV file using PI. I have done plenty of resear