Multiple function signatures in .tag file

I'm writing a jsp .tag file and I've encountered the following problem. I have those two functions :
private void iterateThroughChildElements(Element element)
     for (Iterator i = question.getElements().iterator(); i.hasNext(); )
          this.parseAndDisplay( (Element) i.next() );
private void parseAndDisplay(Question question)
private void parseAndDisplay(Answer question)
(......)Both Answer and Question objects are elements but I get an error from the compiler which says that no correct signature was found for the parseAndDisplay function.
What could be the problem ? Do I have to cast the objects according to a instanceof comparaison ??

Both Answer and Question objects are elements but I
get an error from the compiler which says that no
correct signature was found for the parseAndDisplay
function.The compiler is borking with the following line this.parseAndDisplay( (Element) i.next() ); You are telling it you are passing an (Element) but you have only implemented the specific function for (Question) and (Answer).
What could be the problem ? Do I have to cast the
objects according to a instanceof comparaison ??Use polymorphism and add the function
private void parseAndDisplay((Element) element) {
element.parseAndDisplay() ;
}Then move the parse and display functionality from this class into the similar named functions in the Question and Answer classes.

Similar Messages

  • Multiple function signatures in JSP custom tag file

    I'm writing a jsp .tag file and I've encountered the following problem. I have those two functions :
    private void iterateThroughChildElements(Element element)
         for (Iterator i = question.getElements().iterator(); i.hasNext(); )
              this.parseAndDisplay( (Element) i.next() );
    private void parseAndDisplay(Question question)
    private void parseAndDisplay(Answer question)
    (......)Both Answer and Question objects are elements but I get an error from the compiler which says that no correct signature was found for the parseAndDisplay function.
    What could be the problem ? Do I have to cast the objects according to a instanceof comparaison ??

    There was an error in my code, it is as follows :
    private void iterateThroughChildElements(Set elements)
         for (Iterator i = elements.iterator(); i.hasNext(); )
              this.parseAndDisplay( (Element) i.next() );
    }

  • Multiple digital signatures in one file

    I have a client who wants me to combine 4 different forms into one--then--require a digital signature by the same person after each independent form. So that would be 4 digital signatures total. And all identical. I'm using a different name per each field so there's no conflict.
    It appears to work fine until I have it submit dynamically with a PHP script via email inbox.
    When I open the PDF (having crunched the info back in from an FDF) the data is there EXCEPT the digital signatures.
    Can someone point me to a tutorial?
    Best regards,
    Mare

    Hi Mare,
    You cannot merge files and expect that the digital signatures will be preserved. When you sign a file you are signing all of the bytes in that file, and only that file. Once you combine files you are creating a new unsigned file. If someone were to sign the new file they are signing all of the bytes in the new file, not just some of the bytes. There is no "page level" signing in PDF files, only whole file signing.
    You can however put the signed files into a Portfolio file. A Portfolio keeps the files separate. Think of a Portfolio like a file cabinet in the physical world. Just because you put different files into the file cabinet drawer, they don't merge.
    Steve

  • How to properly handle Exception thrown in a .tag file?

    I've got a .jsp file that makes use of some custom tags, each defined in their own .tag file, and located in WEB-INF/tags. I'm having a lot of trouble with the scenario of cleanly dealing with an exception raised by scriptlets in either a .jsp file, and a .tag file. I'm using both Java and Tomcat 6....
    Originally, I wanted to use .tag files in order to componentize common elements that were present in .jsp pages, as well as move ugly scriptlets out of .jsp pages, and isolate them in tag files with their associated page elements.
    Things started getting hairy when I started exploring what happens when an exception is thrown (bought not handled) in a scriptlet in a .tag file. Basically, my app is a servlet that forwards the user to various .jsp pages based on given request parameters. The forwarding to the relevant .jsp page is done by calls to the following method:
    servletContext.getRequestDispatcher("/" + pageName).forward(request, response);
    Where 'pageName' is a String with the name of the .jsp I want to go to...
    Calls to this method are enclosed in a try block, as it throws both a ServletException, and IOException...
    When either my .jsp, or .tag throw an exception in a scriptlet, the exception is wrapped in a JSPException, which is then wrapped in a ServletException.
    I can catch this exception in my servlet... but then what? I want to forward to an error page, however, in the catch block, I can't forward in response to this exception, as that results in an IllegalStateException, as the response has already been committed. So what do I do? How do I get from this point, to my "error.jsp" page?
    It was suggested to me that I use the <% @ page isErrorPage="true" %> directive in my error.jsp,
    and the in my real .jsp, use <%page errorPage="/error.jsp" %>.
    This works great when the exception is thrown in my .jsp.... But when the exception is thrown in the .tag file... not so much...
    My .jsp page was rendered up until the point where the <my:mytag/> (the tag with the offending raised exception) was encountered. Then, instead of forwarding to the error page when the error in the tag is encountered, the error page is rendered as the CONTENT of of my TAG. The rest of the .jsp is then NEVER rendered. I checked the page source, and there is no markup from the original .jsp that lay below the my tag. So this doesn't work at all. I don't want to render the error page WITHIN the half of the .jsp that did render... Why doesn't it take me away from the .jsp with the offending tag altogether and bring me to the error.jsp?
    Then it was suggested to me that I get rid of those page directives, and instead define error handling in the web.xml using the following construct:
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/error</location>
    </error-page>
    <error-page>
    <error-code>404</error-code>
    <location>/error</location>
    </error-page>
    For this, I created a new servlet called ErrorServlet, and mapped it to /error
    Now I could mangle the end of the URL, which causes a 404, and I get redirected to the ErrorServlet. Yay.
    However, exceptions being thrown in either a .jsp or .tag still don't direct me to the ErrorServlet. Apparently this error handling mechanism doesn't work for .jsp pages reached via servletContext.getRequestDispatcher("/" + pageName).forward(request, response) ????
    So I'm just at a total loss now. I know the short answer is "don't throw exceptions in a .jsp or .tag" but frankly, that seems a pretty weak answer that doesn't really address my problem... I mean, it would really be nice to have some kind of exception handler for runtime exceptions thrown in a scriptlet in .tag file, that allows me to forward to a page with detailed stacktrace output, etc, if anything for debugging purposes during development...
    If anyone has a few cents to spare on this, I'd be ever so grateful..
    Thanks!!
    Jeff

    What causes the exception?
    What sort of exception are you raising from the tag files?
    Have you got an example of a tag file that you can share, and a jsp that invokes it so people can duplicate the issue without thinking too much / spending too much time?
    My first instinct would be that the buffer is being flushed, and response committed before your Exception is raised.
    What you describe is pretty much standard functionality for Tomcat in such cases.

  • BAPI_PO_CREATE1 not able to create PO's for multiple rows from the flat fil

    Hi
    i am uploading PO's from a flat file into SAP using the BAPI_PO_CREATE1. Everything works fine if the flat file hast only one record.
    if the flat file has more than one record then while loading the second record the BAPI returns a error message. I am calling the BAPI in a loop.
    The strange thing is that if i load the second record individually the program is able to create the PO. So only when i have multiple records in the flat file i am unable to load the PO into SAP. I debugged and checked all the internal tables passed to the BAPI. All seems to have the data correctly but still the BAPI fails.
    any idea where i am going wrong?
    the code looks something like this.
    LOOP AT HEADER_ITAB.
       PERFORM FILL_HEADER_RECORDS.
    LOOP AT ITEM_ITAB WHERE EBELN eq HEADER_ITAB-EBELN.
         PERFORM FILL_ITEM_RECORDS.
    ENDLOOP.
      PERFORM CERATE_PO_VIA_BAPI.
    ENDLOOP.

    What is the error message. Are you trying something like this:
        LOOP AT T_DATA1.
          AT NEW LIFNR.
            READ TABLE T_DATA1 INDEX SY-TABIX.
            PERFORM INIT_TABLES.
            PERFORM FILL_DATA.
    --Call the BAPI to create PO
            PERFORM CREATE_PO.
          ENDAT.
        ENDLOOP.
    FORM CREATE_PO .
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          POHEADER                     =   POHEADER
          POHEADERX                    =   POHEADERX
        POADDRVENDOR                 =
        TESTRUN                      =
        MEMORY_UNCOMPLETE            =
        MEMORY_COMPLETE              =
        POEXPIMPHEADER               =
        POEXPIMPHEADERX              =
        VERSIONS                     =
        NO_MESSAGING                 =
        NO_MESSAGE_REQ               =
        NO_AUTHORITY                 =
        NO_PRICE_FROM_PO             =
       IMPORTING
         EXPPURCHASEORDER             =  EXPPURCHASEORDER
         EXPHEADER                    =  EXPHEADER
         EXPPOEXPIMPHEADER            =  EXPPOEXPIMPHEADER
       TABLES
         RETURN                       =  RETURN
         POITEM                       =  POITEM
         POITEMX                      =  POITEMX
        POADDRDELIVERY               =
         POSCHEDULE                   =  POSCHEDULE
         POSCHEDULEX                  =  POSCHEDULEX
         POACCOUNT                    =  POACCOUNT
        POACCOUNTPROFITSEGMENT       =
         POACCOUNTX                   =  POACCOUNTX
        POCONDHEADER                 =
        POCONDHEADERX                =
         POCOND                       =  POCOND
         POCONDX                      =  POCONDX
        POLIMITS                     =
        POCONTRACTLIMITS             =
        POSERVICES                   =
        POSRVACCESSVALUES            =
        POSERVICESTEXT               =
        EXTENSIONIN                  =
        EXTENSIONOUT                 =
        POEXPIMPITEM                 =
        POEXPIMPITEMX                =
        POTEXTHEADER                 =
          POTEXTITEM                   = POTEXTITEM
        ALLVERSIONS                  =
         POPARTNER                    =  POPARTNER
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT   = 'X'
        IMPORTING
          RETURN = RETURN1.
      DATA: L_NAME TYPE LFA1-NAME1.
      CLEAR L_NAME.
      SELECT SINGLE NAME1
               FROM  LFA1
               INTO L_NAME
               WHERE LIFNR = POHEADER-VENDOR.
      LOOP AT RETURN.
        WRITE : / RETURN-TYPE,
                  RETURN-ID,
                  RETURN-MESSAGE.
        WRITE : '--> For vendor:',
                 POHEADER-VENDOR,
                 L_NAME.
      ENDLOOP.
    ENDFORM.                    " CREATE_PO

  • Excel 2010 - Multiple Digital Signatures?

    How would you add multiple digital signatures to an Excel 2010 workbook?

    Hi,
    To add multiple digital signatures, we need to  create the signatures first.
    Then please refer to the following steps:
    Click the File tab.
    Click Info.
    Under Permissions, click Protect Document,
    Protect Workbook or Protect Presentation.
    Click Add a Digital Signature.
    Read the Word, Excel, or PowerPoint message, and then click OK.
    In the Sign dialog box, in the Purpose for signing this document box, type the purpose.
    Click Sign.
     Check the following MS link for additional information.
    http://office.microsoft.com/en-us/excel-help/add-or-remove-a-digital-signature-in-office-files-HA010354308.aspx
    Regards,
    George Zhao
    TechNet Community Support

  • Form Size issue with multiple Digital Signatures

    I have created a form (liveCycle 8) with multiple digital signatures required.  When each user signs the form, that section of the form is locked using collections.  The form is workflow through email after each user signs it.  Each time the user signs and forwards the form, the form's size becomes too large.
    How can the form be optimized to compress each time an users signs the form?
    Thank you,
    Lori

    Steve,
       After your request to post the form, I wanted to removal some company items like the Logo.  Once I removed the Logo, I found the biggest issue was a Logo image size that was making the file so large.  Once I reduced the image size, the signatures only added 46kb at each signature level.
    Thank you for your help,
    Lori

  • WLS does not handle reusable jar with tag-files?

    I want to encapsulate some tag-files in a re-usable jar that can be included in multiple applications. According to all the documentation that I've found what I need to do is create a jar file containing:
    META-INF/taglib.tld
    META-INF/tags/myTag.tag
    where the taglib.tld contains (among other things):
    <uri>myTag</uri>
    <tag-file>
    <name>someName</name>
    <path>META-INF/tags/myTag.tag</path>
    </tag-file>
    Then I am supposed to take that jar file and put it in my web application under WEB-INF/lib,
    and in my index.jsp I can refer to <%@taglib prefix="myt" uri="myTag">
    However when I do this (on wls 12c) the application seems to deploy ok but when I try to access index.jsp I get:
    weblogic.servlet.jsp.CompilationException: Failed to compile JSP /index.jsp
    index.jsp:14:4: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.
    <%@taglib prefix="tags" uri="myt" %>
    Related facts:
    1. When I deploy these projects in Glassfish it works . as I expected based on the documentation with no errors.
    2. If I copy the tag files and tld with no modification directly into the web application as:
    <my web app>/WEB-INF/taglib.tld
    and <my web app>/META-INF/tags/myTag.tag
    then it does work. However, that prevents me from packaging the tag-files as a re-usable jar.
    (Facts 1 & 2 seem to imply that the files are correct and that WebLogic is not handling the jar correctly?)
    3. I've seen suggestions that there needs to be a <taglib> entry in web.xml. I have tried this and...
    - the text I've seen on the web generates an error. It seems to need to be within a <jsp-config> entry in web.xml.
    - even with this I still get the same error.
    Does anyone have a suggestion for how to get Weblogic to handle tag-files inside a re-usable jar?
    Do you have an example jar you can point me to just to see that it works on my system?
    Is there some special configuration needed by Weblogic to tell it to handle this construct?
    And finally, the error message is saying that one of two things is wrong:
    Either:
    A) it cannot find the referenced taglib file, or
    B) the tld file failed to compile.
    Is there any way for me to find out which of these is happening? The error messages in WLS do not seem to give any more info, so I cannot easily distinguish between these possibilities.
    Thanks for your assistance.

    After 3 days of seeing this error, immediately after posting this request the problem disappeared. Sigh.
    So for now this problem is closed. If it comes back I'll re-post.

  • How to call a function in one .js file from another .js file

    Hello Techies,
    I am trying to call a function in two.js file from one.js file.
    Here is my code
    one.js
    <script>
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
         function one()
                        var a;
                       two(a);
              }two.js
                  function two(a)
                          alert("two");
                      }But the function two() is not working.
    How can I do this one??
    regards,
    Krish

    I think there is a syntax error in line
    document.write("<script type='text/javascript' src='/htmls/js/two.js'> <\/script>");
    end tag <\/script> is wrong.

  • Digital Signature on Original File

    Hi Friends,
    I have a requirement which I am explaining below:
    There are various status for a document and workflow is triggered for each status.  I want to add the Diginal signature of person after he approves / select the status for that document thru workflow on Original file.
    If there are multiple pages on the original file I want to add the Diginal signature of person on each page. And also I want to put stamp on below the signature on each page.
    Can it be possible. If so Pls. let me know how to do or where can I get the material.
    Regards,
    Sai Krishna

    Hi Sai Krishna,
    Yes, both your requirements are feasible to achieve in SAP DMS but via different approaches.
    1. For implementing digital signature, the steps are as follows:
    Configuration section:SPRO>Reference IMG>CA Components>Approval
    -Define individual authorization group
    -Define individual signatures
    -Define signature strategy
    -Define individual signatures to the above signature strategy
    -Define signature sequence(if there are more than 1 group involved for approval)
    -Define users and restrictions(signature assigned to relevant users)
    -Define document status(of document type) or which signature strategy must come into effect
    NOTE: Digital signature is status driven(hence its not possible to have it for each original part as desired by you)
    2. For implementing stamp feature
    Stamp feature is part of 'Redlining Tools' suite.You may add stamp by clicking on the stamp icon in Redlining Tools section of a original(in the edit mode). Provide the necessary details that you need to appear in the stamp. After creating the stamp, from the Favorites section choose the stamp needed and insert the same onto the original drawing.
    Hope this helps.
    Regards,
    Pradeepkumar Haragoldavar
    Edited by: Pradeepkumar  Haragoldavar on May 31, 2010 7:39 AM

  • Multiple Email Signatures

    I use my iPhone for both work and personal email. It would be helpful to support multiple email signatures so you can associate the appropriate signature with the appropriate email account. This is functionality that the BlackBerry supports! Currently it looks like you can only have one signature and it applies to all email accounts. I'd even be happy if you could have one signature but it only gets applied to one email account.

    You can submit feedback to Apple: http://www.apple.com/feedback/iphone.html

  • Consolidate Multiple Digitial Signatures into one Document

    I have one document that I am sending out to multiple people at the same time. I need these people to digitally sign this document concurrently. Once they sign the document, it is sent back to me. Which causes me to have multiple copies of the same document, but with different signatures. I need to then consolidate these multiple documents into one document with all of the signatures. I've been attempting to do this with distributing the document and then merging the document but it is not working. Can someone please help?

    Hi,
    Acrobat does not support parallel signing where multiple people can concurrently sign one document. A document can only be signed sequentially where one person signs it and then sends it to the next person for signing.  If you have one document that requires multiple signatures and you need all of the signatures on one page, then you have to work with just one copy. However, working with multiple copies of the document like you are doing now, you could consolidate each signed copy into a Portfolio. If for example you needed 10 signatures your Portfolio file would end up containing 10 individually signed copies of the same PDF file.
    The bottom line is you cannot merge the signed files into a single pdf.
    I hope this helps,
    Steve

  • Read, Write and other functionality on Acrobat reader file

    Hi,
    What are the functions that can be done on Acrobat file using C#.net Programming.
    Can we add E-Signature to Acrobat file through C# Programming? and do other operations.
    Can u suggest the links for sample program.
    I came to know with Adobe Reader we can't do operations on PDF document. we requires Adobe Acrobat Standard or Professional. is it true?
    Your suggestions requested

    Thanks for your reply.
    I have gone through some on example given in SDK.
    out of four "BasicIacCS", "BasicIacOCXCS", "FillFormCS", "JSObjectControlCS" in SDK samples,  only "BasicIacOCXCS" is working.
    remaining projects throws error "Retrieving the COM class factory for component with CLSID"
    I have only installed Acrobat Reader, do we require full Adobe Version?

  • Custom function in custom tag

    I'm created a .tag file and attempted to call a custom function. The custom function works fine in a .jsp file, but it doesn't work in the .tld. The jstl functions work in the .tag files.
    I assume my config is ok b/c my functions are working in the .jsp files fine. Any ideas?
    Thanks,
    Mike

    There was an error in my code, it is as follows :
    private void iterateThroughChildElements(Set elements)
         for (Iterator i = elements.iterator(); i.hasNext(); )
              this.parseAndDisplay( (Element) i.next() );
    }

  • JSP 2.x - Tag files with body-content="JSP"

    I've been looking at the JSP 2.1 draft and see that, as with the previous JSP release, it is not allowed for tag-files to have body-content="JSP". I've tried to find a good answer for that on the web, but there's no one who can enlighten me. I've tried to tweak the source of Apache Tomcat 6.0.13 (Validator.ValidateVisitor and TagFileProcessor.TagFileDirectiveVisitor, both in org.apache.jasper.compiler) to accept body-content="JSP" in tag files - with great success. It is possible to have scriptlets within tags from tag files and it works as expected.
    My reason for wanting scriptlets in the body-content of tags from tag files is that it would encourage a more contextual, nested (and in my eyes, a more beautiful) structure of JSP-pages, as opposed to the JSTL flat structure, where f.ex. the sql:query tag does not reside within a sql:setDataSource tag, but instead refers to the datasource through an EL-variable. I suppose that it has been constructed in this way only to make it possible for programmers to include scriptlets in-between sql:query tags that use the same datasource.
    Not that it is not possible to nest tag-file tags, but I suspect that many programmers then would like to keep a flat structure so as to maintain the possibility of inserting scriptlets where needed - outside any tag which is based on a tag-file.
    So, why is it not allowed for tag-files to have body-content="JSP"?

    Thanks for the reply, evnafets.
    I'm aware that scriptet-code is generally being discouraged, although I don't understand why. I think that having a standard tag-library is a wonderful idea, but in the case of JSTL, I'm not that pleased. It relies heavily on EL, which I see as an unnecessary abstraction.
    Let me give you an example. The JSTL does database-connections and queries in this way:
    <sql:setDataSource var="datasource" url="jdbc:oracle:thin:@localhost:1521:TEMP" driver="oracle.jdbc.OracleDriver" user="scott" password="tiger" />
    <sql:query sql="SELECT * FROM EMP" dataSource="datasource" var="resultset" />This could also be accomplished without EL in a hierarchical structure:
    <sql:dataSource url="jdbc:oracle:thin:@localhost:1521:TEMP" driver="oracle.jdbc.OracleDriver" user="scott" password="tiger">
      <sql:query sql="SELECT * FROM EMP">
        BodyContent <% perhapsWithScriptlets; %>
      </sql:query>
    </sql:dataSource>...using TagSupport.findAncestorWithClass for the query to reference the datasource which it is enclosed in. (in Tomcat, the class would be called dataSource_tag. BTW, why is this not standardised in JSP?)
    I would then also like to be able to use scriptlet-code inside the tags as I could if the tags were written as tag-classes, extending BodyTagSupport, and being defined in a formal, cumbersome TLD file.
    Why the difference in functionality between SimpleTagSupport and BodyTagSupport - or rather; why is it then not possible to specify that a tag-file should extend BodyTagSupport rather than SimpleTagSupport?

Maybe you are looking for