POSTING TO JSP FORMS GIVES NULL OBJECT RATHER THAN EMPTY STRING

This post is for Dan Norris of DOE. He brought this up in a submitted tar, but it is addressed by the PDK community here.
We arehaving problems using the standard HTTPServletRequest getParameter
methodinside of the portal.
The standard for this method is as follows:
*If you usethis method to read from a text field without any text in it, you
get an empty string. ( "" )
*If you use it to read from a text field with text in it youwould get the
corresponding text.
*If you try to read from a field that doesn'texist then and only then would
you get a Null object.
On our portal server itis behaving differently inside of portlets.
* If you use this method to readfrom a text field without any text in it, you
get a Null Object
* If you use itto read from a text field with text in it you would get the
correspondingtext.
* If you try to read from a field that doesn't exist you also would youget a
Null object.
Also, on the same server If you access a simple JSP directlywithout the it
being a portlet, it behaves as defined by standard Javadocumentation.
Test case:
Create test.jsp with these contents:
========start test.jsp
<%@pageimport = "oracle.portal.provider.v1.*,
oracle.portal.provider.v1.http.*"%>
Form to test submission of empty form field.<br>
Text Field Value ="<%=request.getParameter("testField")%>"
<form name="test" action="<%=
HttpPortletRendererUtil.htmlFormActionLink(request,PortletRendererUtil.PAGE_LINK
) %>">
<%=
HttpPortletRendererUtil.htmlFormHiddenFields(request,PortletRendererUtil.PAGE_LI
NK) %>
<INPUT type="text" name="testField">
<INPUT type="Submit"name="Submit">
</form>
========end test.jsp
=================startprovider.xml
<provider class="oracle.portal.provider.v1.http.DefaultProvider"
session="true">
<portlet class="oracle.portal.provider.v1.http.DefaultPortlet" version="1" >
<id>1</id>
<name>TestPortlet</name>
<title>Test</title>
<description>Test</description>
<timeout>100</timeout>
<timeoutMsg>Test Portlet timed out.</timeoutMsg>
<showEdit>false</showEdit>
<showEditDefault>false</showEditDefault>
<showPreview>false</showPreview>
<showDetails>false</showDetails>
<hasHelp>false</hasHelp>
<hasAbout>false</hasAbout>
<acceptContentTypes>
<item>text/html</item>
</acceptContentTypes>
<portletRenderer class="oracle.portal.provider.v1.http.PageRenderer" >
<appPath>/</appPath>
<appRoot>/u01/app/oracle/product/ias1021/Apache/Apache/htdocs</appRoot>
<renderContainer>false</renderContainer>
<showPage>test.jsp</showPage>
<pageParameterName>next_page</pageParameterName >
</portletRenderer>
</portlet>
</provider>
=================end provider.xml
After you have theprovider added to the portal, login to the portal as
portal30 and go toAdminister Tab->Display Portlet Repository and display the
portlet.
1.Enter "test" in the text field and submit.
2. Returns Text Field Value ="test"
3. Submit form leaving the text field empty.
4. Returns Text FieldValue = "null"
Submitting the form with the text field empty should returnvalue of "", and
not "null".

fyi in case anyone else ever wants to know:
I found it... the details I was looking for were in the OC4J 9.0.2 Release Notes:
Display of null values in JSP.
In Oracle9iAS, a null value printed from a JSP page displays, by default, as
the string "null." To display nothing instead, set the attribute jsp-print-null
to false in the <web-app> element of
global-web-app.xml or orion-web.xml.

Similar Messages

  • Submit form as an email rather than an attachment

    When someone submits a form with answers, I need the answers to be in the body of the text, rather than as an attachment. How do i get this to happen?
    Scott

    You can inject data into the string that gets sent to the email program, you don't have any control over formatting except for returns and that kind of thing.
    Here are a couple of ways of doing it:
    var strToAddress, strCCAddress, strSubject, strMessage
    strToAddress = txtToAddress.rawValue;
    strCCAddress = txtCCAddress.rawValue;
    strSubject = txtSubject.rawValue;
    strMessage = txtMessage.rawValue;
    event.target.submitForm({cURL:"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});
    You can use variables in the following as well:
    var oDoc = event.target;
    oDoc.mailDoc({
    bUI: true,
    cTo: "[email protected]",
    cCC: "[email protected]",
    cSubject: "The Latest News",
    cMsg: "A.P., attached is my latest news story in PDF."

  • How do I post iPhoto pictures to facebook using Firefox rather than Safari?

    When I want to post iPhoto pictures to facebook, and I click on the facebook icon in the lower right corner of the iPhoto page, my facebook page comes up in Safari, when I want it to come up using Firefox.  What do I need to do to make the facebook page come up in Firefox rather than Safari?  Any help would be appreciated.  Thanks.

    Make Firfox your Default Web Browser.

  • LicenseServer property in Company object alway return empty string

    Hi everyone,
    When I use Company object and LicenseServer property to get LicenseServer, both in SBO 2004 & SBO 2005 all return empty string, who can help me get the correct LicenseServer name.
    Thanks in advance.
    Kathy

    Jose Xabier,
    Thanks for your reply, actually I need the License server name, but in SLIC table it saves Local hotost and port number some times like below:
    [localhost:30000]
    who knows how to get the name instead of Localhost,
    why licenseserver return empty sting? doI need set other property to get license server name for company object?
    Thanks,
    Kathy

  • Unmarshal stringbuffer gives null object

    Hi,
    I'm using jDeveloper 10.1.3. to develop a webservice that calls the Oracle Business Rules engine.
    In order to do this, I take the carrental example from OTN as a starting point.
    The supplied java file uses Unmarshalling to read xml from a file into an object like this:
    ******************************************************************************88
    //* Unmarshall a file
    JAXBContext jc = JAXBContext.newInstance("rent");
    Unmarshaller um = jc.createUnmarshaller();
    String fs = System.getProperty("file.separator");
    String xmlpath = "C:\\Jdev10g\\jdev\\mywork\\Rules\\rent\\data" + fs + "carrental.xml" ;
    Object root = um.unmarshal(new File(xmlpath));
    This works fine.
    I want to do the same but now with the xml in a stringbuffer i.o. a file, like this:
    //Unmarshal a stringbuffer
    JAXBContext jc = JAXBContext.newInstance("rent");
    Unmarshaller um = jc.createUnmarshaller();
    StringBuffer xmlStr = new StringBuffer(buf1);
    Object root = um.unmarshal(new StreamSource (new StringReader(xmlStr.toString())));
    In this case, the resulting Object root is null.
    The String buf1 variable contains the same xmlstring as is found in the carrental.xml file :
    <repository xmlns="http://rules.oracle.com/carrental"
    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
    <driver>
    <driver-license-number>d111</driver-license-number>
    <name>Dave</name>
    <age>50</age>
    <vehicle-type>sports</vehicle-type>
    <license-type>full</license-type>
    <pre-convictions>0</pre-convictions>
    <pre-accidents>1</pre-accidents>
    <able-to-drive>true</able-to-drive>
    </driver>
    <driver>
    <driver-license-number>d222</driver-license-number>
    <name>Martien van den Akker</name>
    <age>18</age>
    <vehicle-type>truck</vehicle-type>
    <license-type>full</license-type>
    <pre-convictions>0</pre-convictions>
    <pre-accidents>0</pre-accidents>
    <able-to-drive>true</able-to-drive>
    </driver>
    <driver>
    <driver-license-number>d222</driver-license-number>
    <name>Rob de Haanr</name>
    <age>39</age>
    <vehicle-type>truck</vehicle-type>
    <license-type>full</license-type>
    <pre-convictions>0</pre-convictions>
    <pre-accidents>1</pre-accidents>
    <able-to-drive>true</able-to-drive>
    </driver>
    </repository>
    I followed the examples from the Sun website:
    http://java.sun.com/webservices/docs/1.6/api/javax/xml/bind/Unmarshaller.html
    The complete java file is:
    package carrental;
    import java.io.File;
    import java.io.StringReader;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Unmarshaller;
    import javax.xml.transform.stream.StreamSource;
    import oracle.rules.rl.RuleSession;
    import oracle.rules.sdk.dictionary.RuleDictionary;
    import oracle.rules.sdk.exception.RepositoryException;
    import oracle.rules.sdk.repository.RepositoryContext;
    import oracle.rules.sdk.repository.RepositoryManager;
    import oracle.rules.sdk.repository.RepositoryType;
    import oracle.rules.sdk.repository.RuleRepository;
    public class TestXML
    static public void main( String[] args )
    String result;
         try
    TestXML myObject = new TestXML();
    result = myObject.testRule("rob");
    catch( Throwable t )
    t.printStackTrace();
    public String testRule (String buf)
    String buf1 =
    "<?xml version=\"1.0\"?><repository xmlns=\"http://rules.oracle.com/carrental\"\n" +
    " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
    " <driver>\n" +
    " <driver-license-number>d111</driver-license-number>\n" +
    " <name>Dave</name>\n" +
    " <age>50</age>\n" +
    " <vehicle-type>sports</vehicle-type>\n" +
    " <license-type>full</license-type>\n" +
    " <pre-convictions>0</pre-convictions>\n" +
    " <pre-accidents>1</pre-accidents>\n" +
    " <able-to-drive>true</able-to-drive>\n" +
    " </driver>\n" +
    "</repository>\n" ;
    try
    //Unmarshal a stringbuffer
    JAXBContext jc = JAXBContext.newInstance("rent");
    Unmarshaller um = jc.createUnmarshaller();
    StringBuffer xmlStr = new StringBuffer(buf1);
    System.out.println("buf = " + buf1);
    Object root = um.unmarshal(new StreamSource (new StringReader(xmlStr.toString())));
    //* Unmarshall a file
    JAXBContext jc = JAXBContext.newInstance("rent");
    Unmarshaller um = jc.createUnmarshaller();
    String fs = System.getProperty("file.separator");
    String xmlpath = "C:\\Jdev10g\\jdev\\mywork\\Rules\\rent\\data" + fs + "singlecarrental.xml" ;
    Object root = um.unmarshal(new File(xmlpath));
    //load dictionary
    String repoPath = "C:\\Jdev10g\\jdev\\mywork\\Rules\\rent\\dict" + fs + "CarxmlRepository";
    final String jarstoreKey = "oracle.rules.sdk.store.jar";
    // file based repository
    RepositoryType jarType = RepositoryManager.getRegisteredRepositoryType( jarstoreKey );
    RuleRepository repo = RepositoryManager.createRuleRepositoryInstance( jarType );
    //fill in init property values
    RepositoryContext jarCtx = new RepositoryContext();
    jarCtx.setProperty( oracle.rules.sdk.store.jar.Constants.I_PATH_BASE, repoPath );
    //init the repository instance. If the init is successful,
    //we shall get a useable repository instance
    repo.init( jarCtx );
    RuleDictionary dict = repo.loadDictionary( "RobFileXML", "INITIAL" );
    //init a rule session
    String rsname = "vehicleRent";
    String dmrl = dict.dataModelRL();
    String rsrl = dict.ruleSetRL( rsname );
    RuleSession session = new RuleSession();
    session.executeRuleset( dmrl );
    session.executeRuleset( rsrl );
    List argList = new ArrayList(3);
    argList.add( "rent" );
    argList.add( root );
    argList.add( "//*" );
    session.callFunctionWithArgumentList( "assertXPath", argList );
    return ("Klaar, resultaat = " + session.callFunctionWithArgument( "run", rsname )).toString();
    catch( Throwable t )
    t.printStackTrace();
    return t.getMessage() + " Buf1 = " + buf1;
    public String version() {
    return "1.0";
    As stated above: if I unmarshal the file all goes well.
    Any help would be greatly appreciated
    Regards, Rob

    Yes, you cannot do that work outside of a function. This is
    because of the way mxml is generated into AS and compiled.
    Declare the variable in instance scope as you have it, but do
    the assignment in a function called by the Application initialize
    or creationComplete event,
    Tracy

  • Using objects rather than jdbc resultset to fill reports

    Hi buddies!
    I�m developing a small sample of application that generates reports using values retrieved from objects.
    The idea is simple, I have an arraylist of objects and want to fill my report which these objects atributes.
    Jasper Project API has a class called JasperFillManager which is used to fill reports and takes 3 arguments, for instance:
    JasperFillManager.fillReport(JasperReport reporttofill,HashMap parameters, JRDataSource dataSource)
    I�ve created a custom JRDataSource named fonteDadosJasperCustomizada
    This class implements an arraylist of objects and two methods from the interface JRDataSource which are responsible for giving the values to fill the report. This class doesn�t take values from a resultset! ;)
    but for some reason nothing appears to me after executing the application... everything is alright I think the might be a mistake in the interface methods, the report also is alright.
    All sugestions are welcome
    thanks
    import java.sql.*;
    import java.util.HashMap;
    import java.util.Map;
    import net.sf.jasperreports.engine.JasperCompileManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.JasperReport;
    import net.sf.jasperreports.engine.design.JasperDesign;
    import net.sf.jasperreports.engine.xml.JRXmlLoader;
    import net.sf.jasperreports.view.JasperViewer;
    public class relatorioteste1{
         public relatorioteste1(){
         try{     
              fonteDadosJasperCustomizada fonte = new fonteDadosJasperCustomizada();
              JasperDesign relatoriocarregado = JRXmlLoader.load("c:/relatorioteste1.jrxml");          
              JasperReport relatoriocompilado = JasperCompileManager.compileReport(relatoriocarregado);
              /*the parameter fonte being passed to fillManager is a custom JRDataSource.
              * The default JRResultSetDataSource only receives a JDBC ResultSet and
              * extracts Data from it to fill the Report, such Object is implements
              * the JRDataSource interface which defines methods that are used by
              * fillManager to obtain data from the ResultSet.
              * My intention is to create my own JRDataSource class which should
              * be able to retrieve data from objects instead of ResultSet
              * See class fonteDadosJasperCustomizada for details
              JasperPrint relatorioimpresso = JasperFillManager.fillReport(relatoriocompilado,new HashMap(),fonte);
              JasperViewer.viewReport(relatorioimpresso);
         catch(Exception e){
              javax.swing.JOptionPane.showMessageDialog(null, e.getMessage());
         public static void main(String args[]){
              new relatorioteste1();
    import net.sf.jasperreports.engine.JRDataSource;
    import net.sf.jasperreports.engine.JRException;
    import net.sf.jasperreports.engine.JRField;
    import java.util.ArrayList;
    public class fonteDadosJasperCustomizada implements JRDataSource {
         public Object getFieldValue(JRField arg0) throws JRException{
         /*The following line returns the next object(aluno) from
         * the arraylist collection
              Aluno aluno = (Aluno) dados.listIterator().next();
         /*This block verifies which column value(field) is being
         * requested by the jasperFillManager.fillReport and returns
         * an object value corresponding to the field
              if ("codigo".equals(arg0.getName()))
                   return Integer.valueOf(aluno.getCodigo());
              else if ("nome".equals(arg0.getName()))
                   return aluno.getNome();
              else
                   return Integer.valueOf(aluno.getIdade());     
              public boolean next() throws JRException{
              /*this decision verifies if there�re more elements in
              * the arraylist collection if so returns true... else returns
              * false
              if (dados.listIterator().hasNext())
                   return true;
              else
                   return false;
         public fonteDadosJasperCustomizada(){
              /*The constructor of my custom JRResulSetDataSource should receive
              * a JDBC ResultSet in place of an Arraylist of Objects
              * The atributes of each object is mapped to a field in
              * jasperreports template
              dados = new ArrayList();
              dados.add(new Aluno(1,"charlles cuba",25));
              dados.add(new Aluno(2,"Maicom napolle",25));
              dados.add(new Aluno(3,"Gustavo castro",21));          
         public static void main(String args[]){
              new fonteDadosJasperCustomizada();
         ArrayList dados;     
    }

    Buddies thansk everyone
    I�m really grateful... the previous post in here was very useful to me. I
    was wrong about ArrayList.listIterator.
    I finnaly generated a report from an arraylist of objects.
    Here�s the code... I made some changes the first one was wrong
    HERE IS MY MAIN CLASS RESPONSIBLE FOR GENERATING THE REPORT
    public class relatorioteste1{     
         public relatorioteste1(){
              try{     
                   fonteDadosJasperCustomizada fonte = new fonteDadosJasperCustomizada();
                   JasperDesign relatoriocarregado = JRXmlLoader.load("c:/relatorioteste1.jrxml");          
                   JasperReport relatoriocompilado = JasperCompileManager.compileReport(relatoriocarregado);                    
                   JasperPrint relatorioimpresso = JasperFillManager.fillReport(relatoriocompilado,new HashMap(),fonte);
                   JasperViewer.viewReport(relatorioimpresso);
              catch(Exception e){
                   javax.swing.JOptionPane.showMessageDialog(null, e.getMessage());
         public static void main(String args[]){
              new relatorioteste1();
    HERE IS MY CUSTOM JRDATASOURCE
    public class fonteDadosJasperCustomizada implements JRDataSource {
         public Object getFieldValue(JRField arg0) throws JRException{     
              if ("codigo".equals(arg0.getName()))
                   return Integer.valueOf(aluno.getCodigo());
              else if ("nome".equals(arg0.getName()))
                   return aluno.getNome();
              else
                   return Integer.valueOf(aluno.getIdade());
         public boolean next() throws JRException{
              if (iterator.hasNext()){
                   aluno = (Aluno) iterator.next();                    
                   return true;
              else
                   return false;          
         public fonteDadosJasperCustomizada(){          
              dados = new ArrayList();
              dados.add(new Aluno(1,"charlles cuba",25));
              dados.add(new Aluno(2,"Maicom napolle",25));
              dados.add(new Aluno(3,"Gustavo castro",21));
              iterator = dados.listIterator();
         public static void main(String args[]){
              new fonteDadosJasperCustomizada();
         ArrayList dados;
         Iterator iterator;
         Aluno aluno;
    }

  • Is it possible to receive answers in a completed form like a pdf rather than a database?

    This may be a rather odd question, but a client would need to receive answers in a format that can be saved as a record. For example if the user were to fill in the form on paper there would be a hard copy of the questions and their answers. Would this be possible with FormCentral? Could this be received as an attachment in a notification?

    I don't know if it is the best solution but you could filter the results to just that client's answers on the summary tab and then PDF that.

  • How to update Business Object,  rather than doing a final commit?

    Hello experts,
    I have the following <u>java web dynpro</u> code:
    What I am trying to do is to access a business object through my code. The business object has got a root node and a child node called 'version'. And the association is 1:n. I want to create 1 root node and corresponding to that, I want to create few child nodes. But the code dumps at the place where i do the child node navigation. Here is the code.
    IPatternTransaction transaction = IExternalITransaction.WD.cast(patternRtApi.
                     getSingleton(IPatternRtApi.TRANSACTION).getInterfaceController()).getApi();
    IServiceFacade serviceFacade =   (IServiceFacade)transaction.getConnectionFacade();
    IESRName esrName2 = ESRNameFactory.createESRName(<boName>,<namespace>);
    IBOModel model2 = getMyServiceFacade().getBOModel(esrName2);
    IQuery executeQuery2 = model2.createQuery(<node>,<query>);
    executeQuery2.execute();
    IBONode doNode = executeQuery2.getResultBONode();
    IBONodeElement ne1 = doNode.createBONodeElement();
    ne1.setAttributeValue(<attributeName>,new CctCode("E",null,null,null,null,null));
    <b>IBONode doVer = ne1.getAssociatedBONode("Version");</b>
    The last line of the code, I'm getting an error message saying that navigation is not allowed using local key. I know the reason for the error. The reason is when we just create the node element 'ne1', it doesn't create the 'UUID' for the record and record with UUID only allows to navigation to child node, say 'Version' node here. UUID gets generated only when you do an update or save. But I don't want to use the save function since i don't want a final commit on the transcation. But I want the UUID to get generated. Is there any method just to update the record in the backend Business Object and generate the UUID without doing a final commit.
    I tried functions like refresh, check, isdirty available on 'ne1' and 'doNode'; but that didn't solve the problem. I even tried flush() function provided by the service facade, which generates only a local IKey and not the UUID. But I want the UUID to be generated somehow not doing a final commit.
    Any kind of help is highly appeciated.
    NB: Mega bonus points for any helpful answers.
    Regards,
    Sudeep.

    Hello experts,
    I have the following <u>java web dynpro</u> code:
    What I am trying to do is to access a business object through my code. The business object has got a root node and a child node called 'version'. And the association is 1:n. I want to create 1 root node and corresponding to that, I want to create few child nodes. But the code dumps at the place where i do the child node navigation. Here is the code.
    IPatternTransaction transaction = IExternalITransaction.WD.cast(patternRtApi.
                     getSingleton(IPatternRtApi.TRANSACTION).getInterfaceController()).getApi();
    IServiceFacade serviceFacade =   (IServiceFacade)transaction.getConnectionFacade();
    IESRName esrName2 = ESRNameFactory.createESRName(<boName>,<namespace>);
    IBOModel model2 = getMyServiceFacade().getBOModel(esrName2);
    IQuery executeQuery2 = model2.createQuery(<node>,<query>);
    executeQuery2.execute();
    IBONode doNode = executeQuery2.getResultBONode();
    IBONodeElement ne1 = doNode.createBONodeElement();
    ne1.setAttributeValue(<attributeName>,new CctCode("E",null,null,null,null,null));
    <b>IBONode doVer = ne1.getAssociatedBONode("Version");</b>
    The last line of the code, I'm getting an error message saying that navigation is not allowed using local key. I know the reason for the error. The reason is when we just create the node element 'ne1', it doesn't create the 'UUID' for the record and record with UUID only allows to navigation to child node, say 'Version' node here. UUID gets generated only when you do an update or save. But I don't want to use the save function since i don't want a final commit on the transcation. But I want the UUID to get generated. Is there any method just to update the record in the backend Business Object and generate the UUID without doing a final commit.
    I tried functions like refresh, check, isdirty available on 'ne1' and 'doNode'; but that didn't solve the problem. I even tried flush() function provided by the service facade, which generates only a local IKey and not the UUID. But I want the UUID to be generated somehow not doing a final commit.
    Any kind of help is highly appeciated.
    NB: Mega bonus points for any helpful answers.
    Regards,
    Sudeep.

  • Getting my query_only forms to populate  on_load rather than F8

    Hello there,
    I have created a main menu with buttons which opens up each and every form.
    call_form(getpath||'form_name');
    When a form loads up, i still have to press F8 before records are populated into it.
    Is there a code that I have not included somewhere?
    Much appreciation in advance.
    Ayo

    You can put an "execute_query"
    into a "When-New-Form-Instance" trigger in the loaded form to get it to execute the query to display when the form is loaded

  • Using Convert to handle NULL values for empty Strings ""

    After having had the problem with null values not being returned as nulls and reading some suggestion solution I added a converter to my application.
      <converter>
        <converter-id>NullStringConverter</converter-id>
        <converter-for-class>java.lang.String</converter-for-class>
        <converter-class>com.j2anywhere.addressbookserver.web.NullStringConverter</converter-class>
      </converter>
    ...I then implemented it as follows:
      public String getAsString(FacesContext context, UIComponent component, Object object)
        System.out.println("Converting to String : "+object);
        if (object == null)
          System.out.println("READING null");
          return "NULL";
        else
          if (((String)object).equals(""))
            System.out.println("READING null (Second Check)");
            return null;       
          else
            return object.toString();
      public Object getAsObject(FacesContext context, UIComponent component, String value)
        System.out.println("Converting to Object: "+value+"-"+value.trim().length());
        if (value.trim().length()==0 || value.equals("NULL"))
          System.out.println("WRITING null");
          return null;
        else
          return value.toUpperCase();
    ...I can see that it is converting my values, however the object to which the inputText fields are bound are still set to empty strings ""
    <h:inputText size="50" value="#{addressBookController.contactDetails.information}" converter="NullStringConverter"/>Also when reading the object values any nulls are already converted to empty strings before ariving at the converter. It seems that there is a default converter handling string values.
    How can I resolve this problem as set nulls when the input value is an empty string other then checking every string in my class individually. I would really hate to pollute my object model with empty string tests.
    Thanks in advance
    Edited by: j2anywhere.com on Oct 19, 2008 9:06 AM

    I changed my converter as suggested :
      public Object getAsObject(FacesContext context, UIComponent component, String value)
        if (value == null || value.trim().length() == 0)
          if (component instanceof EditableValueHolder)
            System.out.println("SUBMITTED VALUE SET TO NULL");
            ((EditableValueHolder) component).setSubmittedValue(null);
          else
            System.out.println("COMPONENT :"+component.getClass().getName());
          System.out.println("Converting to Object: " + value + "< to " + null);
          return null;
        System.out.println("Converting to Object: " + value + "< to " + value);
        return value;
      }which produces the following output :
    SUBMITTED VALUE SET TO NULL
    Converting to Object: < to null
    Info : The INFO line however comes from my controller object where I print out the set value :
    package com.simple;
    import java.util.ArrayList;
    import java.util.List;
    public class Controller
      private String information;
      /** Creates a new instance of Controller */
      public Controller()
        System.out.println("Createing Controller");
        information = "Constructed";
      public String process()
        System.out.println("Info : "+getInformation());
        return "processed";
      public String reset()
        setInformation("Re-Constructed");
        System.out.println("Info : "+getInformation());
        return "processed";
      public String setNull()
        setInformation(null);
        System.out.println("Info : "+getInformation());
        return "processed";
      public String getInformation()
        return information;
      public void setInformation(String information)
        this.information = information;
    }I also changes my JSP / JSF page a little. Here is the updated version
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%--
        This file is an entry point for JavaServer Faces application.
    --%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
      </head>
      <body>
        <f:view>
          <h:form>
            <h:inputText id="value" value="#{Controller.information}"/>
            <hr/>
            <h:commandLink action="#{Controller.process}">
              <h:outputText id="clicker" value="Process"/>
            </h:commandLink>             
            <hr/>
            <h:commandLink action="#{Controller.reset}">
              <h:outputText id="reset" value="Reset"/>
            </h:commandLink>             
            <hr/>
            <h:commandLink action="#{Controller.setNull}">
              <h:outputText id="setNull" value="Set Null"/>
            </h:commandLink>             
          </h:form>
        </f:view>
      </body>
    </html>The converter is declared for the String class in the faces configuration file. From the log message is appears to be invoked, however the object is not set to null.
    I tested this with JSF 1.2_04-b20-p03 as well as 1.2_09-b02-FCS.
    any other suggestions what could be causing this.

  • Differnce between null string and an empty string??

    what is the major difference between null string and an empty string??
    I wrote the following simple program and I could see some different output.
    Other than that, any other differences that we should pay attention to???
    C:\>java TestCode
    Hello
    nullHello
    public class TestCode
         public static void main(String[] s)
         {     String s1 = "";
              String s2 = null;
              System.out.println(s1 + "Hello");
              System.out.println(s2 + "Hello");
    }

    There's a big difference between the two. A null String isn't pointing to an object, but an empty String is. For example, this is perfectly fine:
    public class TestCode
        public static void main(String[] args)
            String s = "";
            System.out.println(s.length());
    } It prints out 0 for the length of the String, just as it should. But this code will give you a NullPointerException:
    public class TestCode
        public static void main(String[] args)
            String s = null;
            System.out.println(s.length());
    } Since s isn't pointing to anything, you can't call its methods.

  • Checking an object in Arraylist against empty string

    Hi all,
    Im storing a collection of objects in Arraylist.Among them , one of the objects has an empty string.How can i check whether an object contains empty string.I tried to check using the follwing snippet:
    ArrayList idList=new ArrayList();
    if((idList.get(0)) == null || idList.get(0) == "")
            Debug.log("*****ARRAY LIST IS BLANK 1********");Please help

    Here is a bit more deeper code:
    HashMap lookupMap= null;
    try {
              Object obj = util.lookUp(pid,attributeId,params); // The lookUp method returns an object.
                 Debug.log(11, " obj type: " + obj.getClass().getName());
            lookupMap = (HashMap) obj;
    Collection mapkeys = lookupMap.keySet();
    Iterator itKeySet = mapkeys.iterator();
    ArrayList idList = new ArrayList();
    ArrayList descList = new ArrayList();
    ArrayList lookupKeys = new ArrayList();
    while(itKeySet.hasNext())
            lookupKeys.add(itKeySet.next());
    for(int i=0; i<lookupKeys.size(); i++)
            String key = (String)lookupKeys.get(i);
        if(key != null && key.startsWith("1_"))
              idList =(ArrayList)lookupMap.get(lookupKeys.get(i));
            if(key != null && key.startsWith("2_"))
              descList=(ArrayList)lookupMap.get(lookupKeys.get(i));
            if(key != null && key.startsWith("1_") && (size == 1))
               descList=(ArrayList)lookupMap.get(lookupKeys.get(i));
    ArrayList id1=new ArrayList();
    int x=0;
          do
         if(!(idList.get(x)).equals(null) || !(idList.get(x)).equals(""))
                    id1.add(idList.get(x));
                    Debug.log("*****idList.get(x)********"+idList.get(x));
                    Debug.log("*****added to idlist.get(0)********");
                    break;
                  else
                    x++;
         }while(id1.size() == 0);

  • (261718088) Q: Can you use xm:multiple with Objects other than String?

    Q: Can you use xm:multiple with Objects other than Strings?
    <br>
    A: You bet. Attached find a text file with some code from the example I showed
    today, a version of the multipleSayHiTo() method that has a parameter of an Array
    of Person objects rather than a parameter of an Array of Strings. The code within
    the text file comes from the Greeting.jws file (the Greeting Web Service).
    [multiple.txt]

    So you are saying that the recovery discs I made do include the copy of windows that was originally installed?
    Absolutely! They will restore the hard disk to its original out-of-the-box contents. Follow the instructions in the section Restoring from recovery DVDs/media, which begins on p. 73 of the User's Guide.
       Satellite A660 Series User’s Guide
    maybe i can make a deal with wd to have them swap this drive out for the BEKT instead...
    That would be a good idea in any case.
    As I said, the 10-fc12-045d error would not be due to the drive's being AFT, but more likely the discs are not being read properly. New discs can be obtained from Toshiba. Scroll down to Get Recovery Media here
    -Jerry

  • Problem: textbox leave empty string("") instead of null

    Hello, I have a problem with textboxes. By default, they always are initialized to null, but when I start entering and removing data from textboxes, many times they leave an empty string "" instead of null.
    And, of course, it's not the same a null value as an empty string and thus, I haven't got the expected result in queries to database.
    Thus, I always have to compare textbox values with "" and null. It's very tedious and not elegant solution. I would like to know if there is another way to get the values as null instead of empty strings.

    Yes. Once you entered and remove the text it will evaluated as you told .
    For ur case u can Try the condition as
    if ( instance !=null && instance.length !=0)
    be sure instance != null check b4 other wise u can get NullPointerException

  • How to make result of form post to jsp to appear in child frame

    Two frames inside a frameset, A and B (A is the first frame, B is the second). A has as it's source an html page containing a form with a submit button. The form posts to a jsp called Content.jsp. Works great, except: I want the results returned by Content.jsp to appear inside frame B. Seems like I've got the target for the form inside A wrong somehow, because when I click the submit button inside frame A, my results appear in a new browser instance, rather than inside B. Here's what the form declaration looks like:
    <form action="Content.jsp" method="post" target="_parent.frames[1]">
    If I make the target parent, that obviously replaces the whole page. If I make the target self, that obviously replaces the contents of frame A. I want to replace the contents of frame B. Any ideas?

    Thanks, but I'm not using IFrame, just Frame and FrameSet. In any event, I have tried using the name attribute to no avail. Here's a really simple version of the code:
    //Parent frameset
    <frameset rows="50%,50%">
    <frame name="A" src="testSubmit.html">
    <frame name="B" src="">
    </frameset>
    //Here's the form in testSubmit.html
    <form ACTION="testResult.html" METHOD="POST" TARGET="_parent.B">
    <input TYPE="SUBMIT" VALUE="Click Me">
    </form>
    I've also tried TARGET="_parent.frames[1]" with the same result -- a new browser window is launched rather than the results being displayed in B.
    Thanks for any assistance.

Maybe you are looking for

  • How do I stop Win7 from breaking my software? Ole32.dll and "Power" service suspected culprits.

    Hello and thanks for any help with this. I built a new computer for my aunt and her one major request is that she still be able to use her card maker software Creatacard (yes misspelled just like that) by American Greetings. I thought this would be n

  • Continue to get this error message when i open premiere elements 12 HELLLLP!!!!

    A problem caused this program to stop interacting with Windows. Problem signature:   Problem Event Name:          AppHangB1   Application Name:          Adobe Premiere Elements.exe   Application Version:          12.0.0.0   Application Timestamp:    

  • Issue with ADDENDA for ACH CCD

    Hi All, We need to display the addenda record for each vendor (Example invoice details). However, the file that we are able to generate shows this data only if there is one invoice per vendor in the payment run (REGUH-RPOST = 1). We need to know if t

  • Question about start-up screen oddities

    Hey guys, Quick question: my iMac G5, when starting up in Leopard, doesn't just pop-up the gray loading screen like my macbook- it "rolls" down the screen twice (like a push transition) before appearing. It's quite odd. I don't notice too many other

  • [weblogic 8.1-sp4] taglibs not allowed any other place then under WEB-INF?

    i pack my application as EAR with several skinny WARs + JAR libs under "lib" directory of EAR (and ofc WARs have their manifest adjusted to point to those). standard.jar is also there, no web.xml definition of the taglibs. when i deploy the EAR, any