Disable ADF Client and Server side validation during drop down changes

In my ADF Faces there is PanelFormLayout containing dropdown with country code value. Changing the dropdown value should change the layout to different country.
If the data is proper in the form the Layout changes perfectly but if the data is not proper it gives client validation & the layout doesn't get changed.
I want to disable the client/server side validation while changing the dropdown.

Hi Just framing the Question once again -
In my ADF Faces there is PanelFormLayout containing dropdown with country code value. Changing the dropdown value should change the layout to different country.
If the data is proper in the form, the Layout changes perfectly but if the data is not proper it gives client validation & the layout doesn't get changed.
I want to disable the client side validation just for that page or panelformLayout
Issue -
If the data is incorrect on the form, user is able to change the countrycode from the dropdown but the layout doesn't changes because client validation is stopping.
Below is the code -
1) Changing the drop down cause the switcher to call the code - defaultFacet="#{backingBeanScope.AddressComp.displayType}" which changes the layout.
2) But if the data is not correct the country value is getting change with the new Country but the Layout is unable to get change. ADF start showing client validation.
<af:panelGroupLayout id="pglA1" partialTriggers="plcol1:table1 *usCountryId caCountryId*">
     <af:switcher binding="#{backingBeanScope.AddressComp.switcherComp}" defaultFacet="*#{backingBeanScope.AddressComp.displayType}*">
          <f:facet name="US">
               <af:panelFormLayout>
                    <af:selectOneChoice value="#{bindings.CntryCd.inputValue}" label="#{bindings.CntryCd.label}" required="#{bindings.CntryCd.hints.mandatory}"
     id="usCountryId" autoSubmit="*true*">
                    <f:selectItems value="#{bindings.CntryCd.items}" id="si14"/>
               </af:selectOneChoice>
               </af:panelFormLayout>
          </f:facet>
          <f:facet name="CA">
                    <af:panelFormLayout>
                    <af:selectOneChoice value="#{bindings.CntryCd.inputValue}" label="#{bindings.CntryCd.label}" required="#{bindings.CntryCd.hints.mandatory}"
     id="caCountryId" autoSubmit="true">
                    <f:selectItems value="#{bindings.CntryCd.items}" id="si14"/>
               </af:selectOneChoice>
          </af:panelFormLayout>
          </f:facet>
     </af:switcher>
</af:panelGroupLayout>

Similar Messages

  • UIX - unable to turn off client and server side field validation

    Hello,
    I've scoured the forums for info on how to turn off client / server side field validation, for the very common case of a Cancel button. Here's the use case:
    User enters a page displaying records of some kind that can be edited, or an option to create a new one. User clicks create, is taken to a new data entry form. Before entering any data, the user decides he isn't interested, and clicks the cancel button.
    The problem I'm having is that I'm getting messages that required fields have no values. I have found several references on this forum that setting the submitButton attribute unvalidated="true" will turn off client side validation. Here's what my submitButton looks like:
    <submitButton text="Cancel" event="success" unvalidated="true"/>
    But I am still getting errors, such as:
    JBO-27014: Attribute ListName in DealerListAppModule.WebDlrListsView1 is required
    Now I have also seen references in the forums to turning off server side validation by overriding the validatModelUpdates method in the DataAction. I have done this too. No luck.
    Any ideas why this isn't working? I have seen other posts in the forums stating that there were improvements in JDev 10.1.2 that caused a create but not insert, where you could just navigate away from the page you were on, without having to worry about rolling back the create of a new record. I am also not seeing this behavior either. I am using 10.1.2, completely updated, but when I execute a create, if I navigate back from the create page to the original one without saving (i had to fool with this to get it to work because of the validation problems above), I am still seeing the blank, created record in my rowset. I originally created my project in 9.0.5.2, but am now using 10.1.2, and having migrated the project.
    So what's the deal? What's the definitive way to turn off both client side and server side validation, and what's the status of this create but not insert functionality?
    Brad

    Haven't worked with this but possibly this method of "deactivation" is not valid in 11gR2? Have you cross checked that with Oracle support?

  • Simultaneous Client and Server Form Validation using Custom Tag Library

    I am developing a custom tag library for validator tags
    which are capable of doing client side validation (Javascript)
    and server side (Java). My problem is with the development
    of a regular expression based validator. Because of differences
    in the way Javascript and Java handle regular expressions
    i can not use the same regular expression for both types of
    validation. Is there any way to convert a valid regular
    expression from the java.util.regex format into the Javascript
    format or vice versa? My major problems are with the (or, ||)
    statements and the user of backslashes.

    If you are speaking of RE syntax flavours, they are basically the same(namely perl5 flavour). Any expression that works in JS should work in j.u.regex too.
    Though, their usage is quite different.
    So, there is no need for convertion of expressions.
    But porting the code may be not so trivial.

  • Client side load balancing and server side load balancing

    Hello Team,
    I need to know how to set up client and server side load balancing in oracle rac.  What all things to be implemented like creating a service, tnsnames.ora settings etc.
    And also if i used SCAN ip instead of VIP. how the settings will change.
    Regards,

    Hi,
    please find here an Whitepaper with the information
    http://www.oracle.com/technetwork/database/features/availability/maa-wp-11gr2-client-failover-173305.pdf
    kind regards

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • [ASK] Duplicated Error Message on server side validation

    I want to use server-side validation instead of client-side validation for my input form as suggested by John Stageman, by:
    1). set required=false
    2). set showRequired=true
    3). Ensure that the attribute is mandatory in the model layer
    It seems to work, except that the error message displayed by <af:messages> is kinda weird bcause they are repeated, for example;
    Attribute Attr1 in MyAM.MyView is required
    Attribute Attr2 in MyAM.MyView is required
    - Attribute Attr1 in MyAM.MyView is required
    - Attribute Attr2 in MyAM.MyView is required
    Attribute Attr1 in MyAM.MyView is required
    Attribute Attr2 in MyAM.MyView is requiredand the number of reduplication seems growing each time I click the Save button.
    besides, for "value required" validation, the component related error message is not displayed (the red message under the component).
    Any clues?
    Thanks..
    @John : I decide to open it as new thread bcause it seems to be different question..

    Hi, thanks for your fast response Frank,
    My page has several iterator binding and I have tried to set all of their refresh options as you suggested, but the problem still remains the same T_T
    Maybe somewhere, someone has put some additional manual validation, bcause it is a team project, I still dont know where to find those phantom codes..
    Regards,
    from island of gods

  • Server side validation

    Hi I am trying to validate two forms the first form allows a customer to register if it is correctly validated then it proceeds to address form as these two tables are linked by foreign key so when u create account in one need to do it at the same time for both. I tried client side JavaScript to validate the forms which works but don t prevent the accounts from being created if wrong. This method I tried to implement:
    ackage projectshowbeans;
    import java.sql.*;
    import java.util.*;
    import java.util.HashMap;
    public class customer2 {
         private String bnDbDriver = "org.gjt.mm.mysql.Driver";
         private String bnDbId = "jdbc:mysql://localhost/c99nrdb";
         private String bnDbUser = "c99nr_web";
         private String bnDbPassword = "Thank=88";
         private String custId;
         private String bnTitle="";
         private String bnFirstName="";
         private String bnLastName="";
         private String bnType_Of_Occupation="";
         private String bnemail="";
         private String bnpassword="";
         private String bnpassword2="";
         private String bnType="";
         private String bnNumber="";
         private String bnExp_Date="";
         private String bnCardholder_Name="";
         private String bnemail2="";
         private String mostRecentDeletion = "Nothing has been deleted";
         private int validate = 0;
         private String custid="";
         private int validatem = 0;
         private HashMap validationerrors = new HashMap();
         //StringTokenizer is used to check for empty spaces as in prevents user from submitting a empty form
         //countTokens count the number of empty spaces between the words if no words no token it would be empty and validate to 0
         //otherwise it would equal 1 and the message output shall appears on the screen. To be exact as long as it count the number of whitespaces this means
         //if it is more then 1 it can be then there must be text present in the text field and thus tokens can be made.
         /*public String getIsEmpty()
              String output = "nothing";
              StringTokenizer Email = new StringTokenizer(getBnEmail());
              StringTokenizer Title = new StringTokenizer(getBnTitle());
              StringTokenizer FirstName = new StringTokenizer(getBnFirstName());
              StringTokenizer LastName = new StringTokenizer(getBnLastName());
              StringTokenizer Occupation = new StringTokenizer(getBnType_Of_Occupation());
              StringTokenizer Password = new StringTokenizer(getBnpassword() );
              StringTokenizer confirmpass = new StringTokenizer(getBnpassword2());
              StringTokenizer Numbers = new StringTokenizer(getBnNumber());
              StringTokenizer Date1 = new StringTokenizer(getBnExp_Date());
              StringTokenizer Type = new StringTokenizer(getBnType() );
              StringTokenizer cardholder = new StringTokenizer(getBnCardholder_Name());
              if (Email.countTokens() < 1 || Title.countTokens() < 1 || FirstName.countTokens() < 1 || LastName.countTokens() < 1 || Occupation.countTokens() < 1 || Password.countTokens() < 1 || confirmpass.countTokens() < 1 || Numbers.countTokens() < 1 || Date1.countTokens() < 1 || Type.countTokens() < 1 || cardholder.countTokens() < 1)
                   output = "Please fill in all fields. Thank you.";
                   System.out.println("this is empty at first attempt and then second time nothing typed");
                   validatem = 0;
                   output = "To fill in your address details proceed to this page by <a href=\"../jsp/NewAddress.jsp\"> clicking here</a>";
                   validatem = 1;
              return output ;
         public boolean isValidUserData() {
                   System.out.println(bnFirstName);     
                   return (( bnFirstName !=null) && (bnFirstName.length() >0) &&
                        (bnpassword !=null) && (bnpassword.length() != 8) &&
                        (bnpassword2 !=null) && (bnpassword2.length() != 8)&&
                        (bnemail !=null) && (bnTitle !=null) &&
                        (bnLastName != null) && (bnLastName.length() >0) &&
                        (bnType !=null) && (bnNumber !=null) &&
                        (bnExp_Date !=null) && (bnCardholder_Name != null) &&
                        (bnType_Of_Occupation !=null));
         public String getFieldError(String fieldname) {
              return ((String) validationerrors.get(fieldname));
         public void addFieldError(String fieldname, String error) {
              validationerrors.put(fieldname, error);
         public boolean validateCustomer() {
              validationerrors.clear();
              boolean valid = true;
              if ((bnemail == null) ||
                   (bnemail.length() == 0)) {
                   addFieldError("frmemail", "email address is required.");
                   valid = false;
              } else {
                   if (bnemail.indexOf("@")== -1) {
                        addFieldError("email", "please supply a valid address");
                        valid =false;
              if ((bnpassword == null) ||
                   (bnpassword.length() != 8)) {
                   addFieldError("frmpassword", "Password is required.");
              return valid;
    if(form1.frmpassword.value.length != 8 )
                        //alert(form1.frmpassword);
                        alert("Password must be eightt characters long");
                        form1.frmpassword.focus();
                        form1.frmpassword.select();
                        return(false);
                   else
                        if(form1.frmpassword2.value != form1.frmpassword.value)
                             alert("The confirmation password does not match the original password");
                             form1.frmpassword2.focus();
                             form1.frmpassword2.select();
                             return(false);
              </SCRIPT>
              <% if (request.getParameter("SUBMITTED") != null) {
                   try {
                        if (newcust.validateCustomer()) {
                             newcust.createcustomer();
                             response.sendRedirect("NewSuccess1.jsp");
                   } catch (Exception e){
                        //System.out.println("customer2.JSP:" + e);
                        newcust.addFieldError("frmemail", "email already in use");
              if (newcust.getBnEmail() == null) {
                   newcust.setBnEmail(" ");
              if (newcust.getBnpassword() == null) {
                   newcust.setBnpassword("");
              %>
              <TITLE>
                   Create New Customer Account
              </TITLE>
         </HEAD>
         <BODY>
              <table border ="0" width="100%" bgcolor="#BDC6DE">     
                   <tr>
                        <td>
                             <jsp:include
                                  page="main menu 2.jsp"
                                  flush="true"
                                  />
                             <td>
                             </tr>
                             <Form method="post" action="NewSuccess1.jsp" id="form1" name="form1" return onsubmit="validation()"> <%--post prevents the variable being passed in the url--%>
                                  <input type="Hidden" name="SUBMITTED" Value="T">
                                  <table border ="1">
                                       <tr>
                                            <%--/*if (newcust.getFieldError("frmemail") != null) {%>
                                            <%//newcust.getFieldError("frmemail")%></font><br></td>*\--%>
    Java methods aree fine but when I try to access these ion the JSP page it fucks up I can t see how to resolve the issues can anyone help ?

    Hi the code that I showed you was on two separate pages one in the java file where I have tried numerous methods at server side validation
    e.g.
    private int validate = 0;
    //StringTokenizer is used to check for empty spaces as in prevents user from submitting a empty form
         //countTokens count the number of empty spaces between the words if no words no token it would be empty and validate to 0
         //otherwise it would equal 1 and the message output shall appears on the screen. To be exact as long as it count the number of whitespaces this means
         //if it is more then 1 it can be then there must be text present in the text field and thus tokens can be made.
         /*public String getIsEmpty()
              String output = "nothing";
              StringTokenizer Email = new StringTokenizer(getBnEmail());
              StringTokenizer Title = new StringTokenizer(getBnTitle());
              StringTokenizer FirstName = new StringTokenizer(getBnFirstName());
              StringTokenizer LastName = new StringTokenizer(getBnLastName());
              StringTokenizer Occupation = new StringTokenizer(getBnType_Of_Occupation());
              StringTokenizer Password = new StringTokenizer(getBnpassword() );
              StringTokenizer confirmpass = new StringTokenizer(getBnpassword2());
              StringTokenizer Numbers = new StringTokenizer(getBnNumber());
              StringTokenizer Date1 = new StringTokenizer(getBnExp_Date());
              StringTokenizer Type = new StringTokenizer(getBnType() );
              StringTokenizer cardholder = new StringTokenizer(getBnCardholder_Name());
              if (Email.countTokens() < 1 || Title.countTokens() < 1 || FirstName.countTokens() < 1 || LastName.countTokens() < 1 || Occupation.countTokens() < 1 || Password.countTokens() < 1 || confirmpass.countTokens() < 1 || Numbers.countTokens() < 1 || Date1.countTokens() < 1 || Type.countTokens() < 1 || cardholder.countTokens() < 1)
                   output = "Please fill in all fields. Thank you.";
                   System.out.println("this is empty at first attempt and then second time nothing typed");
                   validatem = 0;
                   output = "To fill in your address details proceed to this page by <a href=\"../jsp/NewAddress.jsp\"> clicking here</a>";
                   validatem = 1;
              return output ;
    This method works it counts the empty spaces and if any it does not allow the user to proceed to same page but if correct it goes to the same page but show all their answers filled using jsp:get Property and then the link above to the other form to fill in the code. However no indivdual messages can be passed to the user which is crap as the people keeps pressing he won t know what is wrong.
    The method that I am currently using is this one:
         public boolean isValidUserData() {
                   System.out.println(bnFirstName);     
                   return (( bnFirstName !=null) && (bnFirstName.length() >0) &&
                        (bnpassword !=null) && (bnpassword.length() != 8) &&
                        (bnpassword2 !=null) && (bnpassword2.length() != 8)&&
                        (bnemail !=null) && (bnTitle !=null) &&
                        (bnLastName != null) && (bnLastName.length() >0) &&
                        (bnType !=null) && (bnNumber !=null) &&
                        (bnExp_Date !=null) && (bnCardholder_Name != null) &&
                        (bnType_Of_Occupation !=null));
    again this method is held in the Java file. This works the best as it checks for empty spaces however the password verification it does not do check whether password 1 matches password 2 nor the fact that password should be 8 characters only or check whether the user is typing in an integer or not etc. I can do this in JavaScript the integer one I am not sure. I then use JSP page which is this below:
    <jsp:useBean
         id="newcust"
         scope="session"
         class="projectshowbeans.customer2"
         />
    <!--
    <jsp:useBean
         id="newaddress"
         scope="page"
         class="projectshowbeans.Address"
         />
    <jsp:setProperty
         name="newaddress"
         property="bnemail"
         param="frmemail"
         />
    -->
    <jsp:setProperty
         name="newcust"
         property="bnEmail"
         param="frmemail"
         />
    <jsp:setProperty
         name="newcust"
         property="bnFirstName"
         param="frmFirstname"
         />
    <jsp:setProperty
         name="newcust"
         property="bnLastName"
         param="frmLastname"
         />
    <jsp:setProperty
         name="newcust"
         property="bnType"
         param="frmtype"
         />
    <jsp:setProperty
         name="newcust"
         property="bnTitle"
         param="frmtitle"
         />
    <jsp:setProperty
         name="newcust"
         property="bnCardholder_Name"
         param="frmcard"
         />
    <jsp:setProperty
         name="newcust"
         property="bnExp_Date"
         param="frmDate"
         />
    <jsp:setProperty
         name="newcust"
         property="bnNumber"
         param="frmnumber"
         />
    <jsp:setProperty
         name="newcust"
         property="bnExp_Date"
         param="frmDate"
         />
    <jsp:setProperty
         name="newcust"
         property="bnpassword2"
         param="frmpassword2"
         />
    <jsp:setProperty
         name="newcust"
         property="bnpassword"
         param="frmpassword"
         />
    <jsp:setProperty
         name="newcust"
         property="bnType_Of_Occupation"
         param="frmoccupation"
         />
    <html>
         <HEAD>
              <SCRIPT language="JavaScript" type="text/javascript">
              /*function validation() {
                        if(form1.frmnumber.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the number field. Thank you");
                             form1.frmnumber.focus();
                             return(false);
                        if(form1.frmemail.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the email field. Thank you");
                             form1.frmemail.focus();
                             return(false);
                        if(form1.frmtitle.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the title field. Thank you");
                             form1.frmtitle.focus();
                             return(false);
                        if(form1.frmFirstname.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the First Name field. Thank you");
                             form1.frmFirstname.focus();
                             return(false);
                        if(form1.frmLastname.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the Last Name field. Thank you");
                             form1.frmLastname.focus();
                             return(false);
                        if(form1.frmDate.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the Exp Date field. Thank you");
                             form1.frmDate.focus();
                             return(false);
                        if(form1.frmcard.value==0)
                             //alert(form1.frmpassword);
                             alert("Please fill in the CardholderName field. Thank you");
                             form1.frmcard.focus();
                             return(false);
                        if(form1.frmpassword.value.length != 8 )
                             //alert(form1.frmpassword);
                             alert("Password must be eightt characters long");
                             form1.frmpassword.focus();
                             form1.frmpassword.select();
                             return(false);
                        else
                             if(form1.frmpassword2.value != form1.frmpassword.value)
                                  alert("The confirmation password does not match the original password");
                                  form1.frmpassword2.focus();
                                  form1.frmpassword2.select();
                                  return(false);
              </SCRIPT>
              <TITLE>
                   Create New Customer Account
              </TITLE>
         </HEAD>
         <BODY>
              <table border ="0" width="100%" bgcolor="#BDC6DE">     
                   <tr>
                        <td>
                             <jsp:include
                                  page="main menu3.jsp"
                                  flush="true"
                                  />
                             <td>
                             </tr>
              <Form method="post" action="NewSuccess.jsp"> <%--post prevents the variable being passed in the url--%>
                                  <table border="0">
                                       <tr>
                                       <td><p>Please ensure you fill in all fields below in the form. Once everything is successfully validated you will be taken to another form to fill in your address details.</p></td>
                                       </tr>
                                  <table border ="1">     
                        <tr>
                             <td>email address:</td> <td><Input Name="frmemail" Type="Text" Size="50" value='<jsp:getProperty name="newcust" property="bnEmail" />' >
    </td>
                        </tr>
                        <tr>               
                   <td>Password:</td>
                             <td><Input Name="frmpassword" Type="password" Size="50">
    </td><%--this form simply shows password and studentid type password allows it to be encoded--%>
                        </tr>
                        <tr>
                        <td>Password(Verification):</td>
                        <td><Input Name="frmpassword2" Type="password" Size="50">
    </td><%--this form simply shows password and studentid type password allows it to be encoded--%>
                   </tr>
                        <tr>
                   <td> Title:</td>
                             <td><input name="frmtitle" type="text" size="10" value='<jsp:getProperty name="newcust" property="bnTitle"/>'>
    </td>
                        </tr>
                        <tr>
                   <td>First Name:</td>
                             <td><input name="frmFirstname" type="text" size="30"value='<jsp:getProperty name="newcust" property="bnFirstName"/>'>
    </td>
                        </tr>
                        <tr>
                             <td>Surname:</td>
                             <td><input name="frmLastname" type="text" size="30" value='<jsp:getProperty name="newcust" property="bnLastName"/>'>
    </td>
                        </tr>
                        <tr>
                             <td>Occupation:</td>
                             <td><select name="frmoccupation">
                                       <option> student </option>
                                       <option> doctor </option>
                                       <option> businesman/woman </option>
                                       <option> teacher </option>
                                       <option> other </option>
                                  <jsp:getProperty name="newcust" property="bnType_Of_Occupation"/>>
                                  </select>
                             </td>
                        </tr>
                        <tr>
                             <td>Number:</td>
                             <td><input name="frmnumber" type="text" size="20" value='<jsp:getProperty name="newcust" property="bnNumber"/>'>
    </td>
                        </tr>
                        <tr>
                             <td>Type:</td>
                             <td><select name="frmtype" '<jsp:getProperty name="newcust" property="bnType"/>'>
                                  <option> Mastercard</option>
                                  <option> Visa </option>
                                  <option> Switch </option>     
                                  </select>
                             </td>
                        </tr>
                        <tr>
                             <td>exp date(DD/MM/YY):</td>
                             <td><input name="frmDate" type="text" value='<jsp:getProperty name="newcust" property="bnExp_Date"/>'>                                   
                        </tr>
                        <tr>
                             <td>cardholder name:</td>
                             <td><input name="frmcard" type="text" size="10"value='<jsp:getProperty name="newcust" property="bnCardholder_Name"/>'>
    </td>
                        </tr>
                   <tr>
                             <td><input type="submit" value="submit"></td>
                        </tr>
              </form>
              </table>
              <%
              //newcust.createcustomer();
              //newcust.getIsEmpty();
              %>
              <%--
              newaddress.createaddress();
              newaddress.createcustomerID();
              --%>          
         </Body>
    </html>
    I have cancelled the JavaScript as it does not work well with it the NewSucess page is the process page and states if all validation rules are correct carried out on the form by the boolean isValidUserData method then it will create the record in the customer table and provide a link to the following Address form. Otherwise if is false it goes to error page the code is below:
    <html>
         <HEAD>
              <TITLE>
                   Cuystomer Successfully Added
              </TITLE>
         </HEAD>
    <jsp:useBean
         id="newcust"
         scope="session"
         class="projectshowbeans.customer2"
         />
         <jsp:setProperty
              name="newcust"
              property="bnpassword"
              param="frmpassword"
              />
         <jsp:setProperty
              name="newcust"
              property="bnFirstName"
              param="frmFirstname"
    />
         <jsp:setProperty
              name="newcust"
              property="bnpassword2"
              param="frmpassword2"
              />
         <jsp:setProperty
              name="newcust"
              property="bnType_Of_Occupation"
              param="frmoccupation"
              />
         <jsp:setProperty
              name="newcust"
              property="bnNumber"
              param="frmnumber"
              />
         <jsp:setProperty
              name="newcust"
              property="bnExp_Date"
              param="frmDate"
              />
         <jsp:setProperty
              name="newcust"
              property="bnEmail"
              param="frmemail"
              />
         <jsp:setProperty
              name="newcust"
              property="bnFirstName"
              param="frmFirstname"
              />
         <jsp:setProperty
              name="newcust"
              property="bnLastName"
              param="frmLastname"
              />
         <jsp:setProperty
              name="newcust"
              property="bnType"
              param="frmtype"
              />
         <jsp:setProperty
              name="newcust"
              property="bnTitle"
              param="frmtitle"
              />
         <jsp:setProperty
              name="newcust"
              property="bnCardholder_Name"
              param="frmcard"
              />
    <BODY bgcolor="#BDC6DE">
              <%
              if (newcust.isValidUserData()) {
                   newcust.createcustomer();
              %>
              <table border ="0" width="100%" bgcolor="#BDC6DE">     
                   <tr>
                        <td>
                             <jsp:include
                                  page="main menu3.jsp"
                                  flush="true"
                                  />
                             <td>
                             </tr>
                        </table>
         <H1> Validating user data </H1>
         <H2> user data validated </h2>
              <p> To fill in your address details proceed to this page by clicking here</p>
              <% } else {
              %>
              <table border ="0" width="100%" bgcolor="#BDC6DE">     
                   <tr>
                        <td>
                             <jsp:include
                                  page="main menu3.jsp"
                                  flush="true"
                                  />
                             <td>
                             </tr>
                        </table>
                   <H1> Validating user data </H1>
              <h2> validation failed you have some missing fields</h2>
              <%}%>
    </Body>
    </html>
    Hopefully you have followed that. Ultimately if I can have it working in JavaScript that would excellent it does all form validation the previous code use saw the first JSP page however to then say only create record once I need to say function validation is validated = true then proceed to the next form else false appear with the message to the user and allow them to re - enter their answer I can t do that. I tried just putting the      
    newcust.createcustomer(); and the link to address on a separate page with String email request.getParameter("frmemail") for all of them but did not work. Hopefully you understand my dilemna more clearly now
    and can help me uinforunately I ain t got too long I need to have it done by tuesday its my final year project for my degree. Any help much appreciated.

  • JSSE  Client and server communication problem .err:untrusted server cert

    Hai all,
    I am trying to communicate JSSE client and server.
    I have created root.cert(CA),root.key,server.cert,server.key , client.cert and client.key. All these certificates are created using openssl.
    I have placed root.cert in default keystore cacerts.
    I have created a keystores(server & client) name mykeystore.
    I have placed root.cert and client.cert in the client keystore.
    I have placed root.cert and server.cert in the server keystore.
    But during the run time i am getting javax.net.ssl.SSLException: untrusted server cert chain.
    please suggest the modifications needs to be done to fix the error.
    please tell me In the client keystore and in the server keystore....what certificates we need to put?
    whether my approach as said above is correct or not?
    In java code how to specify this particular certificate we are referring?
    I have coded in this way ....
    SSLContext ctx;
    KeyManagerFactory kmf;
    KeyStore ks;
    char[] prasad = "prasad".toCharArray();
    ctx = SSLContext.getInstance("SSLv3");
    kmf = KeyManagerFactory.getInstance("SunX509");
    ks = KeyStore.getInstance("jks");
    ks.load(new FileInputStream("mykeystore"), prasad);
    kmf.init(ks, prasad);
    ctx.init(kmf.getKeyManagers(), null, null);
    factory = ctx.getSocketFactory();
    But my doubt is we are specifying only keystore name with that how it will check root.cert(ca) and client.cert and server.cert?
    Is there any modifications need in my code?
    Please tell me some way ...
    Thanks ,
    Prasad.

    Hi prasad,
    There will be a problem with the certificates being received from thr remote server or client. Check that your trust store contains the certificate of the remote machine or the CA that signed it and that the certificate has not expired.
    Also be sure that both machines are using the latest version of the JSSE.
    Hope this will help you.
    Regards,
    Anil.
    Technical Support Engineer.

  • Socket communication between client and server

    Hi all,
    I am doing an assignment for communication between java client and java server using sockets. This communication is in the form of XML documents. I am facing a problem in this communication.
    Actually at Server side I'm creating an XML document(Document type object) using DocumentBuilderFactory in javax.xml.parsers package and transforming this Document into a stream using StreamResult.
    My code is :
    Transformer xmlTransformer = TransformerFactory.newInstance().newTransformer();
    StreamResult xmlString = new StreamResult(currentClientHandler.getSocketOutputStream());
    DOMSource xmlDocSource = new DOMSource(xmlDocument); // xmlDocument is Document type reference
    xmlTransformer.transform(xmlDocSource, xmlString);
    so, this xmlString(i.e. StreamResult) is passed directly into the output stream. Here I need to close() output stream after transform() call to help SAX parser to know about end of stream.
    Now at Client side, I am parsing this stream using SAX parser. It parses this correctly. But when sending some another data back to Server when client opens output stream, it given Socket closed exception. I know that closing input or output stream closes socket. But in my problem, I have to send data in streams and not by using files or byte[] etc.
    So what is nearest solution to problem ??
    Plz help me. Any kind of help will be greatly appreciated.

    hi
    thanks for ur reply.
    I didnt get any error msg while getting the back the datas.
    Actually i divided my application into two parts.
    My application will act as both server and client.
    server ll get the browser request and send to the client and the client will send that data to the c++ server.
    Im able to do that.and unable to get the data from server.
    Didnt get any error.
    can u tell me how to make an application to act as both client and server.
    I think im wrong in that part.
    thanks a lot

  • Server side validation problem

    Hi,
    Trying to do server-side validation for a table with usernames, where if the username exists, a simple message in red is posted back to the JSP.
    I was only able to get it to work if 1 (out of about 23) usernames was entered, because for some reason my results set, while being looped, was only returning 1 value all the time.
    My servlet looks like the following, with a few if conditions to trigger the RequestDispatcher object appropriately.
    public class ChangeControlUserAcctServletSPCall extends HttpServlet{
    private Connection connection;
        public void doGet(HttpServletRequest request,
                          HttpServletResponse response)
                          throws IOException, ServletException{
    //req parameters from html/jsp form(Admin) page
    String username = request.getParameter("user_name_fld");
    String userpwd = request.getParameter("user_pwd_fld");
    String userrole = request.getParameter("user_role_fld");
    String useremail1 = request.getParameter("usr_email1");
    String useremail2 = request.getParameter("usr_email_suf");
    String userfinemail = useremail1+useremail2;
    String userbranch = request.getParameter("user_branch");
    String errmsg = "";
    String usernameret = "";
    //boolean userexists = false;
    HttpSession session = request.getSession();
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
       String dbURL = "jdbc:oracle:thin:@xxx.xxx.xx.xxx:1521:SID";
       String usernm = "aaa_dfg";
       String pwd = "********";
       connection = DriverManager.getConnection(dbURL, usernm, pwd);
                   Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
                   String prepquer = "select user_name from users";
                   PreparedStatement preps = connection.prepareStatement(prepquer);
                   ResultSet rst = preps.executeQuery();
                while (rst.next()) {
                 usernameret = rst.getString(1);
    if (usernameret.equals(username)){
            errmsg = "<font face='arial' size='2'>This username</font>, <font face='arial' color='red' size='2'><b> " +username+ " </b>,already exists. <br>"
                      + "Please enter another username.</font>";
            session.setAttribute("message", errmsg);
         RequestDispatcher dispatcher =
              getServletContext().getRequestDispatcher(
                   "/chngctrl/admin/change_ctrl_users.jsp");
            dispatcher.forward(request, response);
    else {
    CallableStatement cstmt = connection.prepareCall("{call cctrl_passwords_proc (?,?,?,?,?)}");
       cstmt.setString(1,username);
       cstmt.setString(2,userpwd);
       cstmt.setString(3,userfinemail);
       cstmt.setString(4,userrole);
       cstmt.setString(5,userbranch);
       cstmt.executeUpdate();
       System.out.println("SQL Stmt: " +cstmt);
                   rst.close();
                   stmt.close();
      if (username==null || username.equals("") || username.equals(" ")) {
         RequestDispatcher dispatcher =
              getServletContext().getRequestDispatcher(
                   "/chngctrl/admin/change_ctrl_users.jsp");
            dispatcher.forward(request, response);
            System.out.print("first request");
          else if (usernameret.equals(username)){
         errmsg = "This username, <font face='arial' color='red'>" +username+ "already exists. <br>"
           + "Please enter another email address.</font>";
            session.setAttribute("message", errmsg);
                    RequestDispatcher dispatcher =
                         getServletContext().getRequestDispatcher(
                              "/chngctrl/admin/change_ctrl_users.jsp");
                       dispatcher.forward(request, response);
            System.out.print("first request");
        else {
       RequestDispatcher dispatcher =
              getServletContext().getRequestDispatcher(
                   "/chngctrl/insert_users_success.jsp");
            dispatcher.forward(request, response);
            System.out.print("2nd request");
        public void doPost(HttpServletRequest request,
                           HttpServletResponse response)
                           throws ServletException, IOException {
         System.out.println("working here doPost method on Approval Servlet?");
            doGet(request, response);
    // final curly brace
    }Any feedback would be appreciated if you see something glaringly wrong, or just wrong in general! : )
    Thanks!

    Had one (a WHERE clause) in there and later took it
    out, but I don't think I'd originally applied it
    correctly any way.Apparently not.
    >
    Are you saying just run a WHERE clause equivalent to
    the username request parameter, then make some
    boolean value that if it matches (and the boolean's
    true), reject it with some message? I'll admit that I didn't read your code (too much trouble), but it sounds like you're trying to validate a given user who has supplied a username (and maybe a password?) that's unique to them. You query your database for that username. If it doesn't appear, they can't come in. If the username appears but the password is wrong, they can't come in. If both match, you give them a credential or token of some kind that tells all your other pages "This person is all right."
    Therefore skipping over how ever many or few users are in there?You only want to transfer the one you need over the wire, and you only want to check the one that has a chance of matching the password. Why bother with a million other users if the username is unique?
    This has very few, but yeah, that's a better idea to
    trim that down were this (I don't see it doing so,
    but who knows, right?) ever to grow.I'd get it deployed and working before I'd worry about it growing.
    %

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • Async tcp client and server. How can I determine that the client or the server is no longer available?

    Hello. I would like to write async tcp client and server. I wrote this code but a have a problem, when I call the disconnect method on client or stop method on server. I can't identify that the client or the server is no longer connected.
    I thought I will get an exception if the client or the server is not available but this is not happening.
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    How can I determine that the client or the server is no longer available?
    Server
    public class Server
    private readonly Dictionary<IPEndPoint, TcpClient> clients = new Dictionary<IPEndPoint, TcpClient>();
    private readonly List<CancellationTokenSource> cancellationTokens = new List<CancellationTokenSource>();
    private TcpListener tcpListener;
    private bool isStarted;
    public event Action<string> NewMessage;
    public async Task Start(int port)
    this.tcpListener = TcpListener.Create(port);
    this.tcpListener.Start();
    this.isStarted = true;
    while (this.isStarted)
    var tcpClient = await this.tcpListener.AcceptTcpClientAsync();
    var cts = new CancellationTokenSource();
    this.cancellationTokens.Add(cts);
    await Task.Factory.StartNew(() => this.Process(cts.Token, tcpClient), cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
    public void Stop()
    this.isStarted = false;
    foreach (var cancellationTokenSource in this.cancellationTokens)
    cancellationTokenSource.Cancel();
    foreach (var tcpClient in this.clients.Values)
    tcpClient.GetStream().Close();
    tcpClient.Close();
    this.clients.Clear();
    public async Task SendMessage(string message, IPEndPoint endPoint)
    try
    var tcpClient = this.clients[endPoint];
    await this.Send(tcpClient.GetStream(), Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async Task Process(CancellationToken cancellationToken, TcpClient tcpClient)
    try
    var stream = tcpClient.GetStream();
    this.clients.Add((IPEndPoint)tcpClient.Client.RemoteEndPoint, tcpClient);
    while (!cancellationToken.IsCancellationRequested)
    var data = await this.Receive(stream);
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(NetworkStream stream, byte[] buf)
    await stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive(NetworkStream stream)
    var lengthBytes = new byte[4];
    await stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await stream.ReadAsync(buf, 0, buf.Length);
    return buf;
    Client
    public class Client
    private TcpClient tcpClient;
    private NetworkStream stream;
    public event Action<string> NewMessage;
    public async void Connect(string host, int port)
    try
    this.tcpClient = new TcpClient();
    await this.tcpClient.ConnectAsync(host, port);
    this.stream = this.tcpClient.GetStream();
    this.Process();
    catch (Exception exception)
    public void Disconnect()
    try
    this.stream.Close();
    this.tcpClient.Close();
    catch (Exception exception)
    public async void SendMessage(string message)
    try
    await this.Send(Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(byte[] buf)
    await this.stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await this.stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive()
    var lengthBytes = new byte[4];
    await this.stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await this.stream.ReadAsync(buf, 0, buf.Length);
    return buf;

    Hi,
    Have you debug these two applications? Does it go into the catch exception block when you close the client or the server?
    According to my test, it will throw an exception when the client or the server is closed, just log the exception message in the catch block and then you'll get it:
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.Invoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    Console.WriteLine(exception.Message);
    Unable to read data from the transport connection: An existing   connection was forcibly closed by the remote host.
    By the way, I don't know what the SafeInvoke method is, it may be an extension method, right? I used Invoke instead to test it.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Client and Server in one process

    Hi all,
    I am trying to create a process which can act as both Client and Server.
    How can I do this?
    Thanks!

    AH. That's a better definition or explanation. Thanks.
    This smells of a single process with multiple threads, each thread handling the basic needs of your requirements. In other words, have a thread deal with making one or more client type connections (use a main thread - the client controller - to spawn client-connection threads. This assumes you need multiplicity in your client-connection model.
    Then make another thread - the server controller - to handle inbound connections, spawning a new thread for each inbound connection. Your main thread, the one that contains your main method, can watch everything that's going on and log or report what's going on in your client and server threads.
    Going into specifics would be a lot to do here. Maybe someone is up for the challenge. Of course, this being a "New to Java Technology" forum, these concepts may be a bit beyond your skillset.
    This is not the only way to go about solving your problem, but it's the only way I can think of at the moment given your requirements.
    Hope this helps some.

  • Communication between client and server

    I am using sockets for communication between the client and the server. is there any other way that i can use for communication between the client and server???

    Plenty of ways: JMS, SOAP, RMI, a RESTful API, writing-files-to-a-shared-directory-on-the-disk, Sneakernet, ...
    Some of them use sockets (or better TCP/IP) as the underlying protocol.
    But to give you a good answer, you would have to tell us why you want a different way. I hope you're not searching for a different way just for the sake of being different.

  • How to create client and server app using node.js in firefox os.

    I want to create a client and server app using node.js for firefox os. Please suggest me how to create a apps.
    I want to send a request from client to server and based on client request, service reply to client.
    If any links available, Please share it.
    Thanks

    Hi sb00349044,
    The SUMO forums focuses on end-user support.
    For questions about developing for Firefox OS, you will find better guidance in MDN, StackOverflow, and mailing lists:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN - Firefox OS]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow - Firefox OS]
    * [https://lists.mozilla.org/listinfo Mailing Lists at Mozilla]
    Thanks,
    - Ralph

Maybe you are looking for

  • OnBeforeLogin: how to fail a portal login in an SSO env ???

    Am researching a question for a customer to whose site I don't have access, so I can't test this and look at the PTSpy output. In this case, the customer wish to display a portal usage agreement on login, and terminate the portal session if the user

  • External hard drive doesn't wake up fast enough for Time Machine

    I am having trouble with using SuperDuper and Time Machine doing their jobs with my external firewire drives. Config: One 750GB drive (one partition called DataDisk) and one 1TB drive (with two partitiions - Clone and TMDisk) connected thru daisychai

  • Proxy User Authentication with SQL Developer

    Hello, I realized that there are 2 methods for configuring SQL Developer to user Proxy User Authentication. 1) one-session method with Syntax: personaluser[appuser] 2) two session-method with dialog "Proxy Connection" For me it is unclear, why anybod

  • Creating XML doc from DTD using jDOM

    Hi... I want to create empty XML Document from the DTD using JDOM or JAXP & then want to populate that xml document with the values from the database. The problem is :-      How can we create an XML document by simply reading the DTD using JDOM or JA

  • IBook will not sleep when lid closed

    Hi, I recently had my Hard Drive replaced, the old one died. It was all covered by AppleCare and the repairs done at a Apple Authorised Outlet. After installing everything again I just found out that my iBook will not sleep when the lid is closed. Th