CommandButton actions not getting called when "disabled" element present

MyObjectForm.jsp contains commandButtons for "add", "update" and "delete" that are enabled/disabled according to the value of the bound id field.
MyObjectForm.jsp
<html>
<body>
<f:view>
<h:form id="create">
<h:inputHidden id="id" value="#{myObjectBean.id}" />
<h:panelGrid columns="3" border="0">
Name: <h:inputText id="name"
requiredMessage="*"
value="#{myObjectBean.name}"
required="true"/>
<h:message for="name"/>
// other fields
<h:commandButton id="add"
value="Add" disabled="#{myObjectBean.id!=0}"
action="#{myObjectBean.add}"/>
<h:commandButton id="update"
value="Update" disabled="#{myObjectBean.id==0}"
action="#{myObjectBean.update}"/>
<h:commandButton id="delete"
value="Delete" disabled="#{myObjectBean.id==0}"
action="#{myObjectBean.delete}"/>
<h:commandButton id="delete2"
value="Delete (no disabled element)"
action="#{myObjectBean.delete}"/>
</h:form>
</f:view>
</body>
</html>In its managed bean, MyObjectBean, if an id parameter is found in the request, the record is read from the database and the form is populated accordingly in an annotated @PostConstruct method:-
MyObjectBean.java
public class MyObjectBean {
private int id;
/** other properties removed for brevity **/
public MyObjectBean() {
LOG.debug("creating object!");
@PostConstruct
public void init() {
String paramId = FacesUtils.getRequestParameter("id");
if(paramId!=null && !paramId.equals("")){
getById(Integer.parseInt(paramId));
LOG.debug("init id:"+id);
}else{
public String delete(){
LOG.debug("delete:"+id);
MyObjectVO myObjectVO = new MyObjectVO();
ModelUtils.copyProperties(this, myObjectVO);
myObjectService.removeMyObjectVO(myObjectVO);
return "";
public String add(){
LOG.debug("add");
MyObjectVO myObjectVO = new MyObjectVO();
ModelUtils.copyProperties(this, myObjectVO);
myObjectService.insertMyObjectVO(myObjectVO);
return "";
public String update(){
LOG.debug("update:"+id);
MyObjectVO myObjectVO = new MyObjectVO();
ModelUtils.copyProperties(this, myObjectVO);
myObjectService.updateMyObjectVO(myObjectVO);
return "";
public void getById(int id){
MyObjectVO myObjectVO= myObjectService.findMyObjectById(id);
ModelUtils.copyProperties(myObjectVO, this);
/** property accessors removed for brevity **/
}When no parameter is passed, id is zero, MyObjectForm.jsp fields are empty with the "add" button enabled and the "update" and "delete" buttons disabled.
Completing the form and clicking the "add" button calls the add() method in MyObjectBean.java which inserts a record in the database. A navigation rule takes us to ViewAllMyObjects.jsp to view a list of all objects. Selecting an item from the ViewAllMyObjects.jsp list, adds the selected id to the request as a paramter and a navigation rule returns us to MyObjectForm.jsp, populated as expected. The "add" button is now disabled and the "update" and "delete" buttons are enabled (id is no longer equal to zero).
Action methods not getting called
This is the problem I come to the forum with: the action methods of commandButtons "update" and "delete" are not getting called.
I added an extra commandButton "delete2" to the form with no "disabled" element set and onclick its action method is called as expected:-
commandButton "delete2" (no disabled element) - works
<h:commandButton id="delete2"
value="Delete (no disabled element)"
action="#{myObjectBean.delete}"/>Why would "delete2" work but "delete", not?
commandButton "delete" (disabled when id is zero) - doesn't work
<h:commandButton id="delete"
value="Delete" disabled="#{myObjectBean.id==0}"
action="#{myObjectBean.delete}"/>The obvious difference is the "disabled" element present in one but not the other but neither render a disabled element in the generated html.
Am I missing something in my understanding of the JSF lifecycle? I really want to understand why this doesn't work.
Thanks in advance.
Edited by: petecknight on Jan 2, 2009 1:18 AM

Ah, I see (I think). Is the request-scoped MyObjectBean instantiated in the Update Models phase? If so then the id property will not be populated at the Apply Request Values phase which happens before this, making the commandButton's disabled attribute evaluate to true.
Confusingly for me, during the Render Response phase, the id property is+ set, so the expression is false (not disabled) giving the impression that the "enabled" buttons would work.
So, is this an flaw in my parameter passing and processing code or do you see a work around?

Similar Messages

  • Shutdown hook not getting called when running tomcat as a service

    I have a shutdown hook as part of a lifecycle <Listener> tomcat6 class, which gets created and registered in the class's constructor (class is referenced in the server.xml). The hook gets called during shutdown when tomcat has been started from a shell, but not when tomcat has been installed as a service. The -Xrs flag doesn't make a difference either way. I am running java 6u12 server VM (haven't tried client) and prior versions. Does anyone have any ideas? This has been tested by starting/stopping from the Control Panel, and also with 'tomcat6 //TS/ServiceName' (i.e. in test mode)
    One possibility is that tomcat internally calls Runtime.halt(), but the shutdown process appears to be normal and the same with either scenario. The other possibility is that the JVM has an issue. The tomcat user groups don't have anything to offer.
    Thoughts?
    tia

    sanokistoka wrote:
    jschell wrote:
    sanokistoka wrote:
    Let me ask the last question in a better way: Does anyone have any GOOD ideas?Get back to us when you have found your good solution.Stop wasting bandwidth. I didn't post here to be a smart ars like you and pretend that I have a solution to a rare problem... FYI - the workaround is to use the tomcat lifecycle events (AFTER_STOP_EVENT) to achieve the same - why do you think I mentioned it's a tomcat listener in the first place? Feel free to educate me.
    So you are claiming that Runtime.getRuntime().addShutdownHook() that you posted in the above is not part of the java API?
    Or perhaps that everything that is added via addShutdownHook() runs?
    Surely you are not claiming that it isn't calling addShutdownHook() in the first place?
    Get a life and a job.I have both but thanks for the concern.
    sanokistoka wrote:
    swamyv wrote:
    There are free tools available to debug windows. I think gdb is one of them. If you search you can find some good tools.
    If you find any good tools that you like share it with us.
    Yes I will try gdb (have cygwin) and see where this takes us - not sure if the JVM or tomcat6.exe have the symbols to get a meaningful stack trace. As luck would have it, [https://issues.apache.org/bugzilla/show_bug.cgi?id=10565|https://issues.apache.org/bugzilla/show_bug.cgi?id=10565] claims that "shutdown hooks are not supported in a container environment" although there is no such restriction in the servlet spec, which would make this a tomcat issue (it does sound like that tomcat6.exe wrapper is somehow involved). Unfortunately, tomcat does NOT issue the AFTER_STOP_EVENT if killed before it has completed its start-up (it appears its own shutdown hook, which sends the event, is not registered until it has fully come up); thus the need for a shutdown hook (at least, up until it's fully up). A shutdown hook is still required in my case for clean-up after tomcat is completely out of the picture. It sounds like the proper architecture here is to really embed tomcat in an application, and create a shutdown hook at the outer level.
    Educate me some more. The above description certainly seems like you are suggesting that both of the following are true.
    1. It is not a bug in the VM.
    2. The problem, for your implementation, is in how the wrapper terminates the windows service.
    Perhaps what is actually happening it that addShutdownHook() is never being called at all? Thus of course any processing of the thread associated with that would never, ever run.
    And that happens because you are banging on the stop service so fast that it doesn't actually have time to spin up?

  • I can not get my Adobe Photoshop Elements 8 organize to open. The edit option comes up with no problem, but will crash when I try to access organize. What should I do to fix this problem?I can not get my Adobe Photoshop Elements 8 organize to open. The ed

    I can not get my Adobe Photoshop Elements 8 organize to open. The edit option comes up with no problem, but will crash when I try to access organize. What should I do to fix this problem?

    Hi,
    Which operating system are you running on?
    Try starting the organizer while holding down the shift key.  Hopefully, it should load the Catalog Manager.
    Select your current catalog and click on the Repair button. Once it has finished, click on the Open button to see if the catalog opens.
    Good luck,
    Brian

  • Bookmark method for a page is not getting called

    Hi,
    I am developing a simple ADF application which contains two jspx pages, in JDEVELOPER 11g (build JDEVADF_MAIN_GENERIC_080910.1420.5124).
    I have a commandLink in Page1 which takes me to the Page2.I have a bookmark method for Page2, which gets called when I load the page.
    When I access the Page2 directly,the corresponding bookmark method is getting called.But when I navigates it through commandLink provided in Page1,the bookmark method is not getting called.
    Page1.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document maximized="true">
    <af:form>
    <af:commandLink text="Go to Page2" action="page2" />
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    Page2.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:bib="http://xmlns.oracle.com/dss/adf/faces">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document maximized="true">
    <af:form>
    <af:outputText value="This is Page2"/>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>
    adfc-config.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
    <view id="page1">
    <page>/page1.jspx</page>
    </view>
    <view id="page2">
    <page>/page2.jspx</page>
    <bookmark>
    <method>#{mBean.bookMarkMethod}</method>
    </bookmark>
    </view>
    <control-flow-rule>
    <from-activity-id>page1</from-activity-id>
    <control-flow-case>
    <from-outcome>page2</from-outcome>
    <to-activity-id>page2</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <managed-bean>
    <managed-bean-name>mBean</managed-bean-name>
    <managed-bean-class>view.ManagedBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    </adfc-config>
    ManagedBean.java:
    public class ManagedBean {
    public ManagedBean() {
    super();
    public void bookMarkMethod() {
    System.out.println("Inside bookmark method");
    Please look into this...........

    Hi Frank,
    I need to provide the af:commandLink inside af:table component and the values which I pass to page2 depends on the row I select at runtime.
    so,I am trying to use ad:setActionListener inside af:commandLink.
    If I use FacesContext.getCurrentInstance.getExternalContext.redirect() inside the actionListener of af:commandLink, I need to extract all the required values in the actionListener.
    Isn't there any way so that, I can pass the values using af:setActionListener inside af:commandLink and a method ( which will initialise the managed bean) will be called when page2 loads ???
    Regards,
    Lokesh.

  • Mediator 11.1.1.5 faults Java Handler not getting called fault-policies

    Hi,
    I have a Oracle SOA 11.1.1.5 Mediator and am handling the faults using fault policies but somehow custom java handler is not invoked when an error occurs and this is what I see in the log but somehow my custom java handler class is not getting called.
    INFO: FaultPoliciesParser.parsePolicies ------->Begin Parsing of policy file
    <Apr 16, 2012 10:30:17 PM EDT> <Error> <oracle.soa.mediator.common.listener> <BE
    A-000000> <Enququeing to Error hospital successful...>Here is the fault-policies.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <faultPolicies xmlns="http://schemas.oracle.com/bpel/faultpolicy">
      <faultPolicy version="2.0.1" id="medFaultHandling"
                   xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:xs="http://www.w3.org/2001/XMLSchema"
                   xmlns="http://schemas.oracle.com/bpel/faultpolicy"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Conditions>
          <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
                     name="bpelx:remoteFault">
            <condition>
              <action ref="java-fault-handler"/>
            </condition>
          </faultName>
          <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
                     name="bpelx:bindingFault">
            <condition>
              <action ref="java-fault-handler"/>
            </condition>
          </faultName>
          <faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
                     name="bpelx:runtimeFault">
            <condition>
              <action ref="java-fault-handler"/>
            </condition>
          </faultName>
        </Conditions>
        <Actions>
          <Action id="java-fault-handler">
            <javaAction className="com.mediator.faults.CustomMediatorFaultHandler"
                        defaultAction="ora-human-intervention" propertySet="myMediatorProps">
              <returnValue value="OK" ref="ora-human-intervention"/>
            </javaAction>
          </Action>
          <Action id="ora-human-intervention">
            <humanIntervention/>
          </Action>
          <Action id="ora-rethrow-fault">
            <rethrowFault/>
          </Action>
          <Action id="ora-retry">
            <retry>
              <retryCount>3</retryCount>
              <retryInterval>15</retryInterval>
              <exponentialBackoff/>
              <retryFailureAction ref="java-fault-handler"/>
            </retry>
          </Action>
        </Actions>
        <Properties>
          <propertySet name="myMediatorProps">
            <property name="logFileName">mediator-faults.log</property>
            <property name="logFileDir">C:/software</property>
          </propertySet>
        </Properties>
      </faultPolicy>
    </faultPolicies>Here is my the fault-bindings.xml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <faultPolicyBindings version="2.0.1"
                         xmlns="http://schemas.oracle.com/bpel/faultpolicy"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <composite faultPolicy="medFaultHandling"/>
    </faultPolicyBindings>And here is the snippet of composite.xml where I put the below properties:
    <component name="Router">
        <implementation.mediator src="Router.mplan"/>
        <property name="oracle.composite.faultPolicyFile">fault-policies.xml></property>
        <property name="oracle.composite.faultBindingFile">fault-bindings.xml></property>
      </component>But when the exception occurs I don't see my custom Java Handler being invoked. As I created a jar file and placed it in
    *<Middleware_Home>\Oracle_SOA1\soa\modules\oracle.soa.mediator_11.1.1*
    and updated oracle.soa.mediator.jar manifest by putting the path of the jar file. Restarted the servers but still when an exception occurs in Mediator custom java handler is not invoked. Any ideas what I am missing or are there any special steps
    Thanks

    There is no point in retry on binding fault, rather you can raise it as exception and catch it in sepcific catch block or catch all will handle it.
    Ideally this particular instance will be faulted and if required you can customize to send a mail with fault string to developer or support person or dba
    This type of fault need human intervension to fix this code or it could be data issue.
    - It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    Thanks,
    Vijay

  • Issue: Not getting response when the document is having special chars

    Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    Error message:
    System.FormatException: Invalid length for a Base-64 char array. at
    System.Convert.FromBase64String(String s) at
    Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
    c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
    Code:
    File 1:
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.Properties;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import com.lowagie.text.Document;
    import com.lowagie.text.pdf.PRTokeniser;
    import com.lowagie.text.pdf.PdfReader;
    public class DocumentSummarizerClient {
         static Properties loadProperties() {
              Properties prop = new Properties();
              try {
                   prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
              } catch (Exception ioe) {
                   ioe.printStackTrace();
              return prop;
         public String getSummary(String fileName,String noOfWordsOrPercentage ){
              String summaryInputData ="";
              String summarizedData="";
              String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
              try {
                   String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
                   if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
                                  if (fileExtension.equalsIgnoreCase("txt")) {
                                       BufferedReader bufferedReader = new BufferedReader(
                                                 new FileReader(fileName));
                                       String line = null;
                                       while ((line = bufferedReader.readLine()) != null) {
                                            summaryInputData += line;
                                  if(fileExtension.equalsIgnoreCase("doc")){
                                       POIFSFileSystem fs = null;
                                        fs = new POIFSFileSystem(new FileInputStream(fileName));
                                         HWPFDocument doc = new HWPFDocument(fs);
                                         WordExtractor we = new WordExtractor(doc);
                                         String[] paragraphs = we.getParagraphText();
                                         for( int i=0; i<paragraphs .length; i++ ) {
                                            paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
                                  summaryInputData+= paragraphs[i];
                                  if(fileExtension.equalsIgnoreCase("pdf")){
                                       Document document = new Document();
                   document.open();
                   PdfReader reader = new PdfReader(fileName);
                   int pageCount =reader.getNumberOfPages();
                        for(int i=1;i<=pageCount;i++){
                                  byte[] bytes = reader.getPageContent(i);
                                  PRTokeniser tokenizer = new PRTokeniser(bytes);
                                  StringBuffer buffer = new StringBuffer();
                                  while (tokenizer.nextToken()) {
                                  if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
                                  buffer.append(tokenizer.getStringValue());
                                  summaryInputData += buffer.toString();
                   else{
                        System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
                   // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        // System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
                   else{
                        System.out.println("Data given cannot be summarized further");
                        summarizedData="";
              } catch (FileNotFoundException e) {
                   return("The File is not found \n\n"+e.toString());
              } catch (IOException e) {
                   return("The File is already in use \n\n"+e.toString());
              } catch (Exception e) {
                   return(e.toString());
              return summarizedData;
         public static String postRequest(String parameters,String webServiceURL) throws Exception{
              Properties systemSettings = System.getProperties();
              systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
         systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
         System.setProperties(systemSettings);
              String responseXML = "";
              try {
                   URL url = new URL(webServiceURL);
                   URLConnection connection = url.openConnection();
                   HttpURLConnection httpConn = (HttpURLConnection) connection;
                   byte[] requestXML = parameters.getBytes();
                   httpConn.setRequestProperty("Content-Length", String
                             .valueOf(requestXML.length));
                   httpConn.setRequestProperty("Content-Type",
                             "application/x-www-form-urlencoded");
                   httpConn.setRequestMethod("POST");
                   httpConn.setDoOutput(true);
                   httpConn.setDoInput(true);
                   OutputStream out = httpConn.getOutputStream();
                   out.write(requestXML, 0, requestXML.length);
                   out.close();
                   InputStreamReader isr = new InputStreamReader(httpConn
                             .getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   String temp;
                   String tempResponse = "";
                   while ((temp = br.readLine()) != null)
                        tempResponse = tempResponse + temp;
                   responseXML = tempResponse;
                   br.close();
                   isr.close();
              } catch (java.net.MalformedURLException e) {
                   System.out
                             .println("Error in postRequest(): Secure Service Required");
              } catch (Exception e) {
                   System.out.println("Error in postRequest(): " + e.getMessage());
              return responseXML;
         public String replaceVal(String value) {
                   if (value == null) {
                        value = "";
                   value = value.replace("&lt;", "<");
                   value = value.replace("&gt;", ">");
                   value = value.replace("&amp;", "&");
                   return value;
              public static void main(String[] args) {  
                   DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
                   System.out.println("hello");               
                   testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");     
    Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    File 2:
    ---------public class Base64Utils {
    private static byte[] mBase64EncMap, mBase64DecMap;
    * Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
    static {
    byte[] base64Map = {
    (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
    (byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
    (byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
    (byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
    (byte)'Y', (byte)'Z',
    (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
    (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
    (byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
    (byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
    (byte)'y', (byte)'z',
    (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
    (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
    mBase64EncMap = base64Map;
    mBase64DecMap = new byte[128];
    for (int i=0; i<mBase64EncMap.length; i++)
    mBase64DecMap[mBase64EncMap[i]] = (byte) i;
    * This class isn't meant to be instantiated.
    private Base64Utils() {
    * Encodes the given byte[] using the Base64-encoding,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the data to be encoded
    * @return the Base64-encoded <var>aData</var>
    * @exception IllegalArgumentException if NULL or empty array is passed
    public static String base64Encode(byte[] aData) {
    if ((aData == null) || (aData.length == 0))
    throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
    byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
    // 3-byte to 4-byte conversion
    int srcIndex, destIndex;
    for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
    (aData[srcIndex+1] << 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
    // Convert the last 1 or 2 bytes
    if (srcIndex < aData.length) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    if (srcIndex < aData.length-1) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
    else {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
    // Add padding to the end of encoded data
    while (destIndex < encodedBuf.length) {
    encodedBuf[destIndex] = (byte) '=';
    destIndex++;
    String result = new String(encodedBuf);
    return result;
    * Decodes the given Base64-encoded data,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the Base64-encoded aData.
    * @return the decoded <var>aData</var>.
    * @exception IllegalArgumentException if NULL or empty data is passed
    public static byte[] base64Decode(String aData) {
    if ((aData == null) || (aData.length() == 0))
    throw new IllegalArgumentException("Can not decode NULL or empty string.");
    byte[] data = aData.getBytes();
    // Skip padding from the end of encoded data
    int tail = data.length;
    while (data[tail-1] == '=')
    tail--;
    byte decodedBuf[] = new byte[tail - data.length/4];
    // ASCII-printable to 0-63 conversion
    for (int i = 0; i < data.length; i++)
    data[i] = mBase64DecMap[data[i]];
    // 4-byte to 3-byte conversion
    int srcIndex, destIndex;
    for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
    srcIndex += 4, destIndex += 3) {
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
    (data[srcIndex+3] & 077) );
    // Handle last 1 or 2 bytes
    if (destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    if (++destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    return decodedBuf;
    issue 2: Exception when passing 2MB .txt file
    Steps to reproduce:
    Call getSummary() with 2MB .txt file
    Actual:
    The following exception has occured:
    1. Error in postRequest(): Unexpected end of file from server
    java.lang.NullPointerException
    Please provide your precious feedback/suggestions.
    Thanks in advance…..
    Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for your response….
    This is enhancement project and some one develops long back.
    Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
    DocumentSummarizerClient.java I am using base64
    Ex:
    // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
    Above specific please I need to modify to resolve above issue.
    Could you please suggest me what changes I need to do.
    Waiting for positive response.

  • ReturnEvent not get called after search more than 10 times in LOV page

    hi there,
    I using ADF and Jdeveloper 10.3.1.2
    In my project I have a form which called a LOV page for selecting multiple records and submit button sumup the values of each selected row of LOV and return to the main form and display added value on text field.
    problem is when I search records more than 10 times or more I put search criteria and select row on each time. After click on submit the value of each row is sum up return on the main form but it not reflected on main form because ReturnListener not get called .
    But when I select many rows more than 10 without searching then the ReturnListener get called when it returning on main form.
    So should I do so that ReturnListener get called.
    Is it any bug of ADF or Jedeveloper .

    Hi,
    depends on whether you control the BPM task flow or not. If you do, have a look at this thread for how to debug the problem
    How to debug "Attempt to validate an already invalid RegionSite"?
    Otherwise, post it to the SOA forum if this is initiated by their generated code. The most common reason though is that the task flow lacks a default activity. So if the default activity is somewhat calculated dynamically in your application then this may be a reason
    Frank

  • Task in Lookup.USR_PROCESS_TRIGGERS not getting  called

    Hi,
    We have created a process task adapter and copied this in Lookup.USR_PROCESS_TRIGGERS. This adapter works only when some change happens in User Form in a particular field (say First name).This adapter is not getting called for the users who are created through Bulk Upload. Although it is getting called when I am creating a user manually.
    Regards,
    Shubhra

    This the issue with 11.1.1.5 version of OIM. It doesn't trigger on trusted recon. install BP02 for resolving this issue. We had resolved this by installing this patch
    --nayan                                                                                                                                                                                                                                                                                                                                                                   

  • Get method of HtmlPanelGrid is not getting called

    Hi,
    I'm creating components dynamically.
    I have a dropdown. Based on the selection of dropdown, the corresponding values are displayed and the get method of HtmlPanelGrid should be called.
    First time the panel grid getmethod is getting called. But when i change the value of drop down, panel grid get method is not getting called and its not rendering.
    This is the code:
    JSF:
    Drop Down
    <h:panelGroup>
    <t:selectOneMenu id="selectProjectTypes" onchange="sbmitform();" immediate="true" valueChangeListener="#{ProjectController.projectTypeChanged}" value="#{ProjectController.project.selectProjectTypes}">
    <f:selectItem itemLabel="--------------------" itemValue="-1"/>
    <f:selectItems value="#{ProjectController.projectTypesList}"/>
    </t:selectOneMenu>
    </h:panelGroup>
    Panel Grid
    <h:panelGrid columns="2" rendered="#{ProjectController.projects}" id="test" binding="#{ProjectController.defaultValues}" columnClasses="hunderadfifty" cellpadding="5" />
    Controller:
    public void projectTypeChanged(ValueChangeEvent event) throws AbortProcessingException,Exception {
    String nodeTypeId = null;
    String selectedValue = (String)event.getNewValue();
    getSessionCache().addValue("test", 0, "1");
    if(selectedValue.equalsIgnoreCase(selectedValue)){
    try
    // this.getDefaultValues().setRendered(true);
    // defaultValues=this.getDefaultValues();
    } catch (Exception e)
    e.printStackTrace();
    FacesContext.getCurrentInstance().renderResponse();
    Panel Grid Method
    *public HtmlPanelGrid getDefaultValues() throws Exception {*
    String devlues = (String)getSessionCache().getValue("test");
    Application app = FacesContext.getCurrentInstance().getApplication();
    labelList = nodeTypeFieldsService.getFixedFields(this.getRpUserData(), this.getAuthUser());
    HtmlPanelGrid panelGrid = (HtmlPanelGrid)app.createComponent(HtmlPanelGrid.COMPONENT_TYPE);
    for(int i = 0; i<labelList.size(); i++)
    HtmlOutputText heading = (HtmlOutputText)app.createComponent(HtmlOutputText.COMPONENT_TYPE);
    HtmlPanelGroup panelGroup = (HtmlPanelGroup)app.createComponent(HtmlPanelGroup.COMPONENT_TYPE);
    HtmlInputText inputText = (HtmlInputText)app.createComponent(HtmlInputText.COMPONENT_TYPE);
    String fieldHeading =((ProjectField)labelList.get(i)).getFieldHeading();
    int fieldLength = ((ProjectField)labelList.get(i)).getFieldLength();
    String fieldDescription = ((ProjectField)labelList.get(i)).getFieldDescription();
    String fieldType = ((ProjectField)labelList.get(i)).getFieldType();
    inputText.setValueBinding("value", (ValueBinding) app.createValueBinding("#{ProjectController.newProj}"));
    if(fieldType.equalsIgnoreCase("3"))
    heading.setValue(fieldHeading);
    heading.setTitle(fieldDescription);
    inputText.setMaxlength(fieldLength);
    inputText.setSize(fieldLength);
    UIRDDialog dialog = (UIRDDialog)app.createComponent(UIRDDialog.COMPONENT_TYPE);
    dialog.setTitle("Object Type Dialog");
    dialog.setHeight("370");
    dialog.setWidth("350");
    dialog.setUrl("searchObjectTypeDialog.jsf");
    UIRDIconButton iconButton = (UIRDIconButton)app.createComponent(UIRDIconButton.COMPONENT_TYPE);
    iconButton.setType("button");
    iconButton.setTitle("Search for Object Types");
    iconButton.setIcon("/image/icon/portalicon_search.gif");
    iconButton.setActivateDialog("searchObjectTypeDialog");
    panelGroup.getChildren().add(inputText);
    panelGroup.getChildren().add(iconButton);
    panelGroup.getChildren().add(dialog);
    panelGrid.getChildren().add(panelGroup);
    }else
    panelGroup.getChildren().add(inputText);
    heading.setValue(fieldHeading);
    inputText.setMaxlength(fieldLength);
    inputText.setSize(fieldLength);
    heading.setTitle(fieldDescription);
    panelGrid.getChildren().add(panelGroup);
    panelGrid.getChildren().add(heading);
    panelGrid.getChildren().add(panelGroup);
    HtmlCommandButton createButton = (HtmlCommandButton)app.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    createButton.setId("create");
    createButton.setTitle("Create");
    createButton.setValue("Skapa");
    createButton.setAction(app.createMethodBinding("#{ProjectController.saveProject}", null));
    HtmlCommandButton backButton = (HtmlCommandButton)app.createComponent(HtmlCommandButton.COMPONENT_TYPE);
    backButton.setId("back");
    backButton.setTitle("Cancel");
    backButton.setValue("Avbryt");
    backButton.setAction(app.createMethodBinding("#{ProjectController.cancel}", null));
    panelGrid.getChildren().add(createButton);
    panelGrid.getChildren().add(backButton);
    return panelGrid;
    /* } else {
    return null;
    kindly help me out.
    regards
    venkatraman.P

    Hi,
    I'm having the exact same problem, and it's freaking me out!!! The setGridPanel method is always called but not the getGridPanel. This one is only called the first time the page is rendered, and when I change a drodpdownlist it never gets the gridPanel again! I'm using an HtmlPanelGrid. Anyone can help please?
    Thanks in advance,
    Raquel

  • JPF not getting invoked when using PageURL

    Team Portal -
    I am having a problem with creating links to other portlets.
    I have one page flow portlet that checks for the "page" input parameter to redirect
    to different pages.
    Now, another portlet needs to have links to the different pages within the page
    flow portlet. I am using the PageURL to create the links -
    PageURL gotoPageLink1 = PageURL.createPageURL(request, response, "linksPortetPage");
    gotoPageLink1.addParameter("page", "page1");
    PageURL gotoPageLink2 = PageURL.createPageURL(request, response, "linksPortetPage");
    gotoPageLink2.addParameter("page", "page2");
    and so on.
    However, all these links go to Page1. It seems that the begin action in the linksPortlet
    does not get called.
    Help please.
    Thanks
    Fumi

    Team Portal -
    I am having a problem with creating links to other portlets.
    I have one page flow portlet that checks for the "page" input parameter to redirect
    to different pages.
    Now, another portlet needs to have links to the different pages within the page
    flow portlet. I am using the PageURL to create the links -
    PageURL gotoPageLink1 = PageURL.createPageURL(request, response, "linksPortetPage");
    gotoPageLink1.addParameter("page", "page1");
    PageURL gotoPageLink2 = PageURL.createPageURL(request, response, "linksPortetPage");
    gotoPageLink2.addParameter("page", "page2");
    and so on.
    However, all these links go to Page1. It seems that the begin action in the linksPortlet
    does not get called.
    Help please.
    Thanks
    Fumi

  • BAdi not getting called after applying CRM7.0 ehp1

    Hi experts,
    We applied EHP1 to our Sandbox system and now Badi: CRM_MKTPL_OL_OBJ is randomly getting called.
    I went to se18 enter the enhancement spot and once i enter the Badi Implementation I can see under
    Runtime Behavior that the implementation is active. However the description in Effect in Current Client says:Execution depends on runtime filter values
    While in our other client in which we havent applied EHP1 the Effect in Current client: Implementation is called
    I know that is just the description but I am not sure if somthing has changed with EHP1
    For both clients the implementation is active, but in the client in which we applied EHP1 the Badi is not getting called where expected.
    Does anyone please have any suggestions.
    your help is appreciated.
    thanks,
    Jeannet.

    Hi Jeannet,
    probably have a look at the filter values in the BAdI implementation as well. It says it has got filters. Maybe the BAdI is only activated for Campaigns but not Elements?
    If that does not bring the conclusion do a where used list on the interface for the BAdI. It will bring you to the place where it is called in ABAP and you see the direct cause why it sometimes is called or not.
    I implemented the mentioned BAdI on CRM 6 as well as 7 and 7.1 had no problems I can remember so far.
    cheers Carsten

  • PERFORM Statement is not getting called

    PERFORM Statement is not getting called in Z-copy of standard SAP script F110_PRENUM_CHCK.
    On debugging the code i am not getting any value in all changing parameters.
    and when debugger cursor comes to PERFORM statement then on Pressing F5 it goes to next line and ultimate result is
    that i don't get any value in generated form.
    I had used follwing perform in my script ZF110_PRENUM_CHC which is copy of  F110_PRENUM_CHCK.
    DEFINE &ZDOCNUM& = &SPACE&
    DEFINE &ZDOCNUM2& = &SPACE&
    DEFINE &ZAMOUNT_BSAK& = &SPACE&
    DEFINE &ZAMOUNT_BSIK& = &SPACE&
    DEFINE &ZVNDR_INVREF_BSAK& = &SPACE&
    DEFINE &ZVNDR_INVREF_BSAK& = &SPACE&
    PERFORM ZFI_PRENUM_GSF IN PROGRAM ZFI_PRENUM
    USING &REGUH-VBLNR&
    USING &REGUH-RBETR&
    USING &REGUP-SKFBT&
    USING &REGUD-WRBTR&
    USING &LFA1-LIFNR&
    CHANGING &ZDOCNUM&
    CHANGING &ZDOCNUM2&
    CHANGING &ZAMOUNT_BSAK&
    CHANGING &ZAMOUNT_BSIK&
    CHANGING &ZVNDR_INVREF_BSAK&
    CHANGING &ZVNDR_INVREF_BSIK&
    ENDPERFORM.
    PROTECT
    &ULINE&
    DOCUMENT NUMBER     AMOUNT(RS.)     VENDOR INVOICE REFERENCE     DEDUCTIONS
    &ZDOCNUM&     &ZAMOUNT_BSAK&     &ZVNDR_INVREF_BSAK&     &ZDED_AMT&
    &ULINE&
    Edited by: Ajay84 on Nov 24, 2011 2:32 PM

    Hi,
    when you are using SAP SCRIPT debugger, on perform statement it doesn't go to the FORM in the program.
    The reason is the FORM should be debugged in ABAP debugger.
    So put a break point in the FORM which you want to debug and then execute the transaction. That will take you to the form in you r program.
    Hope this helps..
    Regards,
    -Sandeep

  • Print program is not getting triggered when saving the application

    Hi all,
    My requirement is when i save the invoice using VF01 the print program should get triggered.
    The print program is not getting triggered when saving the application even when i have configured the outtype and have attached the print program.
    The setting "send immediately (when saving application)" is also checked.
    I need to configure it for VF01 transaction.
    The error message displayed was " please maintain output device in master data".
    Regards,
    Umesh

    Hi Umesh
    Please check if you have missed any of the following:
    1. Defining Access Sequence(can use existing).
    2. Defining Output Condition Type(can use existing). - Assigning the Driver Program and Form in processing routine.
    3. Output Determination Procedure
    4. Assign Output Procedure to Billing Types
    Kind Regards
    Eswar

  • Server side function not get called after dispatching cairngorm event second time on same page

    Hi All,
    I am facing a urgent issue regarding cairngorm event. Actually my page contain 3 button add,delete,save
    and  clicking of any button I do the respected functionality. For ex:
    I click the add button & on clicking of add button I fire a cairngorm evnt & after getting response from server side that the record is added
    I displayed a message that the record is added & update the data source.
    After addition of the record , with out going to other page if I perform the same functionaly(Like adding another record) on same page the cairngorm
    event not call the server side function  -  after debugging I find out that cairngorm event  reach to the corresponding excutecommand function & called that function  but it is not calling my server side function & I also din't get any error message .
    I dont know why  the server side function not get called?. similarly if I try for delete or update case the same things happend. Only for the first time it works properly but not for the second  time.
    Could any of  you please tell me why the cairngorm event not calling the server side function.
    Thank you for your kind assistance.
    Regards,
    Ujjwal

    Okay, well I think I've worked out the problem.
    In ASP.NET we would typically bind repeating controls such as DataLists and Repeaters manually using <i>Control</i>.DataBind(), because we're usually using a separate class library containing collections for our objects. Seems the SAP Table control doesn't like this approach.
    I changed the code so that the databinding is specified on the control, and call the Page's DataBind() method and it all worked fine.
    One tip: because the collection I used to bind to is in a separate class library, I receieved a <i>BC306523: Reference required to assembly MyAssemblyName...</i> message, even though I had a reference to the assembly in my project and the DLL is being properly deployed. To fix this, you must include the following directive at the top of the component's ASCX file:
    <%@ Assembly Name="AssemblyName" %>

  • Profit Center Document not getting generated when direct FI doc is posted

    Dear Experts,
    Profit Center Document not getting generated when direct FI doc is posted. However CO Document is generated for Line Item 1 mentioned below.
    Accounting Entry
    Line 1 -Debit Expense ( Cost Center) 1000
    Line 2 - Credit Bank                             1000    
    Advance Thanks
    Sanjai

    Hi,
    Pls check profit center configuration.... Some config might have missed.....
    Use the t.code 1KE1 For analysing the profit center configuration.
    Regards,
    RAM
    Edited by: Ram000 on Oct 7, 2011 10:45 AM

Maybe you are looking for

  • How can I add my software in Adobe's Third-party plug-ins for Adobe Premiere Pro ?

    Hi, Our company have a software called Moyea Importer for Adobe Premiere. Moyea Importer for Adobe Premiere is a recommended FLV, MPG, RMVB, HD  video import plugin for Adobe Premiere Pro. This plug-in enables users  to import FLV videos with various

  • Third Party and Individual Purchase Order

    <b>Can anybody please send me the steps to configure the Return Process for both Third Party and Indvidual Purchase Orders.</b>

  • Why won't my mac book find my zumo gps

    Why cant my Mac book pro find my Zumo 550

  • Opening folder Crashes Finder...Help

    Hi, Certain random folders on my system cannot be opened I double clicked the folder to open it and it seemed to freeze my mac finder and cleared my desk top for a couple of seconds but the folder still did not open. Only a finder window opened showi

  • LR4 crashing on printing

    After using LR4 for a week or so I went to print my first jobs yesterday. First job (8xA4) went fine. The second (3xA4), and every subsequent, job has caused LR to crash. No changes were made after the first job. Intially I was printing to my Canon i