Dynamically removing context attribute

Hi all,
does anybody know a better way of getting rid of dynamically created attributes than using the IWDContext.reset() functionality?
Best regards,
Christian

Hi,
We had the similar requirement .We have mailed to Uwe regarding this.Please find the reply below .
there is currently no way to remove a single attribute in NW04. There is only the possibility to reset the metadata to the state that has been declared in the design time. This can be achieved using IWDContext.reset(boolean), reachable via wdContext.getAPI(). The method removes all attributes and nodes, that have been added at run time ("dynamically"), via one of the add…Attribute or add…Child methods of IWDNode. So, if you have added the root attribute at runtime, this method will remove it, but it removes all other dynamically added attributes and nodes, too.
NW05 will allow to remove single attributes and child nodes, but still only if they have been dynamically added before.
Regards
Anil

Similar Messages

  • How can I remove an OVS extension from a context attribute?

    In our Web Dynpro application we provide a generic search mask to the user. The information about the search fields like labels, length etc. is retrieved from the backend during runtime. Also, the information if there should be a value help available or not is read from the backend during runtime. In case there should be a value help for a search field we just add an OVS extension, using method WDValueServices.addOVSExtension(...). For this, we pass the AttributeInfo of all relevant context attributes to this method.
    The problem is now the following: The user can switch between different kinds of search masks. Because of the generic implementation all use the same Web Dynpro context. So it might be that the search field #1 on the first input mask has a value help whereas search field #2 on the second input mask doesn't. But if we once have added an OVS extension to the context attribute of search field #1 it can apparently never be removed anymore. At least I couldn't find a method to remove it.

    At least your second proposal would work for sure if I had only static context nodes apart from the dynmic OVS context. But in my case I can not use wdContext.reset(false) since I have dynamic context nodes in my controller that would get lost. And unfortunately, there is no method available to reset a specific context node only instead of the whole context.
    I contacted the responsible Web Dynpro developers in the mean time and they offered to implement an API in SP11 to remove the OVS.

  • Using dynamic context attributes with flashisland

    I recently started looking at flashislands.
    Going through the SDN tutorials on this topic, I noticed that the declarations of GACDATASOURCE and GACPROPERTY properties inside web dynpro and their counterpart variables inside flex are a bit static (all naming and binding is done at design time).
    So I'm asking if there's a way inside flex to dynamically capture the values of the attributes of a web dynpro context node that is bound to an ArrayCollection variable inside flex without knowing the names and the amount of the attributes of the context node?
    Here's my situation:
    I have a context node (REPORT_DATA) inside web dynpro that at design time has no attributes.
    The attributes and their names are created dynamically at runtime.
    It is even so, that over time the amount of attributes may vary.
    Inside the web dynpro, the contents of this context node (REPORT_DATA) are shown in a (dynamically built) table.
    Besides using the table, I'm trying to show the same contents as a piechart and as a columnchart in a flashisland.
    The ROOTUIELEMENTCONTAINER of the FlashIsland view in web dynpro only contains a GACDATASOURCE element at design time.
    The 'dataSource' property of this GACDATASOURCE is bound to the context node REPORT_DATA.
    The 'name' property of this GACDATASOURCE is bound to an ArrayCollection variable inside flex (named dataSource).
    So much for the static part created at design time.
    At runtime inside web dynpro the correct GACPROPERTY's are created, based on the - over time changing - amount and the names of the context node.
    Suppose my REPORT_DATA context node at runtime starts with 3 attributes: ATTR1, ATTR2 and ATTR3
    Also suppose the node contains 2 elements: [ {"1_1", "1_2", "1_3"} , {"2_1", "2_2", "2_3"} ]
    The dataSource variable inside flex also contains 2 entries with 3 elements each.
    The code to show the value of (for example) the first element of all entries inside the ArrayCollection variable would be:
    +for each( var o:Object in dataSource) {
    var s:String = o.ATTR1;
    Alert.show( "the 1st value = " + s ); // 1_1 for the first entry, 1_2 for the second
    }+
    I can then use the myAC variable inside flex as dataprovider for various other objects.
    This works fine.
    But inside flex I can only capture the value of an attribute when I know its name at design time (like ATTR1 in the sample code above).
    And that's not what I want.
    Inside flex I want to capture the value of the context attributes dynamically in a (correctly typed) flex variable without knowing the names and the amount of the context attributes.
    Is this possible?
    Thanks in advance for - any - response.
    Bart.

    Hi again,
    I tried the same thing by creating a dummy context node without any attributes, and adding all attributes at runtime using the add_attribute method. In that case too, it doesnt work. All the attributes are available in the dynamic attributes of the node element, but are not getting displayed.
    Any help would be greatly appreciated. Thank you.
    regards,
    nithya

  • How to remove an attribute in Context when session is invalidated?

    I set a attribute in the context when i login to my application. When i logoff from my application, i remove the attribute from the context.
    But if i close my browser or encounter some error, then the session is not invalidated. The container waits till the session gets timed out and then it invalidates the session. But the attribute that i had set to the context is still there. The next time i login, i check whether the attribute is still available in context. It is.
    Scenario : Assume that i have a application and if i open some thing eg: model, then i update the attribute "read only" flag in the context as "true", so that no one can edit the model on which i am working on.
    When some other user logs in and tries to edit my model, he will get an error stating that the model is read only. Now if i log off, then i update the read only flag as false, so that some body can edit the same.
    But if i close my browser or if i encounter some error, then i am not making the read only flag as false. So even if i am not worling, still the read only flag is set to true in the context. So no one else can work on the model.
    My question is, is there a way to edit the context attribute, when i abruptly close my browser window? Is there a way to handle the dangling session objects and invalidate them immediately?

    Use the HttpSessionListener to determine when the session is destroyed and remove the attribute then. Be aware that aplication attributes are shared by all sessions and can cause problems in a multi-user environment.

  • Dynamic removing of Value Nodes

    Hi,
    in my application I create Value Nodes and Value Attributes dynamically.
    How can I remove this Value Nodes and Attributes again dynamically?
    Regards,
    Eva

    Eva,
    The only way is to completely reset context:
    wdContext.reset(false);
    This will remove all dynamically created nodes / attributes. You have to recreate structure afterwards (obviously, without node you were actually "removing")
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com/

  • Delete Context Attribute dynamicalluy

    Hi,
    We have a requirement where context attributes have to be created and deleted dynamically based on number of parameters. Dynamic creation part is ok but i don't know how to delete context attributes dynamically. I'm using NWDS04 sp16.
    Any help is appreciated.
    Regards,
    Abhinav

    from https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDNodeInfo.html
    <i>
    Node infos also provide a mean to dynamically add child nodes (there are different methods for unmapped, mapped and recursive nodes) or attributes (unmapped or mapped, several methods to add attributes automatically from external meta data). You cannot remove such nodes or attributes afterwards, you can only reset the whole context to its initial state via IWDContext.reset(boolean).
    </i>

  • Dynamic reverse context node mapping at runtime

    Hi!
    I have an application which uses another embedded component containing a ALV table which shows the data of a transparent table.
    Everything works fine if i'm working with a static table with static attributes and map the context node of the application to the node in the embedded component. The context node in the embedded component is reversed mapped and gets its data from the application's context node.
    Now i want to do it dynamically. Inside the application the user should choose the name of a table and I'm using RTTI functions to get it's technical informations. At runtime i'm adding dynamically attributes (i.e. fieldname, type, length) to a static context node called 'DATA'.
    The ALV component of the embedded component is mapped to an interface context node named 'DATA' which uses reverse mapping to receive data from the applications context node 'DATA'.
    What I need to know is how to create the mapping between application context node and interface context node of the embedded component at runtime after i have created the attributes of the node dynamically. Is that basically possible?
    I've already tried to map the both nodes statically to see if the dynamically created attributes are mapped automatically then. The mapping seems to be fine at node level, but doesn't work for the later dynamically added attributes.
    Could someone point me to informations if dynamic mapping context nodes is basically possible and how to do it?
    Regards
    Ralf-J.

    Hi Lars!
    Thanks for the link! The problem isn't to fill the context node dynamically. That's already working using RTTI etc.
    It seems to me that the interface context node of the ALV in the embedded component doesn't recognize the dynamically added attributes. As i wrote the binding on node level (DATA->DATA), which i'm doing at design time, is working as expected, but the added attributes are only shown in the context node of the using component but not in the embedded.
    I'm still thinking there must be a way to do a binding at runtime. On the other hand the comment of Glenn in the thread you've pointed me to, seems to suggest that the ALV itself might have problems with dynamically appended attributes.
    Regards
    Ralf-J.

  • How-to map multiple explicit search help values to context attributes?

    Hi,
    I have a custom explicit Search Help with multiple attributes set as export and uses search help exit for data retrieval. I have set this Search Help for one of the context attribute that is binded to one of the input fields on view.
    Now, is it possible to dynamically map other export attributes from this Search Help to other Context attributes?
    I know this works for Input helps that are directly derived from check tables but not sure how to do it for explicit Search Helps.
    Can anyone please confirm and let me if this is possible? If yes, then can you please share an example or describe how to do it?
    Thanks and Regards,

    Hi Srinivas,
    Check this ..Search help can be dynamically assigned to a field.
    data lo_nd_info type if_wd_context_node_info.
    lo_nd_info = lo_nd->get_node_info( ).
    CALL METHOD lo_nd_info->set_attribute_value_help
    EXPORTING
    name = 'ATTR1'                  " Your attribute Name
    value_help_mode = '121'    " Valid value help mode
    value_help = 'Z187442'.      " Search help name
    The various possible values that you can pass to value_help_mode are as shown below.
    deactivated 101
    automatic 111
    ddic 121
    ovs 131
    Also refer this..
    Re: How to put dynamic search help in web dynpro ABAP.
    Cheers,
    Kris.

  • How to map search help dinamically to a context attribute

    Hi,
    I need to map search help dynamically based on selection screen radio button, Please let me know  how to map search help dinamically to a context attribute
    Best regards,
    Alleiah

    Here is the sample code,
    data lo_nd_info  type if_wd_context_node_info.
      lo_nd_info = lo_nd->get_node_info( ).
    CALL METHOD lo_nd_info->set_attribute_value_help
            EXPORTING
              name            = 'KTONR' (attribute Name)
              value_help_mode = '121'
              value_help      = 'PREMJ'.(Help Name)
    Regards
    Vishal

  • Dynamically loading context menu

    Hi,
    I am dynamically loading context menu as per XML.
    As I am doing it dynamically, only one callback function is
    used.
    Problem arises here.
    One callback function is not able to identify which menuitem
    is clicked.
    If I am able to identify which menuitem is clicked, so I can
    do different things for every menu in single function.
    function generateRef()
    trace("inside generate reference:generating references for
    individual screen");
    for(var i=0;i<resObj.firstChild.childNodes.length;i++)
    var str = datObj.getCurrent().attributes["path"];
    var string:Array = str.split(">");
    if(string[0] == resObj.firstChild.childNodes
    .attributes["name"])
    for(var j=0;
    j<=resObj.firstChild.childNodes.childNodes.length-1; j++)
    if(datObj.getCurrent().attributes["id"] ==
    resObj.firstChild.childNodes
    .childNodes[j].attributes["id"])
    var PD = new ContextMenuItem("PD", dummy, true, false, true);
    scrRef.customItems.push(PD);
    for(var a=0;
    a<resObj.firstChild.childNodes.childNodes[j].attributes["PDLink"];
    a++)
    var z=a+1;
    PDLArr[a]=_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["PDL"+z];
    PDNArr[a]=_root.resObj.firstChild.childNodes.childNodes[j].attributes["PDN"+z];
    var str = PDNArr[a];
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    var MK = new ContextMenuItem("MK", dummy, true, false, true);
    scrRef.customItems.push(MK);
    for(var b=0; b<resObj.firstChild.childNodes
    .childNodes[j].attributes["MKLink"]; b++)
    var z=b+1;
    MKLArr
    =_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["MKL"+z];
    MKNArr
    =_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["MKN"+z];
    var str = MKNArr
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    var EW = new ContextMenuItem("EW", dummy, true, false, true);
    scrRef.customItems.push(EW);
    for(var c=0; c<resObj.firstChild.childNodes
    .childNodes[j].attributes["EWLink"]; c++)
    var z=c+1;
    EWLArr[c]=_root.resObj.firstChild.childNodes.childNodes[j].attributes["EWL"+z];
    EWNArr[c]=_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["EWN"+z];
    var str = EWNArr[c];
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    var WP = new ContextMenuItem("WP", dummy, true, false, true);
    scrRef.customItems.push(WP);
    for(var d=0;
    d<resObj.firstChild.childNodes.childNodes[j].attributes["WPLink"];
    d++)
    var z=d+1;
    WPLArr[d]=_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["WPL"+z];
    WPNArr[d]=_root.resObj.firstChild.childNodes.childNodes[j].attributes["WPN"+z];
    var str = WPNArr[d];
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    }//end of if id
    }//for
    }//if
    }//for
    In for loop I am inserting context menu, but callback
    function is same, which is 'CALLING'. I want to detect for which
    menu item CALLING function is called.
    Please help ASAP.
    Thanks in advanced.

    Hi,
    I am dynamically loading context menu as per XML.
    As I am doing it dynamically, only one callback function is
    used.
    Problem arises here.
    One callback function is not able to identify which menuitem
    is clicked.
    If I am able to identify which menuitem is clicked, so I can
    do different things for every menu in single function.
    function generateRef()
    trace("inside generate reference:generating references for
    individual screen");
    for(var i=0;i<resObj.firstChild.childNodes.length;i++)
    var str = datObj.getCurrent().attributes["path"];
    var string:Array = str.split(">");
    if(string[0] == resObj.firstChild.childNodes
    .attributes["name"])
    for(var j=0;
    j<=resObj.firstChild.childNodes.childNodes.length-1; j++)
    if(datObj.getCurrent().attributes["id"] ==
    resObj.firstChild.childNodes
    .childNodes[j].attributes["id"])
    var PD = new ContextMenuItem("PD", dummy, true, false, true);
    scrRef.customItems.push(PD);
    for(var a=0;
    a<resObj.firstChild.childNodes.childNodes[j].attributes["PDLink"];
    a++)
    var z=a+1;
    PDLArr[a]=_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["PDL"+z];
    PDNArr[a]=_root.resObj.firstChild.childNodes.childNodes[j].attributes["PDN"+z];
    var str = PDNArr[a];
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    var MK = new ContextMenuItem("MK", dummy, true, false, true);
    scrRef.customItems.push(MK);
    for(var b=0; b<resObj.firstChild.childNodes
    .childNodes[j].attributes["MKLink"]; b++)
    var z=b+1;
    MKLArr
    =_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["MKL"+z];
    MKNArr
    =_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["MKN"+z];
    var str = MKNArr
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    var EW = new ContextMenuItem("EW", dummy, true, false, true);
    scrRef.customItems.push(EW);
    for(var c=0; c<resObj.firstChild.childNodes
    .childNodes[j].attributes["EWLink"]; c++)
    var z=c+1;
    EWLArr[c]=_root.resObj.firstChild.childNodes.childNodes[j].attributes["EWL"+z];
    EWNArr[c]=_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["EWN"+z];
    var str = EWNArr[c];
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    var WP = new ContextMenuItem("WP", dummy, true, false, true);
    scrRef.customItems.push(WP);
    for(var d=0;
    d<resObj.firstChild.childNodes.childNodes[j].attributes["WPLink"];
    d++)
    var z=d+1;
    WPLArr[d]=_root.resObj.firstChild.childNodes
    .childNodes[j].attributes["WPL"+z];
    WPNArr[d]=_root.resObj.firstChild.childNodes.childNodes[j].attributes["WPN"+z];
    var str = WPNArr[d];
    var curRef = new ContextMenuItem(str, clicking, false, true,
    true);
    scrRef.customItems.push(curRef);
    }//end of if id
    }//for
    }//if
    }//for
    In for loop I am inserting context menu, but callback
    function is same, which is 'CALLING'. I want to detect for which
    menu item CALLING function is called.
    Please help ASAP.
    Thanks in advanced.

  • Accessing Dynamically created Context

    Hi,
    I want to actually read the context which is dynamically created. I have a basic doubt that, will that context contain all the records or just metadata in context? How to read certain records from the context. I dont want to populate them to view via some textbox etc, actually using that data I want to create some xml. so I need to read all the records which are available in that context.
    Please let me know your inputs asap.
    Best REgards,
    Ritesh

    Hi Mehta,
    You can create both nodes as well as attributes in context dynamically. If you are creating a context attribute it will have only a single value.If you are creating context nodes it will have multiple values
    IWDNode node = wdContext.getChildNode("<node name>",IWDNode.LEAD_SELECTION);
    IWDTextview text = (IWDTextview)view,createElement(IWDTextview.class,null)
    text.bindText(node.getElementAt(<give index>).getAttribute())
    Hope this helps you
    Try to create context attributes and nodes statically
    Hope this helps you
    Regards
    Rohit

  • Check Mandatory Fields when state is bound with context attribute

    Hello All,
    Currently i am facing  problem in my SAP SRM 7.0 standard component.
    Actually, i have to remove  mandatory(State = Required) for one of my inputfileds for this I have written below code, but it has been  remove only Red mark * infront of Inputfield, after that, i am trying to save other data, still it is asking me enter the required value.
         here my input field  bound with Context attribute, it is standard attribute.
    data:lo_input1 type ref to cl_wd_input_field.
       lo_input1 ?= VIEW->get_element( 'NAME_FIRST' ).
       lo_input1->set_state( '00' ).
    I am trying to delete state = required property from below component and view
    Component Name : /SAPSRM/WDC_MOFC_PERSON
           View  :  V_PERSON
    Can you help me on this?
    Thanks
    Sandeep.

    Hi Baskaran ,
    Thanks for ur reply ..
    Eveen in that component they have not used cl_wd_dynamic_tool class for mandatory attributes
    I want to share another thing with u that is
    I am trying it in another way
    with the following code which i have done in post exit  is
    let me explain u what i did
    __first of all i got the child node of rootuielementcontaine
    later
    i get the childnode of container_left and assigned it to another class of ref cl_wd_uielemnent
    now where i have struked is
    *CALL METHOD LR_CHILD2->GET_CHILD
    EXPORTING
       ID        = 'FORM_OF_ADDRESS_DROPDOWN'
       INDEX     =
    RECEIVING
       THE_CHILD = LR_C1.
    what the error i am getting is
    OBJECTS_OBJREF_NOT_ASSIGNED
    Please correct me if there is any wrong inn the code ...
    FORM_OF_ADDRESS_DROPDOWN--->ui element dropdown
    r__ DATA lr_container TYPE REF TO cl_wd_uielement_container.
    DATA lt_children  TYPE        cl_wd_uielement=>tt_uielement.
    DATA lr_view      TYPE REF TO if_wd_view.
    DATA lr_child     TYPE REF TO cl_wd_uielement.
       DATA lr_child1     TYPE REF TO cl_wd_uielement.
       DATA lr_child2     TYPE REF TO cl_wd_uielement.
    data : LR_CON1 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
    data : LR_CON2 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
    SANDEEP
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lt_children = lr_container->get_children( ).
    CALL METHOD lr_container->get_child
       EXPORTING
         id        = 'DATACONTAINER'
         index     = 1
       RECEIVING
         the_child = lr_CHILD.
    LR_CON1 ?= LR_CHILD.
    CALL METHOD LR_CON1->GET_CHILD
      EXPORTING
        ID        = 'CONTAINER_LEFT'
        INDEX     = 1
      RECEIVING
        THE_CHILD = LR_CHILD1 .
    DATA : LR_CHILD2 TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
    LR_CHILD2 ?= LR_CHILD1 .
    *DATA : LR_C1 TYPE REF TO CL_WD_UIELEMENT.
    *CALL METHOD LR_CHILD2->GET_CHILD
    EXPORTING
       ID        = 'FORM_OF_ADDRESS_DROPDOWN'
       INDEX     =
    RECEIVING
       THE_CHILD = LR_C1.
    *DATA : LR_DD TYPE REF TO CL_WD_DROPDOWN_BY_KEY .
    *LR_DD ?= LR_C1 .
    *CALL METHOD LR_DD->SET_STATE
    EXPORTING
       VALUE  = '00'
    sandeep

  • Lifespan of Request, Session and Context Attributes

    I'm studying for the SCWCD exam and am hoping to clarify a few points on the lifespan of attribute objects bound to the various request, session and context web scopes.
    Do request attributes persist as long as the request is being handled by some servlet? In other words, once the response is committed are those objects unbound and destroyed?
    Similarly, I'm assuming session attributes are unbound and destroyed when the session either times out or is explicitly terminated.
    Lastly, for context attributes, which are available to the entire web application, are these simply available
    until explicitly removed?
    Thanks.

    Request: available until the HttpServletRequest object goes out of scope (at the end of the doService or associated methods). The attributes here are basically just stored in a HashMap in that object
    Session: available until the session no longer exists, which occurs when the session times out (NOT when the user closes their browser), or when the session is terminated by the server code
    Context: Available until the container stops, such as upon a JVM restart
    NOTE: Specific objects in all three contexts can be removed and added at any time by the server code

  • 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"

  • How to set multiple values in one context-attribute

    Hi all,
    Anybody knows a possibility to set multiple Values to a context-attribute?
    I know it how to get it with the following code:
    String break[]= request.getParameterValues("break");
    Now I want to do something like:
    request.setParameterValues(break[no]);
    where no is a counter in a loop.
    With the Method setAttribute(), I overwrite the previous inserted value.
    Thanx
    Robert

    I have not explizit declared break as an array.
    It is the Context- Attribute I want to send. I thaught that I can use it as an array in the same way I can do it when I send Data from an HTML- Form (with multiple values) to an servlet.
    I don't know how to declare the Attribute explizit as an array.
    that it is you wanted to know?
    I think my main problem is to get an array from the servlet to the jsp. Is there an other possibility (other than via Context-Attributes) to do that?
    thanx
    robert

Maybe you are looking for

  • I downloaded ff4 in Fedora 13, now how do i install it?

    The downloading of FF4 in Fedora 13 has gone and made a 45 item folder called Fire Fox in my home directory. Now what do i do with it. If nothing can be done with it i'm more than happy with the Firefox 3.something i'm working with right now. If ther

  • Trouble running DurableSubscriberExample

    Hi I am having trouble running the "DurableSubscriberExample.java" that is in Appendix A of the "Java Message Tutorial" (http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/client_samples.html#1002876) These are the steps I followed: 1. I compile

  • How to enable collaboration features in BusinessObjects 4.1

    Hi guys, Can we have collaboration features such as chat, forum, discussion in SAP BusinessObjects 4.1. For example, one client open a report and the others can comment on that session at the same time. Thanks

  • Video missing from recording

    Hello, one of our clients has a hosted recording with video that has been working fine until recently.  When playing back the recording, the video is now missing and just shows a black screen where the video footage should be. We have tried on both W

  • Linking material Group and the Account Assignment...

    Hi Gurus, I have a requirement from the client in which they want to restrict the entry of the Account assignment when a particular material group is enetered in the PO. The requirement is actually either to have F (order) populated in the account as