MDG Cross entity validation using enrichment spot is not executed.

I have configured the enrichment sport for cross entity validations and used BRF to validate the data, but looks like validations are
not executed. I have the check activated for the step in the configuration and I can see my custom class is being picked in method GET_ENRICHMENTS of class CL_USMD_DQ_ACCESS_ENRICHMENT for that request type and step. I have flag relevant  selected and option “Execute Always” (will change this to “Execute when data changed).
I am trying to figure out if SAP MDG standard code will execute my custom class code or not. I had put break point in my custom class constructor and this is called when an instance for enrichment is created in method GET_ENRICHMENTS of class CL_USMD_DQ_ACCESS_ENRICHMENT. However my code in below method is not executed (and hence BRF is not called)
  IF_USMD_ENRICHMENT_FEEDER~GET_ADAPTER_DATA
  IF_USMD_ENRICHMENT_FEEDER~IS_RELEVANT
Now I am trying to figure out a place from where these enrichment class methods will be executed. I feel this will be from EXECUTE_ENRICHMENT
of class CL_USMD_DQ_ACCESS_ENRICHMENT. But this method is also not executed when I hit on Check button. Am I looking wrong standard class?
Is there anything I am missing in configuration? Or we need to implement any SAP note? I tried to find one, but no luck.

Hello, I am not using cress entity BADI for Validation. I am using this BADI for cross entity derivations and they are working fine.
I had a requirement to do cross entity validations, and I have rules written using the BRF+.
I had used enrichment sport functionality to have a custom class used to call BRF functions and prepare the context with required entity data.
Validations are supposed to happen based on the enrichment spot defined and the configuration for that enrichment sport on the process step level. This is not happening. let me know if you need more information on it,

Similar Messages

  • How to stop attribute level validation when entity validator fails?

    Hi,
    Can you suggest any way to achieve the desired behaviour on the following scenario.
    Table contains the following columns
    1. Grade
    2. Grade Rate
    3. Status
    Constraints:
    1. Grade and Grade Rate together must be unique.
    2. Grade and Grade Rate are mandatory fields.
    Implementation:
    1. Have Mandatory validator at attribute level for Grade and Grade Rate by default.
    2. Alternate key is defined based on Grade and Grade Rate and added the same as Entity validator.
    User operation scenario:
    User adds a row in a table, entered 'GradeOne' as Grade, tabbed out and then entered '5 %' as Grade Rate (Existing row of the VO has a row with similar data already). When user try to navigate to other row, both validation at attribute level and entity level fires and gives the following error messages.
    Error Msg 1. Grade and GradeRate should be unique.
    Error Msg 2. Attribute GradeRate is required.
    Expected behaviour:
    I can understand the reason why ADF throws both the errors (coz it didn't consider the invalid value of GradeRate posted into attribute), but the error messages confuses the user. It would be great if he get only one error message in this scenario (i.e. Unique validation alone)
    Question:
    How can I restrict in such a way that only one error validation happens in a request (i.e. either attribute level or entity level or in a particular order}
    Thanks in Advance.

    Hi,
    the reason ADF does this is for performance. What if you create a custom error handler in the DataBindings.cpx file and use this to suppress all other errors?
    See
    Decompiling ADF Binaries: Customizing Business Components Error Messages
    :http://www.adftutorials.com/adf-custom-error-handler-to-display-custom-message-to-user.html
    Frank

  • Execution of entity validation multiple times (adf bc 10g)

    Implementing entity method validators sometimes causes the validation (e.g. validateEntity method) to execute multiple times. We have figured out that this case occurs when we call method setAttribute programmatically when we implement business rules on the entity level. For example in many cases that we want to enforce dml operation execution, we override the method prepareForDML so that the framework works as follows:
    •     calls validateEntity, validates entity for the first time
    •     calls prepareForDML –> setAttribute this method invalidates the entity row
    •     calls validateEntity, validates entity for a second time
    I can understand that sometimes multiple entity validation is necessary and important, there are cases though that this behaviour is not necessary and additionally it degrades performance especially when we utilize sql queries inside the validation (as it executes the queries multiple times).
    Is there any workaround to avoid multiple execution of entity validation or enforce the validation to occur only once, for example after the prepareForDML method and not before?
    Edited by: user647567 on 9 Σεπ 2010 6:58 πμ

    Hi there:
    I don't think JDeveloper provides a switch to bypass the Entity Validation. Too much meddling. MVC model has those layers and advocates reducing unnecessary dependencies between layers. Entities and Views are both in Model layer though. But you can build a view without an Entity and vise versa you can have an Entity that doesn't have default views. So my understanding is the Entity Validation is quite necessary.
    Though from View layer, on a jspx page, you can use command buttons and set their "immediate" property to "true" to bypass form validation temporarily and postpone it to form submission time.
    My understanding for Entity validator is they should be light weighted. You properly should avoid SQL queries directly in them. Instead you should use EntityImpl or ViewObjImpl/ViewRowImpl instead of SQL queries directly in validator.
    If you feel my answer helpful to you, please mark it so.
    Thanks,
    Alex
    Edited by: Alexbie on Sep 9, 2010 11:11 AM

  • Automatic entity validation

    Hi
    We are building an application framework on top of Toplink. One thing we added are field validators that are called on every setXXX(). The validator throws a ValidationException if there is a problem. This is automatic, and the developer doesn't need to care about it. ValidationException are atomaticaly sent back to the form by the framework and displayed using a message pool system...
    Now, we want to add an automatic entity validation system. The idea is to call the validate() method on the entity during the commit of the unit of work. The validate() method performs entity wide validations and throws a ValidationException if the entity is not valid. Of course, the framework must rollback the transaction if needed.
    How can wee do that in Toplink? I thought that events could help us, but I don't think we can throw exceptions from there...
    Any idea?
    Thanks
    Regards
    Eric

    Just to clarify,
    If you add this validation to your status attribute then it will validate that Reason is not null when you change the status to 4.
    If you want to raise an entity validation just add a new Entity Validator and the expression should be something like what you had:
    But slightly different
    Status != null ? (Status==4? (Reason!=null) : true) : true

  • HELP: ADF-Error in Entity Validation - Validation fires twice

    Hi there,
    I have problems with the entity validation in JClient when I have more then one UI-Element that references to the same Data Control / Model Attribute within one panel.
    E.g. I have a table where I display all customers. Above the table I show detail information with editable JTextFields for the customer I've selected in the table. When I change the name of a customer and leave the textfield, the new Value appears also in the table. Thats all ok.
    The problem:
    The entity validation fires twice in that example. E.g. when I insert 30 characters in the name field, but the corresponding database column only stores 20 characters, the
    displayed exception appears twice. When I remove the textfields from the panel
    and edit the values direct in the table, the validation only fires one time.
    How can I avoid that behaviour? I have a lot of screens where it is important to show the list of objects in a table and let edit specific data via text fields.
    That behaviour is also reproducable with the ADFJClientComponentDemo
    (Jtree binding demo). If you insert more characters than allowed in the firstname field,
    the Exception Message is shown twice.
    Thanks for your help,
    Claus

    Hi Fred,
    It's nice to know that somebody out there uses the same technology in a similar way.
    Our L & F is also JGoodies based (we didn't use JGoodies forms).Yes, nice to know. We also only use L&F and not the JGoodies Layout Manager
    (but if JDev 10.1.3 provides that layout manager maybe we use it for new panels).
    In our JClient View project, we used very few try/catch blocks, mostly in our custom
    Navigation bar class (with freeze row function).
    How would you translate the following in 3tiers?
    in the client class:
    try {
    // call a method in the model
    catch (JboException je)
    this.getPanelBinding().reportException(je);
    }We don't use any try/catch-blocks to check for model-exceptions.
    In our application a typical bootstrap code snipplet looks like that:
    =======================================
    //As classmember we have our own ErrorHandler:
    protected HTOErrorHandler errorHandler = new HTOErrorHandler(true);
    //some bootstrap code
    BindingContext ctx = new BindingContext();
    ctx.put(DataControlFactory.APP_PARAM_ENV_INFO, new JUEnvInfoProvider());
    ctx.setLocaleContext(new DefLocaleContext(null));
    //Set Custom Error Handler
    ctx.setErrorHandler(errorHandler);
    =======================================
    Our Custom Error Handler Looks like this:
    =======================================
    public class HTOErrorHandler extends DCErrorHandlerImpl
    boolean inReportException = false;
    public HotErrorHandler(boolean setToThrow){
    super(setToThrow);
    public void reportException(DCBindingContainer bc, Exception ex){
    disableAppendCodes(ex);
    showPopup(ex);
    super.reportException(bc, ex);
    private void disableAppendCodes(Exception ex){
    JboException jboEx = (JboException) ex;
    String baseMsg = jboEx.getBaseMessage();
    String detailMsg = jboEx.getDetailMessage();
    String errorCode = jboEx.getErrorCode();
    Locale defaultLoc = Locale.getDefault();
    Object[] detailExceptions = jboEx.getDetails();
    if ((detailExceptions != null) && (detailExceptions.length > 0)){
    for (int z = 0, numEx = detailExceptions.length; z > numEx; z++){
    disableAppendCodes((Exception) detailExceptions[z]);
    public void showPopup(Exception ex){
    DialogMessage dialog = new DialogMessage((JboException)ex);
    dialog.setVisible(true);
    =======================================
    The DialogMessage is our own ModalDialog to show the ErrorMessages with
    a userfriendly dialog (e.g. we show some error/warning/info-icon...)
    Each time we throw a exception in a EntityObject the framework ensures that
    the Message is shown in our own ModalDialog without using try/catch-blocks
    and the this.getPanelBinding().reportException(je)-method;
    We wrote our own ModalDialog because of L&F-reasons. But you said that
    you use the Standard-Dialog. IMHO you must neverlethess use the setErrorHandler-Method
    in 3-tier mode, but you needn't to write your own ErrorHandler, you can use the
    JUErrorHandlerDlg....
    The following line of code is generated by the ide when creating a default form:
    app.getApplicationModule().fetchAttributeProperties(new String[] {"Test2View1"}, new >String[][] {{"Id2", "Name2", "Id3", "AttrTest"}}, null);
    I read somewhere that when opening a panel, one should call that method for all used >properties in 3tiers mode only.Sorry, but we don't currently optimize something like that. For what reason
    do you want to call that method explicit? We don't have a custom method for that.
    I add tests in the validateEntity method and throw a JboException.
    I suppose for 3tiers I will have to replace throw new JboException by ???? No. You don't have to replace that. The framework notifies your client via the registered ErrorHandler.
    So when a mandatory field is empty, the framework displays an error when a commit
    or navigation event is triggered in the nav bar and the user has always access to that
    field.We want to override the default framework message with our own message. So we have
    to throw the exception manually at some point in the entity object. And for that reason
    we implemented a custom validation via MethodValidator, but the framework-validation fires
    an exception BEFORE our custom validation is processed. Maybe you don't have that problem
    because you use the default error messages. Do you use deferred Exceptions? We do so.
    Did you try JClient 3tiers deployments over the Internet?Yes, we tried it via VPN/DSL to validate that our framework interface-usage works both in 2-tier and 3-tier.
    After several attempts we were successfull, but the performance was poor.
    PS Are you connected to skype? Unfortunately no because of firewall restrictions. We only have access to ICQ.
    Regards,
    Claus

  • More Entity Validation problems

    I have 2 screens each based on different entities.
    I seem to get problems when i do the following:
    1) enter correct data in the first screen. Hit submit and correctly move to the second screen
    2) Enter invalid data in second screen, and press submit. At this point the entity validation kicks in and I display the problems.
    3) The user hits the back browser button.
    4) They change information in the first screen and hit submit.
    5) At this point the entiity from the second screen(which contains invalid data) validates again.
    6) Because there are errors in this second entity I can't get pass the first screen again.
    Is this standard functionality ?
    What am I doing wrong ?
    I'm using jdev 9.051 jsp/struts/adf.
    The only solution I have is to move the validation code from the entity to my struts action, but will only do this as a last resort !!

    Clicking the back button, doesn't clear the second entity and therefore it will still fail the validation.
    The user shouldn't click the back button, instead you should supply a "Cancel" button in the second page that will then clear the information that was entered in that screen and will navigate to the first form.

  • Entity validation across multiple pages

    Hi,
    I have an entity that spans multiple pages and are wondering how I can get the entity validation to work one page at a time. Currently if I have mandatory attributes that are not shown until the second page I receive errors from the first page stating that these muist be entered.
    My current thoughts on fixing this is either to change my model to on epage per entity, or to turn of entity validation (including mandatory attributes) and just do my validations in my struts actions.
    This is a Jsp/ Struts / ADF BC project.
    Many Thanks,
    Richard

    Leo,
    I'm not sure I would have done this with columns. Because of your desire to link from one piece of text to another, in all three columns, I would use linking text boxes. Each of the three boxes on a page will be independent of each other, but can be linked to the boxes on the following pages. Does that seem like what you're looking for?
    -Dennis

  • Entity validation with groovy expression

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    I have an entity object with two attributes "status" and "reason".
    Only in case the user select status id "4" I would like to validate that he will select also reason.
    for this I was trying to add entity validation with groovy expression.
    so I added this expression "Status== 4 && Reason == null" and also I added failure message.
    But it doesn't work as I expected.
    The error is displayed every time, also when the user select status that is not 4 and also when he select status 4 and the reason is not null.
    How should I write this groovy expression?
    Thanks

    Just to clarify,
    If you add this validation to your status attribute then it will validate that Reason is not null when you change the status to 4.
    If you want to raise an entity validation just add a new Entity Validator and the expression should be something like what you had:
    But slightly different
    Status != null ? (Status==4? (Reason!=null) : true) : true

  • Validation using a DB function

    Hi,
    I am trying to add declarative validation for a field. The validation is a complex one whose logic resides in the database (let's call it is_valid_part).
    There are 2 pages, first page they enter a part, and on the second they get some part info. I'm using a transient VO, and hoping to stop the user at the first page if the is_valid_part doesnt pass.
    is_valid_part takes 2 parameters - the part number and the logged in user's ID.
    I saw this blog: http://andrejusb.blogspot.com/2010/04/implementing-custom-generic-plsql.html, and other examples on custom validator using backing bean, but they dont talk about how you can pass any other value other than the value on the field (in this case part number). In my case I am trying to pass in both the part number and user's id, which will come from a backing bean.
    I can write a method in the AM but I am trying to as declaratively as possible. Any suggestions?
    Thank you
    Kalp

    Thank you. Looked at the page you provided, but it mentions that "For an attribute-level validator, the method must take a single argument of the same type as the entity attribute. " That is, it can only use the value of the part number, and I cant pass in user id. i'd said user id for simplicity, it's actually a user related ID that is coming from another transient attribute that stores that info, and I will pull that into a managed bean..
    So is an AM method the only way to go? Or there is some other way to allow validation rule to accept 2 parameters?
    thanks!
    kalp

  • How to refresh View bind variables or is this a bug in Entity Validation?

    Maybe I am missing something. Here is the scenario:
    1. I got a create/edit form with a field (*tfA*) that is a af:selectInputText that launches a search form pop up.
    2. The form (which is tied to an Entity ADF object) has validations -both attribute specific and global (for lack of better term..) set up in the Entity Object Editor wizard.
    3. I noticed that when a global validation fails, when i launch the search form from tfA, it ignores whatever search criteria I enter (ie it retrieves all rows)
    Otherwise, the pop up search form works perfectly. I am wondering if I need to reset the bindVariable values somewhere or if it has something to do with a refreshCondition. What confuses me though is that it works just fine if the global (ADF Entity) validations don't fail.
    The pop up search form uses the default ExecuteWithParams action listener that calls a view with bindvariables. My JDev version is 10.1.3.4
    Any help is appreciated. Thank you.

    The issue turns out to be that the Global Entity Validation continues to fire even after you click on the find button on your selectInputText component. The Entity validation is interrupting the call to the View Object in my pop up search window because somehow clicking search on the pop up is submitting the originating form.
    I am still not sure if this is a bug that needs to be addressed or I was doing something odd but the solution is the following:
    in your *<af:selectInputText />,* add the following: *actionListener="#{bindings.Rollback.execute}"*
    This will prevent the validation from firing because it thinks that you are trying to submit the form when all you're doing is actually launching a search pop up.
    Hope that helps.
    Edited by: rrey on Aug 3, 2009 3:58 PM

  • Cross entity BRF rules to update table UI elements

    Hello , I am trying to write a derivation using a cross entity rule that will update table UI element value. I have about 50 different rules to be created. Rule Example : Based on material type, derive the value of Sales organization and Plant.
    I have the cross entity BADI implemented. I am able to achieve the cross entity derivation for single elements, but anything in table, I am not able to get those updated.
    Please advice.

    Great that it works. However, you talk about cross-entity and BRF+. These are two different things and I'm afraid you are confusing them. Using the standard BRF+ derivation rules, you can't derive keys of entities. So, you can't default a plant for a given material type using the BRF+ derivation function.

  • Entity validation strange behaviour

    I have a number of method validators against an entity.
    The validators fire for incorrect data entered on the associated screen and once the data is fixed the user is presented with a second screen. All is fine so far ...
    Until the user hits the back button to go back to the first screen. For some reason even though the user enters invalid data the method validators don't fire !!!. Very confusing.
    Does anyone know of any reasons why this should occur ?
    Many Thanks,
    Richard

    Hi,
    I added a page-link to my second page as suggested. Using this method(instead of back button) causes the validation in the first screen to re-fire.
    The previously entered values in the first screen are gone as its a new request.
    I use code from your toystore to pre-create a record in the initializeModelForPage step. This fires when the link is clicked, and part of that code deletes the last entry from the entity cache. Therefore I'm not too surprised this works. As part of this project it has been stated that the users should be able to navigate through the browsers buttons, so I'm still abit stuck. Any suggestions ?
    What i've done for now is to remove my validation from BC4J to my struts actions.
    But because new values aren't recorded in the entity after a back button I also have to manually set the bindings for each screen field in my struts action.
    I'm not an expert in the adf / struts frame work so I could just be missing something.
    On a related point(assuming that i use entity validation) the following happens.
    On my first screen I enter valid data , and then move to my second. I leave the screen in an invalid date before pressing the browsers back button. I then can't get past the first screen as it is still validating the errors in the second screen. Shay mention that I should be using a cancel button in the second screen to navigate back to the first. This is a public user application and I know that the back button will be pressed(its not good web design to remove/disable it anyway).
    Any suggestions.
    It seems that I can't get the ADF framework to work well with wizards and perhaps its best to just use struts for the validation and at the end of the wizard just call a database package to do the DML ?
    Sorry but one last point - to do with the refresh button.
    All my wizards use page forwards to move between screens and I know this can cause oddities with a refresh. What I have noticed is that when even refreshing the first page of my wizard(after leaving it in an invalid state) the screen doesn't change the errors are still there. I would have though the refresh would request a new refreshed page without the struts action errors. I even noticed that a refresh can cause a struts action related to a submit button to re-fire ? Why does this happen as it can cause a big mess.
    Even re-entering the url in the same browser window doesn't cause the screen to properly refresh. The initializeModelForPage steps also do not fire when a refresh happens. I did notice that if I went to a different website and then re-entered the url that the page displayed more as expected and I think the initializeModelForPage step ran.
    I'm sure alot of this is due to the fact that I don't really understand the framework, and thus would be grateful if you could explain why all the above happens. Is it what you would expect to happen ?
    Many Thanks for your time and assistance.
    Richard

  • Not able to run validation using validation.xml & validator-rules.xml

    Hello Friends,
    I am not able to run validation using validation.xml & validator-rules.xml.
    Entire code in running prefectly but no error messages are prompted.
    Following is my code:
    File Name : struts-config.xml
    <struts-config>
    <!-- Form Beans Configuration -->
    <form-beans>
    <form-bean name="searchForm"
    type="com.solversa.SearchForm"/>
    </form-beans>
    <!-- Global Forwards Configuration -->
    <global-forwards>
    <forward name="search" path="/search.jsp"/>
    </global-forwards>
    <!-- Action Mappings Configuration -->
    <action-mappings>
    <action path="/search"
    type="com.solversa.SearchAction"
    name="searchForm"
    scope="request"
    validate="true"
    input="/search.jsp">
    </action>
    </action-mappings>
    <!-- Message Resources Configuration -->
    <message-resources
    parameter="ApplicationResources"/>
    <!-- Validator Configuration -->
    <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>
    <br> File Name : <b> validation.xml </b>
    <form-validation>
    <formset>
    <form name="searchForm">
    <field property="name" depends="minlength">
    <arg key="label.search.name" position = "0"/>
    <arg1 name="minlength" key="${var:minlength}" resource="false"/>
    <var>
    <var-name>minlength</var-name>
    <var-value>5</var-value>
    </var>
    </field>
    <field property="ssNum" depends="mask">
    <arg0 key="label.search.ssNum"/>
    <var>
    <var-name>mask</var-name>
    <var-value>^\d{3}-\d{2}-\d{4}$</var-value>
    </var>
    </field>
    </form>
    </formset>
    </form-validation>
    <br> File Name : <b> SearchForm.java </b>
    package com.jamesholmes.minihr;
    import java.util.List;
    import org.apache.struts.validator.ValidatorForm;
    public class SearchForm extends ValidatorForm
    private String name = null;
    private String ssNum = null;
    private List results = null;
    public void setName(String name) {
    this.name = name;
    public String getName() {
    return name;
    public void setSsNum(String ssNum) {
    this.ssNum = ssNum;
    public String getSsNum() {
    return ssNum;
    public void setResults(List results) {
    this.results = results;
    public List getResults() {
    return results;
    <br> File Name : <b> SearchAction.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    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;
    public final class SearchAction extends Action
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception
    EmployeeSearchService service = new EmployeeSearchService();
    ArrayList results;
    SearchForm searchForm = (SearchForm) form;
    // Perform employee search based on what criteria was entered.
    String name = searchForm.getName();
    if (name != null && name.trim().length() > 0) {
    results = service.searchByName(name);
    } else {
    results = service.searchBySsNum(searchForm.getSsNum().trim());
    // Place search results in SearchForm for access by JSP.
    searchForm.setResults(results);
    // Forward control to this Action's input page.
    return mapping.getInputForward();
    <br> File Name : <b> EmployeeSearchService.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    public class EmployeeSearchService
    /* Hard-coded sample data. Normally this would come from a real data
    source such as a database. */
    private static Employee[] employees =
    new Employee("Bob Davidson", "123-45-6789"),
    new Employee("Mary Williams", "987-65-4321"),
    new Employee("Jim Smith", "111-11-1111"),
    new Employee("Beverly Harris", "222-22-2222"),
    new Employee("Thomas Frank", "333-33-3333"),
    new Employee("Jim Davidson", "444-44-4444")
    // Search for employees by name.
    public ArrayList searchByName(String name) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if (employees.getName().toUpperCase().indexOf(name.toUpperCase()) != -1) {
    resultList.add(employees[i]);
    return resultList;
    // Search for employee by social security number.
    public ArrayList searchBySsNum(String ssNum) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if (employees[i].getSsNum().equals(ssNum)) {
    resultList.add(employees[i]);
    return resultList;
    <br> File Name : <b> Employee.java </b>
    package com.solversa;
    public class Employee
         private String name;
         private String ssNum;
         public Employee(String name, String ssNum) {
         this.name = name;
         this.ssNum = ssNum;
         public void setName(String name) {
         this.name = name;
         public String getName() {
         return name;
         public void setSsNum(String ssNum) {
         this.ssNum = ssNum;
         public String getSsNum() {
         return ssNum;
    Pls help me out.
    Not able to prompt errors.

    Hello Friends,
    I am not able to run validation using
    validation.xml & validator-rules.xml.
    Entire code in running prefectly but no error
    messages are prompted.
    Following is my code:
    File Name : struts-config.xml
    <struts-config>
    <!-- Form Beans Configuration -->
    <form-beans>
    <form-bean name="searchForm"
    type="com.solversa.SearchForm"/>
    ans>
    <!-- Global Forwards Configuration -->
    <global-forwards>
    <forward name="search" path="/search.jsp"/>
    global-forwards>
    <!-- Action Mappings Configuration -->
    <action-mappings>
    <action path="/search"
    type="com.solversa.SearchAction"
    name="searchForm"
    scope="request"
    validate="true"
    input="/search.jsp">
    tion>
    </action-mappings>
    <!-- Message Resources Configuration -->
    <message-resources
    parameter="ApplicationResources"/>
    <!-- Validator Configuration -->
    <plug-in
    className="org.apache.struts.validator.ValidatorPlugI
    ">
    <set-property property="pathnames"
    value="/WEB-INF/validator-rules.xml,
    /WEB-INF/validation.xml"/>
    >
    </struts-config>
    <br> File Name : <b> validation.xml </b>
    <form-validation>
    <formset>
    <form name="searchForm">
    <field property="name" depends="minlength">
    <arg key="label.search.name" position = "0"/>
    <arg1 name="minlength" key="${var:minlength}"
    resource="false"/>
    <var>
    <var-name>minlength</var-name>
    <var-value>5</var-value>
    </var>
    </field>
    <field property="ssNum" depends="mask">
    <arg0 key="label.search.ssNum"/>
    <var>
    <var-name>mask</var-name>
    <var-value>^\d{3}-\d{2}-\d{4}$</var-value>
    </var>
    </field>
    /form>
    </formset>
    form-validation>
    <br> File Name : <b> SearchForm.java </b>
    package com.jamesholmes.minihr;
    import java.util.List;
    import org.apache.struts.validator.ValidatorForm;
    public class SearchForm extends ValidatorForm
    private String name = null;
    private String ssNum = null;
    private List results = null;
    public void setName(String name) {
    this.name = name;
    public String getName() {
    return name;
    public void setSsNum(String ssNum) {
    this.ssNum = ssNum;
    public String getSsNum() {
    return ssNum;
    public void setResults(List results) {
    this.results = results;
    public List getResults() {
    return results;
    <br> File Name : <b> SearchAction.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    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;
    public final class SearchAction extends Action
    public ActionForward execute(ActionMapping
    mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception
    EmployeeSearchService service = new
    EmployeeSearchService();
    ArrayList results;
    SearchForm searchForm = (SearchForm) form;
    // Perform employee search based on what criteria
    was entered.
    String name = searchForm.getName();
    if (name != null && name.trim().length() > 0) {
    results = service.searchByName(name);
    else {
    results =
    service.searchBySsNum(searchForm.getSsNum().trim());
    // Place search results in SearchForm for access
    by JSP.
    searchForm.setResults(results);
    // Forward control to this Action's input page.
    return mapping.getInputForward();
    <br> File Name : <b> EmployeeSearchService.java </b>
    package com.jamesholmes.minihr;
    import java.util.ArrayList;
    public class EmployeeSearchService
    /* Hard-coded sample data. Normally this would come
    from a real data
    source such as a database. */
    ivate static Employee[] employees =
    new Employee("Bob Davidson", "123-45-6789"),
    new Employee("Mary Williams", "987-65-4321"),
    new Employee("Jim Smith", "111-11-1111"),
    new Employee("Beverly Harris", "222-22-2222"),
    new Employee("Thomas Frank", "333-33-3333"),
    new Employee("Jim Davidson", "444-44-4444")
    // Search for employees by name.
    public ArrayList searchByName(String name) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if
    (employees.getName().toUpperCase().indexOf(name.toU
    pperCase()) != -1) {
    resultList.add(employees[i]);
    return resultList;
    // Search for employee by social security number.
    public ArrayList searchBySsNum(String ssNum) {
    ArrayList resultList = new ArrayList();
    for (int i = 0; i < employees.length; i++) {
    if (employees[i].getSsNum().equals(ssNum)) {
    resultList.add(employees[i]);
    return resultList;
    <br> File Name : <b> Employee.java </b>
    package com.solversa;
    public class Employee
         private String name;
         private String ssNum;
         public Employee(String name, String ssNum) {
         this.name = name;
         this.ssNum = ssNum;
         public void setName(String name) {
         this.name = name;
         public String getName() {
         return name;
         public void setSsNum(String ssNum) {
         this.ssNum = ssNum;
         public String getSsNum() {
         return ssNum;
    Pls help me out.
    Not able to prompt errors.
    Hi,
    Your error message are not displaying because u does not made Message-Resoucrce property file (Resource Bundle) when you make it .
    give it entry in
    struts-config.xml
    <message-resources parameter="ApplicationResources" />
    and
    define key and corresponding error message to key in this ApplicationResources i.e
    #Error Resources
    label.search.ssNum=Plz Enter correct ssNum

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • HT204053 I am trying to sign up for icloud using windows 7. When I enter my apple id it says "this is a valid apple id but is not an icloud account". Where do I create an icloud account?

    I am trying to sign up for icloud using windows 7. When I enter my apple id it says "this is a valid apple id but is not an icloud account". Where do I create an icloud account?

    I already quoted the minimum requirements, look in the post before yours.
    You will have to upgrade your Mac to at least 10.7.5, upgrades are not free, you buy them from the App Store. Mountain Lion is the best but your Mac must be compatible.
    Here is a list of compatible machines.
    Also note that some older apps (Office 2004, Appleworks) will not run on Mountain Lion.

Maybe you are looking for

  • ABAP query - Incomplete layout from existing variant

    Hi all, We're currently testing our conversion from 46C (non unicode) to ECC6.0 (unicode). In SQ01, when we use a layout variant created in 46C, only the additional fields (e.g. Text:Sold-To) are displayed even though all the other fields are availab

  • How to set %Appdata% to point to roaming or local

    Hi Forum, I'm having some troubles with AutoCAD 2012 and it's locations where to install too. When typing in %APPDATA% into your Run prompt, Explorer, or Start searchbar you open the location of the Appdata folder for the current user. Now this curre

  • "We could not complete your iTunes store request. The connection was reset". Help please!

    Help PLEASE! Let me explain my situation: - iTunes store has been working fine on all computers for the past few years. - Modem gets struck by lightning last Mon. - Get a new Netgear modem yesterday. - Internet all working fine. Can browse, download

  • Email setting keeps changing

    I had to re-install my software because I had a "permissions" issure Disk Utility could not fix. I have everything working except my email. I put in the outgoing email name of my ISP smtp.citlink.net. They reguire a user name dsve and password. I ent

  • I have an 'Unknown error' message pop up when i try and sign in on itunes

    I have never had a problem signing in until now, I tried to sign in to add a song to my wish list and itunes wanted my password for my Apple ID. I put it in and a red message saying 'unknown error' popped up. I have reset my password and it still won