How to show an integer in struts

Hi
I am still learning to use struts. So please forgive me if I goof up. I am trying to make a quiz website using struts. I have used multiple choice questions using radio buttons. Every time the user gets a correct answer I increase an integer variable count, in the action class. So far I have made it work by using system.out.println() method to see the increment of count on the tomcat console. Now my problem is how can I show the user's total score on the next page? Any help will be highly appreciated.
cheers!
Shankha

Hi,
in your action class set the score as Integer object in request.setAttribute method, and forward the page to the jsp u want.In the jsp page get back the value stored in the request scope and show it to the user.
code in action class:
int i=10;/*score in int*/
request.setAttribute("score",new Integer(i));
code in the jsp page:
Integer iobj=(Integer)request.getAttribute("score");
int i=iobj.intValue();
out.println(i);
I think it will help you,bye.

Similar Messages

  • How to show an Integer in a JLabel??

    I did like
    JLabelName.setText(IntegerName);but it doesnt work..
    help..

    Yeah i did..
    guess its okay i realized it by looking at API docs
    again b4 looking at your post :)Although the creating of a new String and then calling the static method on that instance will work. It's just not necessary.
    Hope you have a gr8 day ahead !!!Thank you. You too.

  • How to just show the integer value of "MarkerText" in my chart?

    I put the tag of "MarkerText " in my BAR_HORIZ_CLUST. Then I can successfully get the values on my bar. But the point of decimal is not good. I just want to show the integer of the number(In fact, all of our value are integer. For example, I have a value "7". But it shows me "7.000" ). I searched a url to do it: http://blogs.oracle.com/xmlpublisher/2007/05/15#a293. But it is only available for pie. With regard to my BAR_HORIZ_CLUST, I cann't find any way to do it.
    This is my sample file:
    Chart Definition:
    chart:
    <Graph graphType="BAR_HORIZ_CLUST">
    <MarkerText visible="true" markerTextPlace="MTP_CENTER"/>
    <Title text="Requests Closed" visible="true" horizontalAlignment="CENTER"/>
    <LocalGridData colCount="{count(xdoxslt:group(.//ROW, 'AGENTNAME'))}" rowCount="1">
    <RowLabels>
    <Label>amout of closed requests</Label>
    </RowLabels>
    <ColLabels>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="AGENTNAME">
    <xsl:sort select="current-group()/AGENTNAME"/>
    <Label><xsl:value-of select="current-group()/AGENTNAME"/></Label>
    </xsl:for-each-group>
    </ColLabels>
    <DataValues>
    <RowData>
    <xsl:for-each-group xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select=".//ROW" group-by="AGENTNAME">
    <xsl:sort select="current-group()/AGENTNAME"/>
    <Cell><xsl:value-of select="current-group()/AMOUNT"/></Cell>
    </xsl:for-each-group>
    </RowData>
    </DataValues>
    </LocalGridData>
    </Graph>
    I modified the tag of "MarkerText" as below but still not available :(
    <MarkerText visible="true" markerTextPlace="MTP_CENTER">
    <X1ViewFormat>
    <ViewFormat decimalDigit="0" decimalDigitUsed="true" decimalSeparatorUsed="true" />
    </X1ViewFormat>
    </MarkerText>

    First, make sure you are targeting the correct axis -- Y1 vs X1, etc.
    Second, if you include all attributes in <ViewFormat> it should work.
    Example:
    <MarkerText visible="true" markerTextPlace="MTP_CENTER">
    <Y1ViewFormat>
    <ViewFormat decimalSeparator="." decimalDigit="0" decimalSeparatorUsed="true" decimalDigitUsed="true"/>
    </Y1ViewFormat>
    </MarkerText>

  • How to show attributes column types on ERD

    Hi,
    I created a diagram in ERD but can't find how to show in the diagram the column types. It only shows the column names but doesn't show if this is a varchar2, integer,etc or if this can be null or not. Please help.
    Thanks in advance.

    the idea is that entities are logical objects. Although you can designate a "format" for an attribute, it's really more of a physical model/implentation concept.
    So the answer to your question is No.
    However, If you wanted to use a Server model Diagram there is a lot more information associated with it.
    And since it is a actual model of the DB then you will have your foreign keys in the child tables.
    Michael

  • How to upload multi files in struts

    Hi all,
    plz show me how to upload multi files in struts ... :(
    thank in advance.
    bowlkhin

    [help link 1|http://www.roseindia.net/struts/strutsfileuploadandsave.shtml]
    [help link 2|http://www.roseindia.net/struts/strutsfileupload.shtml]

  • How to convert an integer to a sting in an expression

    HI,
    I need the convert and integer to a sting in the following example
    In the post expression:
    Step.Result.ReportText = "This is channel No. " + Local.ChNo
    I get an error of unmatched type. (Local.ChNo is integer)
    CAn you show me how to convert the integer to string in this example?
    Thanks
    Rafi

    Hi Rafi,
    Step.Result.ReportText = "This is channel No. " + Str(Local.ChNo)
    or you can format the string Str(Local.ChNo, "%x")
    Check out the help within the function browser.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to show more than one record at a form-like style report?

    Hi All,
    I developed a form-like style report
    I want it to show more than one record at once (At the same page)
    I tried that by setting the value to "Maximum records per page" property for the repeating frame to 10
    but when I close the property palete and open it agian the value is returned to 1 !!!
    how to show more than one record at the same page?????
    Thank u

    Hi,
    there's perhaps another property like "page protect". If than 2 records didn't fit at one page there's a page break. Or is there any object inside the repeating frame with page-break properties? Sorry .. it's like looking into a chrystal ball ...
    Regards
    Rainer

  • How to show custom error message in WebADI Excel template?

    Hi,
    I've  created a custom Web ADI integrator and associated it with a 'Procedure' based custom interface.
    WebADI Interface API Returns is set to  "Error Message".
    I'm using  raise_application_error(-20001, "Actual Error Message") for invalid rows,but custom error message from PL/SQL  is not populated on the excel template.
    Instead it is showing "SQL exception occurred during PL/SQL upload".
    Am I missing anything? How to show custom error message from Pl/SQL procedure to WebADI Excel template?
    TIA
    Narasimha

    The custom API errors are visible in the BNE log but not on the Excel.
    BNE Log=>
    12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Exception while uploading to PL/SQL API.  Error Code: 20001, Message: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
    ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
    ORA-06512: at line 1
    12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Stack trace: java.sql.SQLException: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
    ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
    ORA-06512: at line 1
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
      at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
      at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
      at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3550)
      at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4710)
      at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
      at oracle.apps.bne.integrator.upload.BnePLSQLUpload.doUpload(BnePLSQLUpload.java:284)
      at oracle.apps.bne.integrator.upload.BneSAXUploader.processDeepestLevel(BneSAXUploader.java:2346)
      at oracle.apps.bne.integrator.upload.BneSAXUploader.startElement(BneSAXUploader.java:1182)
      at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:181)
      at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
      at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
      at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
      at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:234)
      at oracle.apps.bne.integrator.upload.BneUploader.processUpload(BneUploader.java:301)
      at oracle.apps.bne.integrator.upload.BneAbstractUploader.processUpload(BneAbstractUploader.java:114)
      at oracle.apps.bne.integrator.upload.async.BneAsyncUploadThread.run(BneAsyncUploadThread.java:140)
    12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 WARNING        BneOracleWebAppsContext.getTimeZone CLIENT_TIMEZONE_ID has not been set
    12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 ERROR          BneOracleWebAppsContext.getExtraJDBCConnection recieved the same connection as the base connection.  There may be transaction problems.
    How to show the same error in the excel template?
    Here is the package:
    CREATE OR REPLACE PACKAGE BODY APPS.XXPO_COSTFACTS_WEBADI_PKG
    AS
       PROCEDURE upload_data (
                              P_CONTAINER_ID IN VARCHAR2
                            , P_SAIL_DATE IN DATE
                            , P_PO_NO IN VARCHAR2                     
                             ) IS
        --declare
        lv_err_msg      VARCHAR2(240);
        lf_err_flag     NUMBER := 0;
        ln_temp         NUMBER;
        BEGIN
        --------------------- checking for mandatory parameters---------------------------
          IF (P_CONTAINER_ID IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg||'-'||'Please enter CONTAINER_ID - ';
          END IF;
          -------------Validation for Sail Date Format----------------------
          IF (P_SAIL_DATE IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg || ' ' || 'Enter Sail Date - ';
          ELSE
             BEGIN
                SELECT 1
                  INTO ln_temp
                  FROM DUAL
                 WHERE P_SAIL_DATE =  TO_DATE (TO_CHAR (P_SAIL_DATE, 'DD-MON-YYYY'), 'DD-MM-YYYY');
             EXCEPTION
                WHEN NO_DATA_FOUND THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format';
                WHEN OTHERS THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format'|| SQLERRM;
             END;
          END IF;
          -------------Validation for PO_Number----------------------
          IF (P_PO_NO IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg || ' ' || 'Enter PO_NO - ';
          ELSE
             BEGIN
                SELECT count(1)
                  INTO ln_temp
                  FROM PO_HEADERS
                 WHERE Attribute4 =  P_PO_NO;
             EXCEPTION
                WHEN NO_DATA_FOUND THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' No Oracle PO for Biceps PO#'||P_PO_NO;
                WHEN OTHERS THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Error getting the Oracle PO for Bicpes PO#'||P_PO_NO||' Error-' || SQLERRM;
             END;
          END IF;
         -----------------------Insert Record----------------------------
         IF lv_err_msg is NULL THEN
         BEGIN
             INSERT
              INTO XXP2P_HW_COST_FACTORS_STG
                     CONTAINER_ID
                    ,SAIL_DATE
                    ,PO_NO
                    , ERROR_FLAG
                    , ERROR_MSG
                   ,CREATED_BY
                    ,CREATION_DATE
                    ,LAST_UPDATED_BY
                    ,LAST_UPDATE_DATE
                    ,LAST_UPDATE_LOGIN              
                VALUES
                     P_CONTAINER_ID
                    ,P_SAIL_DATE
                    ,P_PO_NO              
                    ,lf_err_flag
                    ,lv_err_msg
                  ,FND_GLOBAL.USER_ID
                    , trunc (sysdate)
                    ,FND_GLOBAL.USER_ID
                    , trunc (sysdate)
                    ,FND_GLOBAL.LOGIN_ID              
                  --  commit;
                  DBMS_OUTPUT.put_line
                    '-' || 'After ap_invoices_interface'
            EXCEPTION
            WHEN OTHERS THEN
              ROLLBACK;
              lf_err_flag := 1;
              lv_err_msg  := lv_err_msg || ' ' || 'error loading CONTAINER_ID-' || P_CONTAINER_ID || SQLERRM;
              raise_application_error(-20001, lv_err_msg);
            END;
        ELSE
              raise_application_error(-20001, lv_err_msg);
        END IF;
      END upload_data;                        
    END XXPO_COSTFACTS_WEBADI_PKG;

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • How to show "ALL" Values by default in Page Drop-Down Lists in Pivot Tables

    Hi Everyone,
    Iam stuck with 1 problem please can any 1 help me if u know the solution.
    Here is my problem:
    How to show "ALL" Values by default in Page Drop-Down Lists in Oracle BI Pivot Tables?
    For example, if you place Region in the pages area, a Region drop-down list allows the user to select a particular region, and see the data for only that region, rather than seeing all the Regions,But by default its not showing "ALL" option in the drop down list ,rather than doing that its showing result for only 1 region by default.
    And an other problem with this pages area is, if we palce the multiple attributes in the Pages area in the pivot table, the (Fields)result is showing in vertically, the attributes 1 by 1(Every attribute in a new line) ,rather than showing like that, is there any way to show the results in horizantally?(We want to have it as a seperate drop drown list for every field horizantally not as a concatenated list).

    Thanks Nikhil. But I am fetching the values from the LOVCache.java.
    I am using <af:selectManyChoice>. Is there any way I can use LOVCache.java value for selecting default values instead of hard coding?
    I mean to say can I write
    unselectedLabel="#{LOVCache.entityTypeSelectionList.anyValue}"
    where LOVCache.entityTypeSelectionList is used to populate the drop down box.
    Regards,
    Aseet

  • How to show all view tab (Main Report and all Sub Report) in Visual FoxPro 9

    I use ActiveX from Crystal Report Developer XI for viewer in Visual FoxPro 9 and I already know how to show Main Report by using command:
    oRptRun=createobject("CrystalRuntime.Application")
    oRptView=thisform.oleRptViewer
    oRptOpen=oRptRun.OpenReport('MyReport.rpt')
    oRptView.ReportSource=oRptOpen
    oRptView.ViewReport
    Inside the MyReport.rpt there is two subreport name :
    1. MySubReport1
    2. MySubReport2
    My Question is :
    How to show all view tab (Main Report and all Sub Report) at the 1st time we call ViewReport?
    I try to using command :
    oRptRun=createobject("CrystalRuntime.Application")
    oRptView=thisform.oleRptViewer
    oRptOpen=oRptRun.OpenReport('MyReport.rpt')
    oRptSub=oRptOpen.OpenSubreport("MySubReport1")
    oRptSub=oRptOpen.OpenSubreport("MySubReport2")
    oRptView.ReportSource=oRptOpen
    oRptView.ViewReport
    but only show Main Report (view tab name : Preview)?
    Did I miss any command before I call oRptView.ViewReport?

    Your right, there is only one tab to view the report.
    To open the subreports you will need to click on them in the main report. I don't know of a way to open them programmatically like you are doing here
    http://diamond.businessobjects.com/robhorne</a>

  • How to show all the search result in a report page

    I have a report page which the user can enter first or last name to find the matched employees. The current report only show maximum of 15 matched results. How to show all of them in one page if more than 15.
    Also, the employee name on the report is a link, how to make the link to be conditional. ( I mean it can be a link or not based on another column)
    Thanks.
    Jen

    Hi, you can change the number of rows on the report definition page (15 is the default value)- that's also where you can change pagination and max. number of rows etc.
    About the second question - you will have to use Case or Decode in your report query and have the value as link or not based on the condition column, something like:
    Select Decode(condition_column, 'link_value', '<a href="f?p=YOUR_APP:PAGE_TO_LINK_TO:'  || :SESSION || ':::::">display_column</a>' , display_column) From .....
    Hope this helps.

  • How to show filtered parameter in dropdown form in crm 2013

    Hi,
    I want to create a report in crm 2013. When I report is run then filtered parameter fill record from database in dropdown form and when I select record from dropdown then generate report of selected record. Please tell me how to show record in filtered parameter
    from database within crm. In below image paramter is text field. How to auto fill filtered parameter from database.

    Hi Aamir,
    Check if the below link helps!!
    https://social.microsoft.com/Forums/en-US/ad8a3bc2-dbec-4597-adfd-8bd6c34f5e9a/drop-down-parameter-in-crm-2011-custom-report?forum=crm
    Thanks,
    Prasad
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

  • How to show GL Account Balance amount in Ledger Report.

    Hi,
    We need to show General Ledger balance based transaction wise how we can show GL Account Balance where it will store which table and which filed.here below query is there here only I need to add balance after Total please guide me.
    select T0.transid,T0.number,T2.seriesname,T0.refdate,T0.baseref,T1.account,T1.shortname,T3.acctname,T1.credit,T1.debit,T1.credit+T1.debit as Total,T3.CurrTotal,T0.ref1,T0.ref2,T1.ref3line,T0.memo,T1.paymentref, T1.ProfitCode, T1.OcrCode2, T1.OcrCode3,
                          T1.OcrCode4, T1.OcrCode5,T1.U_Naration as RowNarration,T0.U_naration as DocumentNarration from OJDT T0
    inner join jdt1 T1 on T0.transid=T1.transid
    inner join nnm1 T2 on T2.series=T0.series
    inner join oact T3 on T3.acctcode=T1.account
    where T3.acctcode='1030101003'
    Regds,
    Sampath

    hi sampath,
    I giving u fair idea how to show g/l account balance
    There is a field in JDT1 - journal entry rows - JDT1.DebCred which is indicator when g/l account
    is debited / credited,it is filled with value D or C.
    You can add Case syntax in existing query with condition  JDT1.DebCred = 'D' then
    JDT1.Debit + Opening/Closing balance and if JDT1.DebCred = 'C' then
    JDT1.Credit - Opening/Closing balance.
    It requires much time & effort to build this query.
    Edited by: Jeyakanthan A on May 14, 2009 3:54 PM

  • How to show delivery date in Bex Analyzer

    Hi Gurus!
    I have to create a report in logistic scenario and my client wants that the report shows a column with the "Scheduled delivery date". I don't know how to show it in a column because in my KF structure, I can't put just this time characteristic.
    Does anybody know how can I solve it?
    Many thanks!

    Hi,
    Create a Formula Variable on Scheduled  DeliveryDate with processing as replacement path, replace variable with InfoObject, replace with Key and use it in the new formula in the columns.
    in this way query designer will accept you to use the char as in column,
    hope it helps you.
    Regards
    Reddy A

Maybe you are looking for