Problem with onload attribute in body tag

hi all,
i have been trying to test alert message boxes in servlets.when i am trying to run the servlet the alert window box doen;t appear (but it appears when i put "hello" inside the alertbrackets.and if i change it to some other text , it never appears.sounds silly , but pleas help me.
please help me out. below is the code:
public class TestApplet extends HttpServlet
     PrintWriter out = null;
     public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException , IOException
          String strAlert = "alert('The userid is already existing.Please select another one')";
          out=res.getWriter();
          res.setContentType("text/html");
          out.println("<html>");
          out.println("<head>");
          out.println("<title>Welcome To Online Stock Market</title>");
          out.println("</head>");
          out.println("<body onload ="+strAlert+">");
          out.println("</body>");
          out.println("</html>");
          out.close();
     public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
          doPost(req, res);
}

Instead of:
out.println("<body onload ="+strAlert+">");
Try this:
out.println("<body onload =\""+strAlert+\"">");
Add two \" around the alert call.

Similar Messages

  • Problem with boolean attribute of JSP tag

    Hi,
    I've being trying to use a custom JSP tag, which has a boolean attribute, declared in the TLD as follows:
    <attribute>
    <name>checked</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>boolean</type>
    </attribute>
    The JSP code snippet is:
    <ui:check checked="<%= myBean.isChecked() %>"/>
    where myBean.isChecked() returns a boolean value (primitive type).
    It works fine on some web containers, but it causes a JSP compilation error on Oracle9iAS 9.0.3 Java Edition, which looks like the following:
    Method toBoolean(boolean) not found in class test. _jsp_taghandler_57.setChecked( OracleJspRuntime.toBooleanObject( toBoolean( myBean.isChecked())));
    After decompiling the container's JSP parser, I found what I think it's a bug. The java class generated by the JSP parser does not define a toBoolean method, and neither do its superclasses. The method is defined on the OracleJspRuntime class! I think the correct code would have to be something like:
    OracleJspRuntime.toBooleanObject(OracleJspRuntime.toBoolean(...))
    If I'm correct, then the "convertExpression" method of the "oracle.jsp.parse.JspUtils" class must be changed, because it outputs such wrong code for not just boolean types, but for all the primitive types.
    So, has anyone ever faced this problem before? Does it have a workaround, or a patch? Is it included on the bug fixes for the 9.0.4 release?
    Thanks!

    Instead of:
    out.println("<body onload ="+strAlert+">");
    Try this:
    out.println("<body onload =\""+strAlert+\"">");
    Add two \" around the alert call.

  • XML to ABAP Problems with many attributes in one Tag (Simple Transform)

    Hi
    i have a XML-Dataset like this. (It's a sample, in originl there are more fields under <Faktura> and more <Faktura>.) My Problem is reading the Attributes.
    <?xml version="1.0" encoding="utf-8"?>
    <Fakturen>
    <Faktura AVnr="123456789" Amt="100" Lang="1" Nr="1209" RechnungsTyp="B" Status="7" Waehrung="CHF" Year="2011" ZahlungsTyp="B"/>
    </Faktura>
    </Fakturen>
    In the Tag "Faktura are many Attributes. How can i read this. I have try this with this code and many other variation. But it does not work.
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
      <tt:root name="FAKTUREN" type="ddic:ZKSO_HRNET_INTERFACE"/>
      <tt:template>
        <Fakturen>
         <Faktura>
          <tt:attribute name="AVNR" value-ref=".FAKTUREN.FAKTURA.AVNR"/>
          <tt:attribute name="AMT" value-ref=".FAKTUREN.FAKTURA.AMT"/>
          <tt:attribute name="LANG" value-ref=".FAKTUREN.FAKTURA.LANG"/>
          <tt:attribute name="NR" value-ref=".FAKTUREN.FAKTURA.NR"/>
          <tt:attribute name="RECHNUNGSTYP" value-ref=".FAKTUREN.FAKTURA.RECHNUNGSTYP"/>
          <tt:attribute name="STATUS" value-ref=".FAKTUREN.FAKTURA.STATUS"/>
          <tt:attribute name="WAEHRUNG" value-ref=".FAKTUREN.FAKTURA.WAEHRUNG"/>
          <tt:attribute name="YEAR" value-ref=".FAKTUREN.FAKTURA.YEAR"/>
         </Faktura>
        </Fakturen>
      </tt:template>
    </tt:transform>
    Thanks for help
    Stefan
    Edited by: Franziska Madl on Mar 2, 2011 2:39 PM

    Hi
    Thank you for your answer. The function module SMUM_XML_PARSE is a good way to Read a XML. Now I have found the Correct way with simple transfer and it  works with an array too.
    many regards
    Stefan
    <?sap.transform simple?>
    <tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">
      <tt:root name="FAKTUREN" type="ddic:ZKSO_HRNET_INTERFACE"/>
      <tt:template>
        <Fakturen>
          <tt:loop ref=".FAKTUREN.FAKTURA">
            <Faktura>
                <tt:attribute name="AVnr" value-ref="AVNR"/>
                <tt:attribute name="Amt" value-ref="AMT"/>
                <tt:attribute name="Lang" value-ref="LANG"/>
                <tt:attribute name="Nr" value-ref="NR"/>
                <tt:attribute name="RechnungsTyp" value-ref="RECHNUNGSTYP"/>
                <tt:attribute name="Status" value-ref="STATUS"/>
                <tt:attribute name="Waehrung" value-ref="WAEHRUNG"/>
                <tt:attribute name="Year" value-ref="YEAR"/>
                <tt:attribute name="ZahlungsTyp" value-ref="ZAHLUNGSTYP"/>
            </Faktura>
          </tt:loop>
        </Fakturen>
      </tt:template>
    </tt:transform>

  • Problem with onload on afh:body?

    Hallo,
    i think in my application afh:body onload="..." don't work.
    i use the following code but it don't work
    <afh:body onload="alert('Test');"> or <afh:body onload="Test();">
    in the second case i have a javascript function named Test.
    what is the problem?
    any help is appreciated.

    Hi,
    I found the reason.
    When adding alert("hello") to the onload property, then the following sorurce code is generated
    <afh:body onload='alert(\"hello\")'>
    Sometimes - and I cannot reproduce it consitently - it generates
    <afh:body onload='alert(\"hello)'>
    Which is invalid JavaScript
    Frank

  • Problem with optional attribute caching on a custom tag

    Hello,
    I've created a tag by extending TagSupport. I have one attribute that is optional. I'm having a problem with this attribute since the tag is cached. If the value is not specified in the tag, it is always using the previous value from the past request.
    I understand why this is happening, but I wonder if there is anyway to reset this value besides doing it at the end of the doStartTag or in the doEndTag methods? I simply want it to be an empty string if it is not in the request.
    Thanks,
    Tim

    Thats abit overkill in my opinion.Probably yes, but its a cleaner option. In case your doEndTag handles custom exceptions, you would anyhow need to put this code in a finally block, right ?
    public int doEndTag() throws JspException {
    try {
    call some methods that throws other checked exceptions;
    }catch(Exception1 e){
    throw JspException(e);
    }catch(Exception2 e){
    //log and ignore
    }finally{
    //clean up here
    return an int;
    Having said that, different containers implement the spec a bit differently. For example, in our project, we use weblogic and for wl, we put our clean up code in the release() method which according to the spec, needs to be called only before gc. Weblogic implementation is a bit different - its called after doEnd() for every use of the tag.
    This is from jsp spec regarding tag life cycle especially with reuse
    Some setters may be called again before a tag handler is reused. For
    instance, setParent() is called if it�s reused within the same page but at a dif-ferent
    level, setPageContext() is called if it�s used in another page, and
    attribute setters are called if the values differ or are expressed as request-time
    attribute values.
    �Check the TryCatchFinally interface for additional details related to exception handling and resource management.
    cheers,
    ram.
    }

  • Very urgent : Problem with field attributes in Datasource

    Hi
    I am getting a problem with field attributes in the datasource.
    The issue came up after i modified the extract structure-i modified one field and
    added one field to the structure.Now those two fields are not visible in BW.
    When i checked with transaction rsa2, i could find that for those two fields , the
    field attribute is <b>'A'</b> which is <b>'Field in OLTP and BW Hidden by SAP'</b>.
    I tried to modify the field attribute to make it visible.Now the issue is that it is not getting reflected after transport in the Q system.What can be the issue.In the Q system its still the old value 'A' ,which makes the fields invisible.
    Please let me know what can be the issue.
    Regards
    Leon

    Hi,
    did you change this attribute via RSA2?
    you need to change your datasource via postprocessing (RSA6); then transport your DS to your Q source system.
    Replicate your datasources in your BW.
    Finally modifiy your Transfer Structure by editing your TRules ( tab Datasource/Tran structure), move your new fields from the right frame to the left frame)
    Maintain your TRules
    Activate
    hope this helps...
    Olivier.

  • JSF with JavaScript ! Problem with OnLoad()

    Hello,
    I have a .js (javascript) file which has one function. I want to call this function in my jsf-jsp page form.
    The javascript run successfully without onload. But when i use onlod it is giving me error like "
    com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: /Webcam.jsp(11,109) Attribute onload invalid for tag body according to TLD
    1. How can i use the onload event with forms or body with jsf ?
    After this, i want to use some if else code with my jsp page. Normally we do this using scriptlets in jsp. So how can i do this on the jsf-jsp. Should i use backing bean to write the same code ?
    Actually i want to invoke different applications based on coditions on the return of my javascrit function.
    Can anybody has tips, solution on this ?
    -Sachin
    EpiComm Technologies Ltd.

    BalusC,
    If we want to set focus to a particular element, then
    this won't work.
    If runScript() function is referring to any form
    element we get an error stating that
    "document..forms.formname.elements is null.
    any ideas how to set focus when the form loads?Then put the script in the bottom of the JSF code, straight before the end body tag. At this place all JSF components are finished with generating.
    <html>
        <head>
        </head>
        <body>
            <f:verbatim>
                <script>
                    setFocus('</f:verbatim><h:outputText value="#{myBean.focusId}" /><f:verbatim>');
                </script>
            </f:verbatim>
        </body>
    </html>

  • OnLoad event on Body tag locked by template

    I have a behavior that needs to be called with an OnLoad event. The page I need it on is attached to a template, so the Body tag is not available for editing. What are my options? Thanks!

    If you are using DW>4 (that's DW4, not DWCS4), then investigate using Template Editable Attributes.
    Alternatively you could use some custom javascript in the editable region of the head of the page or even below the </html> tag to create an onload event, e.g.,
    <script type="text/javascript">window.onload=whatever();</script>

  • XSLT-problem with sequence attributes

    Hi,
    in my XSLT-program (i'm a real newbie!) i'm adding dynamically attributes and their values to a tag, by using the following code :
    <SUPPLIER>
      <xsl:attribute name="FUNLOC">
        <xsl:value-of select="SUPPLIER_FUNLOC" />
      </xsl:attribute>
      <xsl:attribute name="NAME">
        <xsl:value-of select="SUPPLIER_NAME" />
      </xsl:attribute>
      <xsl:attribute name="LOCATION">
        <xsl:value-of select="SUPPLIER_LOCATION" />
      </xsl:attribute>
      </SUPPLIER>
    The problem is that the attributes in the resulting xml-file are alphabetically ordered. For instance :
    <SUPPLIER FUNLOC="9522222" LOCATION="NL" NAME="Test vendor VMOI">
    How can i arrange that the result of the xml-file is a sequence of entrance is taken, so
    <SUPPLIER FUNLOC="9522222" NAME="Test vendor VMOI" LOCATION="NL" >
    regards,
    Hans
    [email protected]

    Hi Hans,
    I think you're using ABAP-XSLT?!
    If you do so, you can solve the sorting problem by using a 1:1 Message mapping after the ABAP-XSLT mapping. This resolves the problem that the nodes are not in the correct order.
    In your interface mapping you have to configure 2 mappings:
    1: ABAP-XSLT
    2: Message mapping.
    Of course this means that the total processing time increases a little bit.
    I had the same problem with the sequence of my (ACC_DOCUMENT) idoc nodes, the ABAP-XSLT screwed up the idoc, but the 1:1 message mapping solved the problem.
    Regards,
    Mark

  • Having a problem with commandButton attribute when i am using it under tabl

    Having a problem with {color:#800000}commandButton {color}{color:#339966}attribute {color}when i am using it under{color:#ff0000} table{color}
    I am using a command button under a table.
    here is the example
    <h:dataTable value="#{wlmHandler.plexes.plexes}" var="{color:#ff0000}onePlex{color}" border="0" cellspacing="0" cellpadding="0" width="100%" border="0">
    <h:column>
    <h:panelGrid border="0" cellpadding="0" cellspacing="0" columns="5">
    <h:commandButton action="" styleClass="tixbutton" value="#{labels.ADD}" onclick="#{onePlex.tran}"/>
    <f:verbatim> </f:verbatim>
    <h:commandButton action="#{createTransaction.transactionCommand}" styleClass="tixbutton"
    value="#{labels.SUBMIT}" actionListener="#{createTransaction.processAction}">
    <f:attribute name="dbName" value="#{wlmHandler.dbName}"/>
    <f:attribute name="plexName" value="{color:#ff9900}#{onePlex.name}"{color}/>
    </h:commandButton>
    </h:panelGrid>
    <h:/column>
    </h:dataTable >
    when i am using this plex name atribute it is giving nullPointerException
    {color:#ff9900}this value #{onePlex.name} i cant able to access inside the command button{color}

    balu i have tried by seeing u r blog.
    this is my structure of tables
    plexes (if i iterate plexes table gives plex object)
    |
    ------ plex (plex table gives transaction object)
    |
    ------transactions(transactions table gives transaction table)
    |
    here i will have a command link to this link i have to pass the plex name which
    will come from
    i tried in this command action with HTMLDataTable getRowData()
    i am not getting the selected row data .i am downcasting this getRowData() to plex.

  • Problem with errorPage in page directive tag while proxying request from iPlanet to WebLogic

              Hi,
              We are using iPlanet 4.0 as the webserver and WebLogic 5.1 as the application server on different solaris machines. We have put our JSPs in the weblogic application server and proxy the requests from iplanet to weblogic.
              We are facing a problem with the errorPage in the 'Page Directive' tag of the JSP. We have given xxx.jsp as an 'errorpage' parameter in the page directive tag. If we directly access the JSP from the WebLogic, and there is an system error, the error page specified in the JSP is getting displayed. But if we access the JSP from iPlanet and there is an system error, instead of displaying the error page, iPlanet is asking whether we want to download the file. If we say yes it downloads the actual JSP code itself. We have defined the mime types in obj.conf file as well as mime.types for the iPlanet.
              If anyone knows how this can be solved, it would be of great help
              Regards,
              Krish
              

    How did you configure the obj.conf file? proxy by mime type or ppath? It
              seems errorPage.jsp was not proxyed and treated as a unknown mime type.
              Krishnaraja <[email protected]> wrote in message
              news:3a372d79$[email protected]..
              >
              > Hi,
              >
              > We are using iPlanet 4.0 as the webserver and WebLogic 5.1 as the
              application server on different solaris machines. We have put our JSPs in
              the weblogic application server and proxy the requests from iplanet to
              weblogic.
              >
              > We are facing a problem with the errorPage in the 'Page Directive' tag of
              the JSP. We have given xxx.jsp as an 'errorpage' parameter in the page
              directive tag. If we directly access the JSP from the WebLogic, and there is
              an system error, the error page specified in the JSP is getting displayed.
              But if we access the JSP from iPlanet and there is an system error, instead
              of displaying the error page, iPlanet is asking whether we want to download
              the file. If we say yes it downloads the actual JSP code itself. We have
              defined the mime types in obj.conf file as well as mime.types for the
              iPlanet.
              >
              > If anyone knows how this can be solved, it would be of great help
              >
              > Regards,
              > Krish
              

  • Problem with rendered attribute in jhs 10.1.3.3

    We are currently trying to migrate our applications from jhs 10.1.3.2.52 to jhs 10.1.3.3.87 using jdeveloper 10.1.3.5. We are facing a problem with all the detail groups structured inside detail group regions - they have all disappear from the pages.
    In my example code i have two master-detail groups Products (Master) and ExpertiseAreas (Detail) on the same page:
    Products - Group
    -> ExpertiseAreasDtl - Detail Group Region
         -> ExpertiseAreas - Group (Samepage="true")
    The problem is that the detail group ExpertiseAreas is not rendered on the page.
    As i looked in through the pages generated by the 2 different releases of jhs using the same app definition, i can see the following:
    CODE GENERATED FOR THE ExpertiseAreasDtl Detail Group Region (all the vms used are the default):
    in jhs10.1.3.3.87:
    <af:panelGroup *rendered="#{(ProductsIterator.currentRow!=null and ProductsIterator.findMode!='true')}"* id="ProductsRegionsExpertiseAreasDtlPanelGroup">
    in *jhs 10.1.3.2. 52*:
    <af:panelGroup id="ProductsRegionsExpertiseAreasDtlPanelGroup">
    First of all a rendered attribute is being generated in the new version of jhs and not in the old.
    The real problem seems to be with the iterator binding generated from verticalRegionContainer.vm in the regular expression: "#{(ProductsIterator.currentRow!=null and ProductsIterator.findMode!='true')}". It should have been *bindings.*ProductsIterator and not plain ProductsIterator. Has anybody got any ideas on how to solve the problem?
    Thanks
    Giorgos
    Edited by: user647567 on 17 Δεκ 2009 2:16 πμ
    Edited by: user647567 on 17 Δεκ 2009 5:58 πμ

    Giorgos,
    We have uploaded a new service update, 10.1.3.3.88, on the cso.oracle.com site. This should fix your issue.
    Steven Davelaar,
    JHeadstart Team.

  • Problem with keeping attributes updated

    We have a problem with the server model in Designer.
    We have made a E/R diagram and genereted it to a server model diagram. Afterwards we want to delete some attributes which we delete back in the E/R program. Then we make some new attributes instead and generate a new server model diagram but the attributes which we have deleted in the E/R diagram is still present in the new server model diagram. The new attributes are there too. It is like the server model diagram only updates the new attributes, but doesn't delete the old, wrong, attributes.
    What can we do to solve the problem?

    Hi,
    DDT will modify the attributes values (datatype, size etc.) on the target tables.
    DDT doesn't drop the column if its corresponding attribute is deleted in ERD.
    However we can achieve this by deleting the table definition from DE and then executing the DDT on the new/modified Entity.
    Regards,
    Wilson.

  • APEX - Problem with column attributes - Simple Checkbox

    Hi,
    I've a problem with one of my report.
    select * from (
    SELECT
    APEX_ITEM.CHECKBOX(2,audsid,'UNCHECKED') KILL,
    INST_ID,
    AUDSID,
    SID,
    I changed the attributes one of the column in report to Simple Checkbox. Display is working fine and I see correctly checkbox inside the column, but when I trying to trigger process which is based on that column, I'm getting below error:
    wwv_flow.accept: SIGNATURE (parameter names) MISMATCH
    VARIABLES IN FORM NOT IN PROCEDURE: F01_NOSUBMIT
    NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:
    Process code looks like below:
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F02.count
    LOOP
    rec_audsid := APEX_APPLICATION.G_F02(i);
    stmt...
    stmt...
    Could you pls help me with this? How I can submit correctly data to my process from that Simple Checkbox item?
    Thank in advance for help.
    Regards
    Mariusz
    Edited by: user8763881 on 17-Aug-2010 08:12
    Edited by: user8763881 on 17-Aug-2010 08:12
    Edited by: user8763881 on 17-Aug-2010 08:12

    Hi Marc,
    I am trying to use this simple check box to update records in a tabular form that is created through tabular form wizard.
    Now as what you said I included one more column in the tabular form sql query for my check box column.
    Lets say, if my table column name is sent_msg_ind then I have this included as below
    select sent_msg_ind, --hidden
             sent_msg_ind as sent_msg_ind_no_submit --simple check box
    from table_x;Now how to propogate the value of simple check box(1 - checked and 0 - unchecked) value into hidden field.
    I am using this tabular form to just update the records based on what is being fetched using the primary key from the previous page.
    Any example or demo would be highly appreciated here.
    Thanks,
    Teku
    Edited by: Teku on May 19, 2011 10:05 AM

  • Problem with settype, attribute and DDIC COMT_PROD_MAT_MAINTAIN_API

    Hello,
    I want to implement the BADI IDSSI_DISPLAY_TO_POD in CRM. The OSS Note number 573078 specify the code that must be integrated in the program of implementation of this BADI.
    I want to insert a specifical set type with several attributes.
    Before using the set type in my program, i have to transport this set in order to assure that the fields of this new set type would be include in the structure DDIC COMT_PROD_MAT_MAINTAIN_API. I did it.
    There is my problem : in the generated code of the OSS Note, there is :
    ISU_CUST01_TAB = SETTYPE-ISU_CUST01.
    with :
    SETTYPE a table like structure COMT_PROD_MAT_MAINTAIN_API
    ISU_CUST01_TAB TYPE ISU_CUST01_MAINT_T,
    ISU_CUST01 TYPE ISU_CUST01_MAINTAIN
    After creating settype, I verify that ISU_CUST01_MAINT_T and ISU_CUST01_MAINTAIN exist. this structure are generated when creating a settype.
    during the control of the program, I obtain this message :
    Field ISU_CUST01 can't be found in table settype.
    I don't understand how I can use my settype, like it is specified in the OSS Note.
    I will appreciate any help about this topic.
    Regards,
    Vincent UNGER

    Hi ,wyee .
       I  do it but not through your FMs , i think you can do it by the FM :
    create/change the material  CALL FUNCTION 'COM_PRODUCT_MAINTAIN_MULT_API'  
    IMPORTING  
       ET_BAPIRETURN  = LT_RETURN[]   
    CHANGING  
       CT_PRODUCT     = LT_PRODUCT
       EXCEPTIONS  
       INTERNAL_ERROR = 1     
       OTHERS         = 2.
    This FM can create or  change the material in the crm ,and can maitain data except conditions , like basic data ,like relationship .

Maybe you are looking for

  • Please help dont know what to do send it or keep it

    guys i need help when ever i turn on and off my ipod i always hear a popping sound in my head phones i tried other headphones but same problem and then suddenly the volume of the headphone that came with my ipod suddenly changed like the volume isnt

  • How to remove obsolete parameters in oracle

    hi, can anyone tell me how to delete a obsolete parameter in oracle,wat are the steps to follow or is there any command Thanks renjy

  • Trouble with swipe gesture in Mac OS X Lion.

    Hello everyone, I updated my mac yesterday with Lion. I was so looking forward to the upgrade, however I have stumbled on a problem ever since I upgraded. The swipe gesture isn' t working correctly for me. I look at the WWDC 2011 and I checked youtub

  • Flash Archive HTTP retrieval method

    Hello, could anybody explain me why size restriction is there for HTTP flash method for flar archives? HTTP method can be used only for archives < 2GB. I would like to know why and how to split an archive > 2 GB. Thanks a lot for every reply.

  • Setting principle in request object

    hi i came to know that i need to keep the principle object in request object to make the configured role availble to be acessible by web container to map with the roles provided in the web.xml could any body help me letting knwo how cani keep the pri