Detecting validation error on client side

If there is some error in validation on the field of ViewObject which is binded with a page, that component shows error message. I want to set some javascript fields on client side when a component gets error. How i can do that?

Hi,
for this you will need to catch the error in a custom error handler and call JavaScript from a managed bean (see chapter 5 of the Web Developer guide in the OTN documentation for JDeveloper and ADF).
Frank

Similar Messages

  • Detecting validation errors in ADF UIX

    Dear sirs...
    how can i detect validation errors in an adf uix page using DataActionContext?
    thanks for any help

    dear sirs...
    i found how it works. it is simple, bust call this.hasErrors(ctx). this would return true if an error occurs, otherwise it returns false.
    best regards

  • "ORA-03113: end-of-file on communication channel error" in client side

    Problem Description: we have a production server that oracle 11gr2 installed and oracle clients (application servers) with 11gr2 clients. Sometimes we encounter internal server error 500 at the application server side; and when we check out the application server logs we see ORA-03113 error code.
    when we look at the corresponding error on the Oracle Database Server side we saw the following output in the alert_orcl.log :
    Fatal NI connect error 12170.
    VERSION INFORMATION:
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 11.2.0.1.0 - Production
    Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 11.2.0.1.0 - Production
    Time: 09-ŞUB-2011 12:46:15
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12535
    TNS-12535: TNS: İşlem süresi aşıldı
    ns secondary err code: 12609
    nt main err code: 0
    nt secondary err code: 0
    nt OS err code: 0
    Client address: (ADDRESS=(PROTOCOL=tcp)(HOST=10.1.10.144)(PORT=59999))
    Wed Feb 09 12:46:15 2011
    what could be the problem or how can i trace it in order to determine the exact problem? is there any parameter that i need to adjust in client side to ensure that every connection reaches the production server ?

    There is often an ORA-0600 or ORA-7445 behind these.
    These should produce an entry in the alert log and an associated trace file which a) can be used in the ORA-600/7445 lookup tool on Metalink and also uploaded to Oracle Support.
    Edited by: Dom Brooks on Feb 10, 2011 1:08 PM
    A bit quick to answer - I didn't see the large section of TNS information from the alert log.

  • Detecting validation errors

    Hi,
    how can I detect a validation error?
    For example, I'd like to show a generic message at the top of a page which says:
    "Some errors are detected, please check your data"
    This message is not bounded to a particular field, in fact I can use the <h:message for=""/> tags for showing the errors generated by each field.
    The only one solution I found is adding ugly code to my JSP:
    <% if (javax.faces.context.FacesContext.getCurrentInstance().getMessages().hasNext()) { %>
                  <span style="color: red;">Some errors are detected, please check your data</span>
                <%}The only one way to detect a validation error is cheking the message queue. If it's empty, no validation errors occured.
    I don't like it.
    Some help?

    I would like to share the kind of approach I had used with the same situation.
    You can put one "h:outputText" at the top of the page for displaying all the error messages.Obviously attach it to some backing bean property.
    Now whenever you encounter any error just assign your customize message to this bean propery.
    Whenever the response is rendered you can see your error message being displayed at the top of the page.
    Funny ! but it works !!!!

  • ERROR IN CLIENT SIDE AFTER PUBLISHING

    HI,
    javax.servlet.ServletException: olam18.main._start.class not found
    I GET THE ABOVE WHEN I TRY TO GET INTO THE APPLICATION FROM CLIENT SIDE WHICH I PUBLISHED SUCCESSFULLY...PLZ HELP ME OUT...

    I know this question is two months old, but we had the exact same issue so I wanted to share our solution. This error is actually caused by the tightened security added by Java 6 Update 24. This update made it so that you can't use web.show_document to display local content in a web browser.
    Our solution was to use webutil and have the operating system open the local files. Here's what we used:
    webutil_host.nonblocking('rundll32 url.dll,FileProtocolHandler '||i_url);
    If you pass in a .XLS path, it opens Excel; if you pass in a .PDF path, it opens Acrobat; etc.
    HTH,
    Brian
    PS - One more disclaimer: we did this in Forms 10.1.2.3 and have not fully tested it in Forms 11.1.2 yet.
    PPS - Since you're using 64-bit Java, you'll need 64-bit webutil, which is only in Forms 11gR2 (11.1.2).

  • Validating data in client side

    Hi,
    I'm developing a web application using Struts framework.
    and my questions is, does the validate method int the ActionForm replaces the using javascript validation?
    If I can do all the validations in this validate method, so does that mean that i'm not going to use JS at all?

    Client side validation is usually a subset of the validation done on the server side (ie, server side duplicates the client side validation, and then some).
    I usually only do some basic client side validation such as:
    a textfield is null, but shouldn't be
    a textfield should be in this format but isn't: mm/dd/yyyy
    a textfield should be a number but contains a letter.
    If these conditions occur, dont submit the form, pop up a warning dialog box instead.

  • Error at Client Side

    Hi Experts
                 My problem is that after developing model deploying when trying to run in EP at client side geting error as
                   " Visual Composer FlexiviewsrequireAdobe Flash 7.0 for proper viewing.It  Seems your browser does not have appropriate version installed." in internet explorer
               I am making use of VC 7.0 & EP 7.0 And had Flash and SVG Viewer. Can any one suggest me why we are getting this error at run time.
    Regards
    Ashwin

    Hi Ashwin,
    for VC7 EP7 you should use Internet Explorer 6 with the latest flash plugin.
    > Hi Marcel
    >
    > It is working well, but while accessing
    > the developed VC screens through portal url, the
    >  pages were throwing error.
    If you deploy the model, you deploy it to portal. What do you mean with portal url and which errors?
    > So, do u mean that , for using the developed vc
    > application , the client should have flash installed
    > in his system???
    Yes, you need on your machine IE6 with the latest falsh plugin (and for developing you need MSXML parser 4 and the adobe svg viewer 3).
    > Regards
    > Ashwin
    Best Regards,
    Marcel

  • Detecting validation errors during accept processing

    I have a page with the following accept processing components
    1. Process - On Submit - Before computations and validations
    2. A validation
    3. Process - On Submit - After computations and validations
    When the page is first submitted, (1) runs fine. (2) runs and the validation fails so (3) doesn't run.
    Now when I re-submit the page, I would like (1) to NOT run.
    Is there a way to detect that the page is being re-submitted as a result of validation errors and hence suppress certain after-submit components from executing?
    [As far as I know, the "Inline validation errors" declarative condition and the g_inline_validation_error_cnt variable only apply during the page rendering phase, so they can't be used here]
    Thanks

    Hello Vikas,
    In version 3.0 you can use a hidden item as a flag, and set this flag with a on load procedure (and NOT computation). The first procedure will be conditioned by "Inline Validation Errors Displayed" and the second one with "NO Inline Validation Errors Displayed". Then you can condition your after submit processes with this flag.
    >>As far as I know, the "Inline validation errors" declarative condition and the g_inline_validation_error_cnt variable only apply during the page rendering phase, so they can't be used here
    A little test on my local instance confirm this.
    Regards,
    Arie.

  • Plz Solve this Error in    " Client Side Address Validation in Struts "

    Hi,
    i have created struts project and foll code is written as foll :
    plz find out error in code :
    struts-config.xml code
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <data-sources />
    <form-beans >
    <form-bean name="AddressForm" type="com.projectvalidator.form.AddressForm" />
    </form-beans>
    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    input="/validateaddress.jsp"
    name="AddressForm"
    path="/address"
    scope="request"
    validate="true"
    type="com.projectvalidator.action.AddressAction">
    <forward name="success" path="/success.jsp"/>
    <forward name="failure" path="/validateaddress.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="MessageResources" />
    <!-- Validator plugin -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    </struts-config>
    MessageResources.properties file code
    AddressForm.name=Name      
    AddressForm.address=Address
    AddressForm.email=EmailAddress
    validation.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <form-validation>
    <formset>
    <!-- Address form Validation-->
    <form name="AddressForm">
    <field property="name"
    depends="required" >
    <arg key="AddressForm.name"/>
    </field>
    <field property="address"
    depends="required" >
    <arg key="AddressForm.address"/>
    </field>
    <field property="email"
    depends="required" >
    <arg key="AddressForm.email"/>
    </field>
    </form>
    </formset>
    </form-validation>
    validationaddress.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html locale="true">
    <head>
    <html:base />
    <title>validateaddress.jsp</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    </head>
    <body bgcolor=#fdffca>
    <html:form action="/address" method="post" onsubmit="return validateAddressForm(this);">
    <p>
    <html:errors/><p>
    name : <html:text property="name" size="30" maxlength="30" />
    address : <html:text property="address" size="30" maxlength="30" />
    emailaddress : <html:text property="email" size="30" maxlength="30" />
    <html:submit>Submit</html:submit>
    <html:cancel>Cancel</html:cancel>
    <!-- Begin Validator Javascript Function-->
    <html:javascript formName="AddressForm"/>
    <!-- End of Validator Javascript Function-->
              </html:form>
         </body>
    </html:html>
    AddressForm.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.form;
    import org.apache.struts.validator.ValidatorForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:form name="AddressForm"
    public class AddressForm extends ValidatorForm {
         // --------------------------------------------------------- Instance Variables
         /** address property */
         private String address;
         /** emailaddress property */
         private String email;
         /** name property */
         private String name;
         // --------------------------------------------------------- Methods
         * Returns the address.
         * @return String
         public String getAddress() {
              return address;
         * Set the address.
         * @param address The address to set
         public void setAddress(String address) {
              this.address = address;
         * Returns the emailaddress.
         * @return String
         public String getEmail() {
              return email;
         * Set the emailaddress.
         * @param emailaddress The emailaddress to set
         public void setEmail(String email) {
              this.email = email;
         * Returns the name.
         * @return String
         public String getName() {
              return name;
         * Set the name.
         * @param name The name to set
         public void setName(String name) {
              this.name = name;
    AddressAction.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.projectvalidator.form.AddressForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:action path="/address" name="AddressForm" input="/validateaddress.jsp" scope="request" validate="true"
    * @struts:action-forward name="success" path="success.jsp" redirect="true"
    * @struts:action-forward name="failure" path="validateaddress.jsp" redirect="true"
    public class AddressAction extends Action {
         // --------------------------------------------------------- Instance Variables
         // --------------------------------------------------------- Methods
         * Method execute
         * @param mapping
         * @param form
         * @param request
         * @param response
         * @return ActionForward
         public ActionForward execute(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response) {
              AddressForm AddressForm = (AddressForm) form;
              // TODO Auto-generated method stub
              //String forward="";
              //if (AddressForm.getName().equalsIgnoreCase("admin"));
              //return mapping.findForward(forward);
              return null;
    ==========================================
    PLZ REPLY ME ANYONE , I AM NOT GETTING OUTPUT , i am using jboss application server, i am getting a pop-up window as below:
    null is required
    null is required
    null is required
    i hope any one replies me

    Hi,
    i have created struts project and foll code is written as foll :
    plz find out error in code :
    struts-config.xml code
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <data-sources />
    <form-beans >
    <form-bean name="AddressForm" type="com.projectvalidator.form.AddressForm" />
    </form-beans>
    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    input="/validateaddress.jsp"
    name="AddressForm"
    path="/address"
    scope="request"
    validate="true"
    type="com.projectvalidator.action.AddressAction">
    <forward name="success" path="/success.jsp"/>
    <forward name="failure" path="/validateaddress.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="MessageResources" />
    <!-- Validator plugin -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    </struts-config>
    MessageResources.properties file code
    AddressForm.name=Name      
    AddressForm.address=Address
    AddressForm.email=EmailAddress
    validation.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <form-validation>
    <formset>
    <!-- Address form Validation-->
    <form name="AddressForm">
    <field property="name"
    depends="required" >
    <arg key="AddressForm.name"/>
    </field>
    <field property="address"
    depends="required" >
    <arg key="AddressForm.address"/>
    </field>
    <field property="email"
    depends="required" >
    <arg key="AddressForm.email"/>
    </field>
    </form>
    </formset>
    </form-validation>
    validationaddress.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html locale="true">
    <head>
    <html:base />
    <title>validateaddress.jsp</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    </head>
    <body bgcolor=#fdffca>
    <html:form action="/address" method="post" onsubmit="return validateAddressForm(this);">
    <p>
    <html:errors/><p>
    name : <html:text property="name" size="30" maxlength="30" />
    address : <html:text property="address" size="30" maxlength="30" />
    emailaddress : <html:text property="email" size="30" maxlength="30" />
    <html:submit>Submit</html:submit>
    <html:cancel>Cancel</html:cancel>
    <!-- Begin Validator Javascript Function-->
    <html:javascript formName="AddressForm"/>
    <!-- End of Validator Javascript Function-->
              </html:form>
         </body>
    </html:html>
    AddressForm.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.form;
    import org.apache.struts.validator.ValidatorForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:form name="AddressForm"
    public class AddressForm extends ValidatorForm {
         // --------------------------------------------------------- Instance Variables
         /** address property */
         private String address;
         /** emailaddress property */
         private String email;
         /** name property */
         private String name;
         // --------------------------------------------------------- Methods
         * Returns the address.
         * @return String
         public String getAddress() {
              return address;
         * Set the address.
         * @param address The address to set
         public void setAddress(String address) {
              this.address = address;
         * Returns the emailaddress.
         * @return String
         public String getEmail() {
              return email;
         * Set the emailaddress.
         * @param emailaddress The emailaddress to set
         public void setEmail(String email) {
              this.email = email;
         * Returns the name.
         * @return String
         public String getName() {
              return name;
         * Set the name.
         * @param name The name to set
         public void setName(String name) {
              this.name = name;
    AddressAction.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.projectvalidator.form.AddressForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:action path="/address" name="AddressForm" input="/validateaddress.jsp" scope="request" validate="true"
    * @struts:action-forward name="success" path="success.jsp" redirect="true"
    * @struts:action-forward name="failure" path="validateaddress.jsp" redirect="true"
    public class AddressAction extends Action {
         // --------------------------------------------------------- Instance Variables
         // --------------------------------------------------------- Methods
         * Method execute
         * @param mapping
         * @param form
         * @param request
         * @param response
         * @return ActionForward
         public ActionForward execute(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response) {
              AddressForm AddressForm = (AddressForm) form;
              // TODO Auto-generated method stub
              //String forward="";
              //if (AddressForm.getName().equalsIgnoreCase("admin"));
              //return mapping.findForward(forward);
              return null;
    ==========================================
    PLZ REPLY ME ANYONE , I AM NOT GETTING OUTPUT , i am using jboss application server, i am getting a pop-up window as below:
    null is required
    null is required
    null is required
    i hope any one replies me

  • FA/997 for Validation Error

    Hi All,
    I need some clarification on receiving the 997/FA for the Validation error that happens at the remote trading partner.
    Will the 997 payload contain the details of the error in it??
    How will B2B interpret the FA as positive FA or negative FA?
    In my case the payload which I am sending is getting validation error at receiving side, they are sending me the FA. But in my side, both the initial transaction and the ack transaction goes to MSG_Completed state. Is it a normal behavior?
    Thanks in advance.
    Regards,
    Monica

    Hi,
    1. The 997 has fields which will tell if the EDI transactions has SNIP errors. In your case, the outbound EDI should goto MSG_ERROR.
    2. In a 999 transaction, the fields such as AK9, IK4, IK5 will tell the problem in the EDI, I am sure 997 should also have something like that.

  • ADF validator or JavaScript for client side validation ?

    using JDev and ADF 11g
    Problem description : To apply validations such as date range check, pattern matching, maxlength etc.. on ADF Faces Components.
    Solution 1: Use ADF validator such as Reg Expr validator, Max Length validator
    Souliton 2: Write Javascript code for validating the component's value at cleint side.
    When using ADF Validator for such type of validation checking, a request is send to the server for processing (additional overhead) . However we can do such validations with javaScript functions without the need to interact with the server. So, what benefit does ADF Validator serves when one needs to implement such validations ?
    Please share your views...

    H,
    afaik, client side validation in ADF Faces suppresses server round trips if a validation error is detected on the client. Only if no problem is found, the server side validation is challenged upon submit (so no extra round trip for validation). Shay is absolutely correct. JavaScript is a convenience but never a solution.
    Here's how to create a custom validator with a client and server side implementation : http://download.oracle.com/docs/cd/E15523_01/web.1111/b31973/af_validate.htm#BABEIIDD
    Frank

  • How to Disable client side validation for the message text input

    Hi,
    I have scenario where i need to by pass the client side validation for a message text input
    Scenario is
    I have a message text input field(say XYZ), i set the max length for the item as 20
    Now when im trying to enter the greek characters into it, it is allowing me to enter till 20 characters
    But when i try to submit the form ..my client side validation is firing..
    The Error says the XYZ is too long
    The problem is, in greek each character takes two bytes.(In english it is only 1).While entering the content it allowing 20 characters and when validating it is checking for bytes(if we enter in greek the length will be 40 bytes not 20)
    I cannot increase the max length .coz i have restrict the character length to 20 only.(english or Greek).
    Please help me in this regard.
    Regards
    Sandeep.

    Thanks for the information.But we dont have any option either declaratively or programatically to disable the client side validation for the message text input..I referred java docs ..i dint find any method which does..
    Correct me if im wrong

  • Client Side Javascript Validation not Working in Struts 1.x version

    hi,
    I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work.
    [http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/]
    "The framework automatically generates the browser specific JavaScript and validate the data only at the client side."From the above statement i undertstand that framework itself generates the javascript function for validating the field mentioned in validations.xml file so that we dont have to explicitly write a javascript function for
    validating the fields
    (or)
    Do we need to call an explicit function
    Please need help on this.
    I have followed all the steps mentioned on the above link but Client Side Javascript Validation not Working in Struts 1.x version....
    Thanks and Regards,
    Deepak

    Hi,
    Please find my steps below....still getting an error.
    2> which version of commons-validation.jar needs to be downloaded ...Link please
        downloaded the latest commons-validation.jar and placed in lib.refreshed the project,and did a build.
        3> which DTD name to be specified in "validator-rules.xml" which is in accordance to commons-validator.jar file.
    validator-rules.xml ::
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">validation.xml:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    i did as u said and im gettiong the below errorNov 5, 2009 4:33:08 PM org.apache.struts.validator.ValidatorPlugIn initResources
    SEVERE: Invalid byte 2 of 2-byte UTF-8 sequence.
    org.apache.commons.digester.xmlrules.XmlLoadException: Invalid byte 2 of 2-byte UTF-8 sequence.
         at org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(FromXmlRuleSet.java:139)
         at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610)
         at org.apache.commons.digester.xmlrules.DigesterLoader.createDigester(DigesterLoader.java:89)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:122)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:238)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:181)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1036)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
         at javax.servlet.GenericServlet.init(GenericServlet.java:212)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:448)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Need help forum members.....
    Please reply to my question 1  which has been asked before as belowDo i need to write explicit javascript function for validation in Struts (or) struts generates the javascript function by itself.??? Please explain with an example....
    Edited by: Deepak_A_L on Nov 5, 2009 4:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • STRUTS: client-side validation in jsp using  DynaValidatorForm

    I am supposed to work on struts on as project and it is like learning a crash course and work the next day.
    In Struts 1.1 enviroment, I am using DynaValidatorForm to create a bean form and then perform validation.
    1. I write a DynaValidatorForm definition in struts-config.xml
    2. I write xml for action so that when /getQuotes.do in invoked by a jsp form, the form data is put into the QuoteDetailsBean.
    3. add the plugin script for ValidatorPlugIn
    xml fragment from struts-config:
    //form bean
    <form-beans>
    <form-bean name="QuoteDetailsBean" type="org.apache.struts.validator.DynaValidatorForm">
        <form-property name="forename" type="java.lang.String"/>
       <form-property name="surname" type="java.lang.String"/>
    <form-bean>
    </form-beans>
    <action
            path="/getQuotes"
            type="com.kainos.quickquotes.struts.QQGetQuotesAction"
            validate="true"
            name="QuoteDetailsBean"
            input="/userform1.do"
            parameter="save"
            scope="session">
            <forward name="success" path="/pages/jsp/result.jsp"/>
            <forward name="back" path="/userform1.do"/>
    </action>
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
         <set-property
             property="pathnames"
             value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
      </plug-in>Now I write a validation code for getQuotes.do. note that I can write the validation code with
    <form name="QuoteDetailsBean"> but this form bean is shared by many jsp, so i am using the name of the action
    (getQuotes) as the name of the form in the validation.xml.
    So far this looks okay, as I am going by some example.
    xml fragment from validation.xml:
    <formset>
              <form name="/getQuotes">
                 <field property="forename" depends="required,minlength">
                    <arg0 key="QuoteDetailsBean.forename" />
                    <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                    <var>
                       <var-name>minlength</var-name>
                       <var-value>2</var-value>
                    </var>
                 </field>
                 <field property="surname" depends="required,minlength">
                <arg0 key="QuoteDetailsBean.surname" />
                <arg1 name="minlength" key="${var:minlength}" resource="false"/>
                <var>
                   <var-name>minlength</var-name>
                   <var-value>2</var-value>
                </var>
                 </field>
    </formset>Now I write the JSP. I use the <html:javascript> tag to allow front-end validation based on the xml in validation.xml.
    The jsp code:
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <html:html locale="true">
    <head>
    <title><bean:message key="welcome.title"/></title>
    <html:base/>
    <html:javascript formName="/getQuotes"
                method="validateForm"
                dynamicJavascript="true"
                staticJavascript="false"
                cdata="false" />
    </head>
    <body bgcolor="#FFCC9F">
    <html:errors />
    <html:form action="getQuotes.do" onsubmit="return validateForm(this);" >
    Forename:</td> <td>���<html:text property="forename"/></td></tr>
    <tr> <td>Surname:</td> <td>���<html:text property="surname"/></td></tr>
    <html:submit value="Quotes" /></td></tr>
    </html:form>
    </body>
    </html:html>Does this looks okay. I wrote so far based on some tutorials n help online.
    Now when I open the JSP and then do a submit, there is no validation (I tried by submitting with empty forename and surname. I mean i could invoke the action class and the invoke class
    redirects(forwards) to the appropriate path. so the code works fine except validation is not done
    Q1. So what should i do more to get client-side validation?
    What actually happens in client-side validation? does a pop up alert appears?
    nothing happens so far in my case.
    Q2. What should I do more for server side validation. Since the form is incomplete, what happens?
    I thought the same form returns and the error messages are printed in the jsp page since i have the <html:errors />
    tag just below the <body> tag.
    The action class is pretty simple so far:
    public class QQGetQuotesAction extends Action {
        public QQGetQuotesAction(){
    public ActionForward execute(ActionMapping mapping,
                 ActionForm form,
                 HttpServletRequest request,
                 HttpServletResponse response)
        throws Exception {
            DynaValidatorForm dynaform = (DynaValidatorForm)form;
            System.out.println("forename:"+dynaform.get("forename");
            System.out.println("surname:"+dynaform.get("surname");
            return forward=mapping.findForward("back");
    }Please help me out. I think I am missing something which i need to do
    thanks
    Tanveer

    I think the validations are to be declared on the form
    name and not the action path.
    Your formName is QuoteDetailsBean but your are using
    the action path(/getQuotes) both in the validation
    rules and the jsp tags. Use the formName on both the
    places.
    Also your html:javascript tag will not generate the
    static javascript to validate the fields. For this you
    will have to add code like below.
    <html:javascript dynamicJavascript="false"
    staticJavascript="true"/>
    Other options is to set the attribute
    staticJavascript="true" in your html:javascript tag.
    Hope it helps.hi
    staticJavascript="true" did the trick. :)
    I think the validations are to be declared on the form name and not the action path.It is not necessary. You can declare the validation on the action class. This is essential if a form bean is shared by several JSPs having its own action class. This is as per as I read in a tutorial and it works.

  • Client side validation in struts using validation framework

    Hi ,
    am new to struts.....
    I want to validate a simple login page using struts validation framework...
    For that i created,
    login.jsp ( contains html:errors and html:javascript and onsubmit)
    LoginForm extends ValidatorForm
    LoginAction
    resource bundles
    validation.xml ( required, minlength and maxlength rules for both fields)
    struts-config.xml ( configured action mapping and form beans)
    whats my problem is....
    i will get error messages through server side validation...
    i cant able to get the error messages using javascript i.e alert messages.
    i seen the page resource in that all javascript functins are inserted.
    on seeing the javascript error console... it shows
    formName has no properties...............
    exactly at this line
    oRequired = eval('new ' + formName.value + '_required()'); //function validateRequired(form)

    Thanks for your valuable reply.....
    Ya of course what you said was correct....
    I got error messages while submitting the form without any value....
    error messages are displayed using the <html:errors/> tag (server side validation ).
    But it fails to show the alert messages for those errors ( client side validation).
    i inserted the <html:javascript formName="form bean name" /> tag in the bottom of my login jsp.....
    on seeing the error console, it shows formName has no properties.
    Could anybody help me to sort out this problem........

Maybe you are looking for

  • Using Migration assistant to transfer data from one disk to another

    I will install a new SSD disk but I would like to make a clean install with Mountain Lion but after that migrate data from the old HDD, that it is now installed in the place of the optical drive, to the new. I would like to know how to do that correc

  • Returns for Third-Party Sales

    Hello Gurus Could anybody give a step by step procedure for How does Returns take place in Third party Sales?

  • [SOLVED] Citrix client GlobalSign Root CA

    I have just installed Citrix Client but am getting the error message "You have not chosen to trust GLobalSign Root CA, the issuer of the server's sercurity certificate (SSL error 61)."  I have copied the mozilla certificates too /usr/lib32/ICAClient/

  • "Switch between open applications" command does no...

    I dont know why the "Switch between open applications" command does not work with my E7 when i updated my phone to belle which was last week. Also, i cant mass text with this OS, max of 5 reciepients only. When the phone was still anna, both or all c

  • Compaq CQ60-615dx Windows 8 Audio Drivers

    I need some help getting the Audio Drivers for Windows 8 for my Compaq CQ60-615dx. I have tried using the Windows 7 Drivers, and the Vista Drivers to no avail. Any help or suggestions would be appreciated!