Reload object value from session

Hi, I use a for loop to get object value "JPEG" from servlet.
My servlet create different value of "JPEG".
But the result is JPEG keeps in its first value.
The value won't change!!
Can anyone tell me how to solve this bug ??
Thanks in advance
<%
String x[] ={"80" ,"241" ,"401" ,"561" ,"80" ,"241" ,"401" ,"561" ,
"80" ,"241" ,"401" ,"561" ,"80" ,"241" ,"401" ,"561" };
String y[] ={"40" ,"40" ,"40" ,"40" ,"161" ,"161" ,"161" ,"161" ,
"281" ,"281" ,"281" ,"281" ,"401" ,"401" ,"401" ,"401" };
for (int i=0;i<10;i++){
String jpeg = (String) session.getValue("JPEG");
int jpeg_ch = Integer.parseInt(jpeg,10);
%>
<img style="position: absolute; left:<%= x[jpeg_ch] %>; top:<%= y[jpeg_ch] %>; width: 160; height:120;" Src="http://192.168.10.110:8080/servlet/Servlet?jpeg=<%= jpeg_ch %>">
<%
%>

<code>
for (int i=0;i<10;i++){
String jpeg = (String) session.getValue("JPEG");<i>// Wrong</i>
int jpeg_ch = Integer.parseInt(jpeg,10);
%>
// That should be the following:
String jpeg;
for (int i=0;i<10;i++){
jpeg = (String) session.getValue("JPEG");<i>// Wrong</i>
int jpeg_ch = Integer.parseInt(jpeg,10);
%>
</code>

Similar Messages

  • How to get int value from [session.getAttribute("String")]

    i am not able to get int value from the following statiment
    int i=session.getAttribute("String");
    i also try by casting it into int but it dont work, can somebody help me in this regard

    abuu wrote:
    i am not able to get int value from the following statiment
    int i=session.getAttribute("String");
    i also try by casting it into int but it dont work, can somebody help me in this regard
    Integer i=(Integer)session.getAttribute("String");
    i.intValue();but know how it is working. that is useful.
    Diablo.

  • Set atribute value from session bea while creating new record using ADF BC

    hi,
    i want to set the value of new record attribute from session bean while
    using ADF BC using creation form. how can i set the value of a perticular arribute of a record to the value stored in session bean.

    Chapter 9 in the ADF Developer's Guide for Forms/4GL Developers (available on the ADF Learning Center at http://www.oracle.com/technology/products/adf/learnadf.html ) describes how to accomplish this along with other typical kinds of programmatic business logic.

  • Setting a related object value from an update

    Hi - Is there anyway without custom integration servic to set a field value of a related object based on the update to a
    record (e.g. lead record)?
    For example, I want to keep track of a user's total open leads for assignment purposes. So ideally I'd like to update the
    user's custom lead count field, everytime my leads get closed or created.

    I believe this would require a custom web service program. I would recommend that you post this question in the CRM On Demand Integration Development forum.

  • Workitem ID wise to get the Object value

    Hi All,
    is it possible to get the object value form Workitem id wise.
    for example workitem id '446085' based on that workitem id i want to retrieve the object value.
    Please clarify.,
    Thanks & Regards
    K.Gunasekar.

    Hi
    I want to update the object Reference.
    for example i am getting the object value from SAP_WAPI_GET_OBJECTS. (F.M)
    based on the workitem_id.
    i want to update the objects reference from the original one.
    if is it possible means please let me know.
    Thanks & Regards
    K.Gunasekar.

  • How to set a object value bound to a session to JavaScript variable

    In a JSP, I store an object value in a HttpSession and I also write a Javascript function to display something on the screen. I need to use the Javascript function to display the object value which is stored in the session. How to set the object value to variable of the JavaScript function. Thanks.

    I write a class JavaScriptHelper to convert the object value to variable of the JavaScript;
    1.get the data to a javabean from database;
    2.convert the data to variable of the JavaScript as a String ;
    3.store the object in a HttpSession or Httprequest ;
    4.use in Jsp get the String (variable of the JavaScript )
    YourBean bean = (YourBean) request.getAttribute("model");
         if (bean != null) out.println(bean .getJsCode())
    convert function,(this is only for the matrix):
    public static String formatJsCode(Vector vector) {
    String sJsCode = "";
    //get js head
    sJsCode = getJsHeader();
    //define js array;
    sJsCode += "var data=new Array();\n";
    Vector v = null;
    String sTemp = "", sLine = "";
    for (int i = 0; i < vector.size(); i++) {
    v = (Vector) vector.get(i);
    sLine = "";
    for (int j = 0; j < v.size(); j++) {
    sTemp = (String) v.get(j);
    //replace " to \"
    sTemp = sTemp.replaceAll("\"", "\\\\\\\"");
    //escape Html Tag
    //sTemp = StringUtil.escapeHTMLTags(sTemp);
    //replace \r\n to <br>
    sTemp = sTemp.replaceAll("\r\n", "<br>");
    if (j != 0)
    sLine += ",";
    sLine += "\"" + sTemp + "\"";
    sJsCode += "data[" + i + "]=new Array(" + sLine + ");\n";
    //get js foot
    sJsCode += getJsFooter();
    return sJsCode;
    public static String getJsHeader(){
    return "<script language=\"JavaScript\">";
    public static String getJsFooter(){
    return "</script>";
    }

  • Same value in two or more different objects connected via session

    I have to object class with get and set method configure in faces-config.xml as session
    <managed-bean>
    <managed-bean-name>user</managed-bean-name>
    <managed-bean-class>com.dirsot.content.utility.RegisterUser</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>album</managed-bean-name>
    <managed-bean-class>com.dirsot.content.tables.UserAlbum</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    in both objects, RegisterUser and UserAlbum i have two identical attribute called us_email as user email.
    I need them to be in both object because I'm using hibernate to store them in the database.
    my question is when I logged in, RegisterUser get the value and sets us_email value from the user.
    what can I do that the stored value on RegisterUser to be also reflected on UserAlbum? Obviously I cannot create new object inside RegisterUser because that will not show in the session.
    is there anyone that can give me some indication.
    code examples are really really welcome. Thank you.

    harddisk wrote:
    what can I do that the stored value on RegisterUser to be also reflected on UserAlbum?Better inject the one bean in the other bean or just access the other bean through SessionMap.
    You can find here useful code examples: [http://balusc.blogspot.com/2006/06/communication-in-jsf.html].

  • LoaderInfo get values from EMBED and OBject Tag (not FlashVars)

    hi
    i try get values from object and embed tags like bgColor and
    allowFullScreen
    but i cant find how i can it
    loaderInfo.parameters return only flashVars
    if some body know it please help
    thank you
    Sonettic Cinema
    Project

    <forward name="success" path="/jsp/success.jsp" redirect="true" />
    but when success.jsp page gets called its not displaying the username and usertype values on page.The request has been redirected to success.jsp(*redirect="true"*) and hence the attributes stored in request object will not be available in success.jsp. Use Session to store login user information instead.

  • How to get attribute value from an object inside an object in Xpress

    Does anyone know how to get an attribute value from an object in Xpress in a workflow? I have an object structured as follows:
    <ResourceInfo accountId='mj628' tempId='3483372b787ce7dd:-5d99a0c5:130cb238483:-3600'>
    <ObjectRef type='Resource' name='Google Apps'/>
    </ResourceInfo>
    I need if possible to get the name='Google Apps', which is inside the ObjectRef, so I guess its an attribute value of an object inside an object.

    If the ResourceInfo object is accessible in a variable, i.e. named "myResInfo", you just have to check the Java API and call the relevant method:
    <invoke name='getResourceName'>
      <ref>myResInfo</ref>
    </invoke>

  • Remote Object - not able to get the returned value from java method

         Hi ,
    I am developing one sample flex aplication that connects to the java code and displays the returned value from the
    java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
    lastResult is giving null .  I am able to see the sysout messages in server console.
    I am using flex 3.2 and blazeds server  and java 1.5
    Here is the code what I have written.
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
     <mx:Script><![CDATA[
    import mx.controls.Alert; 
    import mx.binding.utils.ChangeWatcher; 
    import mx.rpc.events.ResultEvent; 
    import mx.messaging.*; 
    import mx.messaging.channels.* 
    public function initApp():void { 
         var cs:ChannelSet = new ChannelSet(); 
         var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf");     cs.addChannel(customChannel);
         remoteObj.channelSet = cs;
    public function writeToConsole():void {      remoteObj.writeToConsole(
    "hello from Flash client");
          var returnedVal:String = remoteObj.setName().lastResult;     Alert.show(returnedVal);
    //[Bindable] 
    // private var returnedVal:String; 
    ]]>
    </mx:Script>
    <mx:RemoteObject id="remoteObj" destination="sro" /> 
    <mx:Form width="437" height="281">
     <mx:FormItem>  
    </mx:FormItem>  
    <mx:Button label="Write To Server Console" click="writeToConsole()"/>
     </mx:Form>
     </mx:WindowedApplication>
    Java code
    public  
         public SimpleRemoteObject(){  
              super();     }
      class SimpleRemoteObject { 
         public void writeToConsole(String msg) {          System.out.println("SimpleRemoteObject.write: " + msg);     }
         public String setName(){          System.
    out.println("Name changed in Java"); 
              return "Name changed in Java";
    And I have configured destination in  remote-config.xml
    <destination id="sro">
       <properties>    
        <source>SimpleRemoteObject</source>
        <scope>application</scope>
       </properties>
      </destination>
    Please help me .

    You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
    In this you define what you wish to do.
    More importantly in the remote object you need to define which method you wish to call using the method class like this
    <mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1"  >
         <Method name="javaMethodName" result="r2" fault="f2"/>
    <mx:RemoteObject>
    r2 is the function where you get the result back from java and can use it to send the alert.

  • Values from Structure used in Form to be transferred to a Business Object

    Hello,
    I have defined a structure (zcsks) in the workflow container. This structure is used in two forms (Change and Approve).
    With the approval (button pressed on approve form) the data entered in the structure zcsks has to be transferred to the business object ZBUS0012 in the workflow container, so that the business object method CREATE can be executed automatically.
    The values for the structure ZCSKS is already transferred from the form to the workflow container automatically.
    My question now is how I can transfer values from ZCSKS to ZBUS0012 and execute its method CREATE automatically ?
    Thank you in advance!

    Hello,
    "Value of expression '&_WI_OBJECT_ID.COSTCENTER&' cannot be used as the target of an assignment"
    This is because you are trying to assign a value to an attribute of the main object of a workflow (_WI_OBJECT_ID).
    That won't work. I thought you meant you had an object in the workflow container and wanted to
    instantiate that.
    When the workflow is created the main object is already instantiated so you can't change it.
    regards
    Rick Bakker
    Hanabi Technology

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • How to put value in Session from AM ?

    in AM : i have a condition like this
    if (tool_id != null)
    //initialize lov and pass this tool_id to lov's controller.
    how can I do it ? If I had to do it from the controller, I would have put the value in session parameter, but how Do I put a parameter's value in session from AM ?
    I dont have the method : putsessionvaluediret() in am ??
    or say : how do i pass a value from am to an lov's contoroller ?
    Edited by: OAF-dev on Mar 8, 2010 4:53 PM

    You can create a method of string type and return the value to the controller.
    IN AMImpl:
    public String getToolId(String InputParameterIfAny)
    //initialize lov and pass this tool_id to lov's controller.
    // Capture toolID in variable and return
    return toolID;
    In Controller:
    String toolId = (String)am.invokeMethod("getToolId",InputParameterIfAny);
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to remove an object from session with JSF 2.0 + Faceletes

    hi all,
    I have a facelets page which calls a backing bean of session scope. Now when ever i click on this page i want the existing bean object to be removed from the session . In my existing jsp i have a logic something like this to remove the object from session
         <% if (request.getParameter("newid") != null) {
              request.getSession().removeAttribute("manageuserscontroller");
    %>
    Now i have to refactor my jsp to use facelets and i should not be using scriplets anymore . I did try with JSTL but the <c:remove> tag is not supported by facelets.
    Can someone help me how can i refactor this code to work for my facelets?
    I really appreciate your help in advance
    Thank you

    r035198x wrote:
    Redesign things so that the remove is done in a backing bean method rather than in a view page.Exactly that. I tend to cleanup session variables at the start and at the end of a page flow; generally the end is some sort of save or cancel action being invoked through a button but that is application specific.

  • Retrive an object from session throw class not found at findClassOnDisk exception

    java.lang.ClassNotFoundException: not found at findClassOnDisk
    at com.iplanet.ias.classloader.IasAppClassLoader.findClassOnDisk(Unknown Source)
    at com.iplanet.ias.classloader.IasAppClassLoader.findClass(Unknown Source)
    at com.iplanet.ias.classloader.IasAppClassLoader.loadClass(Unknown Source)
    at com.iplanet.ias.classloader.IasAppClassLoader.loadClass(Unknown Source)
    at com.iplanet.ias.classloader.IasAppClassLoader.loadClass(Unknown Source)
    at com.iplanet.ias.classloader.AppClassLoaderController.loadClass(Unknown Source)
    at com.netscape.server.deployment.AppComponentDescriptor.classForName(Unknown Source)
    at com.kivasoft.util.Util.classForName(Unknown Source)
    at com.kivasoft.eb.EBHelper.classForName(Unknown Source)
    at com.kivasoft.util.NASObjectInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:918)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1014)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:374)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2263)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at java.util.ArrayList.readObject(ArrayList.java:531)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2214)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1411)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
    at com.netscape.server.servlet.platformhttp.PlatformNASSession.getMemberValue(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformNASSession.getValue(Unknown Source)
    at com.netscape.server.servlet.platformhttp.PlatformNASSession.getAttribute(Unknown Source)
    at jsp.APPS.tsws_war.jsp.attachment.updateFile._jspService(updateFile.java:246)
    at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.callJSP(Unknown Source)
    Description:
    1) We are using iplanet distributed session
    2) We put a ArrayList of object into the session
    3) Retrieve it from session immediately - no problem
    4) display jsp on user browser
    5) browser submit another request
    6) retrieve it from session again, the above error show up. (other session attribute was able to retrieve so it is not session timeout)
    if we can save the object into the session. The object 's class should be avaliable ?!?!
    (currently using iplanet 6.5 with mp1 tested both on
    solaris machine and win2000 machine)

    I guess, the problem is due to the distributed session.
    Make the session lite and check, if it works, then we can confirm that it is due to the guessed reason. Then please let me know.
    Mean time I also try to reproduce the problem, and find out the solution.
    Thanks and best of luck,
    Rakesh.

Maybe you are looking for

  • Photoshop CS2, after normal quitting, "Unexpectedly Quit" window appears

    I use Photoshop CS2 on a PPC G4 Dual MDD with 1GB RAM and MacOSX 10.4.11. For the past 2 months, every time I normally quit Photoshop CS2, with the app disappearing from the dock and it seems to have finished, in about 6 seconds, a window pops up say

  • Adobe Flash Player not working on any browser in computer

    I really need help flash player not working in any browser in google chrome. For example in http://www.twitch.tv/ You need Adobe Flash Player to watch this video.  Download it from Adobe. I already did everything to fix it shown in support page pleas

  • How to duplicate (finished) iMovie Project?

    Hello, I went on vacation with my wife and we shot some video all around town. I've put together all of the footage and trimmed the video, tweaked the audio, etc. for OUR video archive. The project comes in at just under an hour. Our friends want to

  • Running report from database package

    Hi, I have a database package and it gets soem details and submits the report using SRW. It has submitted successfully. But the report is not outputed but there is file with extension eps. Can the package pass the user variables?? The package code fo

  • Cannot get Excel Report to display on Internet Explorer

    Hi, We have an issue with displaying Excel reports on IE on some client machines. A window just pops up and closes. The reports run fine on Firefox and I was able to run it on IE earlier. I had this report working before on all application servers. N