Problem with struts validator on WLS 8.1

I am having a strange problem, when I run my app in eclipse using weblogic plugin it works fine and I get no exception. As soon as I run it externally in a standalone server I get an ServletException which seem be be because of struts validator classes. I have checked the classpath and it seems to be identical in eclipse and startweblogic.cmd
          By the way, this code works fine on WLS 6.0
          Root cause of ServletException.
          javax.servlet.jsp.JspException: ServletException in '/common/sea-layout.jsp': ServletException in '/secure/sea
          -basicBOL-body.jsp': org/apache/commons/validator/Validator
          at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:921)
          at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
          at jsp_servlet._secure.__basicbol._jspService(__basicbol.java:368)
          at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
          at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
          at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:322)
          at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
          at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
          at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
          at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316)
          at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
          at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
          at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
          at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
          at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.jav
          a:6718)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
          at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
          at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
          Any pointer to fix this situation will be greatly appreciated.
          -Sankate

Got the solution.
          It was an classloader issue and I fixed by modifying the way EAR was getting packaged.
          I was including all commons-validation.jar and other commons jars in WEB-INF/lib dir. Some how it worked on WLS 6.0 but was not able to load the jars in WLS 8.1
          Move the jars out of lib dir and copy them to app/lib dir and add them to ejb manifest file because ejb jar is loaded before WAR by the classloader. This way when WAR is loaded, all the required jars are already loaded.
          I was getting servletexception and was not able to get to the root of exception (i.e. its a NullPointerexception or NoClassDefFoundException etc) so I added a scriplet in the root jsp and caught Throwable, that was I came to know the root of the problem.
          -Sankate

Similar Messages

  • Problem with Struts Validation and apache dtd definition.

    Jakarta Struts
    Java Version 1.5
    We have one web application that is being a little problematic, on startup two errors are thrown relating to the same problem (errors below).
    We get 401 returned for http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    both the validation.xml and validation-rules.xml have the same doc type set as below:
    <!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">
    We have the same configuration set for several other web application deployed succesfuly on the same tomcat application server without any problems. I'm not sure why this one application is causing a problem, I don't see any difference between the validation.xml and validation-rules.xml files in this application to any of the others that have been succesfully deployed, infact the validation-rules.xml is identical for all the web applications hosted on this server.
    Any ideas appreciated
    Error
    2006-03-30 15:04:50,968 ERROR [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:224) - Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
         at java.net.URL.openStream(URL.java)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:265)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:540)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:465)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:298)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:277)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
         at org.apache.commons.digester.Digester.parse(Digester.java:1515)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknown Source)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:161)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
         at javax.servlet.GenericServlet.init(GenericServlet.java:259)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)
         at com.evermind.server.Application.getHttpApplication(Application.java:889)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:690)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    2006-03-30 15:04:50,968 INFO [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:209) - Loading validation rules file from '/WEB-INF/validation.xml'
    2006-03-30 15:04:50,984 ERROR [HttpRequestHandler-169] validator.ValidatorPlugIn (ValidatorPlugIn.java:224) - Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
    java.io.IOException: Server returned HTTP response code: 401 for URL: http://jakarta.apache.org/commons/dtds/validator_1_0.dtd
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:791)
         at java.net.URL.openStream(URL.java)
         at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2292)
         at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:265)
         at oracle.xml.parser.v2.NonValidatingParser.pushExternalDTD(NonValidatingParser.java:540)
         at oracle.xml.parser.v2.NonValidatingParser.parseDoctypeDecl(NonValidatingParser.java:465)
         at oracle.xml.parser.v2.NonValidatingParser.parseProlog(NonValidatingParser.java:298)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:277)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:184)
         at org.apache.commons.digester.Digester.parse(Digester.java:1515)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknown Source)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:161)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
         at javax.servlet.GenericServlet.init(GenericServlet.java:259)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2141)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4582)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4676)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:820)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:542)
         at com.evermind.server.Application.getHttpApplication(Application.java:889)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:690)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    -----------------------------------------------------------------------

    hi,
    I am also facing the same issue. Could you tell me which are those jar files you were missing & from where you got those?
    regards
    prasanth

  • Lost Locale problem with Struts/Validator Plugin client side validation

    Has anyone else had problems losing the locale in the generated javascript ?
    With the following tiles def and layout (nmLayout.jsp) I can get the locale from the browser OK with
    <html:html locale="true"> and it works ok for imported text (picking up the enCA properties file. But when the javascript executes in the provisionCustomer.jsp the locale reverts to the default property file.
    The Strruts Validator loses the locale of the containing html page. (I do a show source.) I've tried an explicit <fmt:setLocale value="en_CA" scope="session"/> but this has no effect either.
    Thanks
    Bruce
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <!--
    Tiles definition file
    -->
    <tiles-definitions>
    <definition name="nm.MainMenu" path="/nmLayout.jsp">
    <put name="pageTitle" value="Distibutel Network Management" />
    <put name="header" value="header.jsp" />
    <put name="body" value="mainMenuBody.jsp" />
    <put name="footer" value="footer.jsp" />
    </definition>
    <definition name="nm.customer" path="/nmLayout.jsp">
    <put name="pageTitle" value="Distibutel Network Management -- Provision Customer" />
    <put name="header" value="header.jsp" />
    <put name="body" value="provisionCustomer.jsp" />
    <put name="footer" value="footer.jsp" />
    </definition>
    <!-- sample tiles definitions
    <definition name=".mainLayout" path="/common/layouts/classicLayout.jsp">
    <put name="title" value="Sample Page Title" />
    <put name="header" value="/common/header.jsp" />
    <put name="menu" value=".mainMenu" />
    <put name="footer" value="/common/footer.jsp" />
    <put name="body" value=".portal.body" />
    </definition>
    <definition name=".mainMenu" path="/common/layouts/vboxLayout.jsp" >
    <putList name="list" >
    <add value=".menu.links" />
    <add value=".menu.taglib.references" />
    <add value=".menu.printer.friendly" />
    <add value=".menu.old.documents" />
    </putList>
    </definition>
    <definition name="aPage" extends=".mainLayout">
    <put name="title" value="Another Title" />
    <put name="body" value=".aPage.body" />
    </definition>
    end samples -->
    <definition name="${YOUR_DEFINITION_HERE}">
    </definition>
    </tiles-definitions>
    nmLayout.jsp :
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts-menu.sf.net/tag" prefix="menu" %>
    <%@ taglib uri="http://struts-menu.sf.net/tag-el" prefix="menu-el" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
    <html:html locale="true">
    <head>
    <title><tiles:getAsString name="pageTitle"/></title>
    <link rel="stylesheet" type="text/css" media="screen"
    href="styles/global.css" />
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
    <style type="text/css">
    body { background: AliceBlue; }
    #appcontent {
                             position:absolute;
                             top: 300px;
                             left: 200px;
                   h1 {color: red;}
                   h2 {color: green;}
    </style>
    </head>
    <body topmargin="0" leftmargin="0">
    <!--
         <fmt:setBundle basename="ApplicationResources"/>
         <fmt:setLocale value="en_CA" scope="session"/>
    -->     
         <script type="text/javascript" src="./scripts/coolmenus3.js"></script>
         <!-- Custom config for this example -->
         <script type="text/javascript" src="./scripts/coolmenu2-config.js"></script>
         <menu:useMenuDisplayer name="CoolMenu"
         bundle="org.apache.struts.action.MESSAGE">
         <menu:displayMenu name="ToDoListMenuProvision"/>
         </menu:useMenuDisplayer>
    <table>
    <tr>
    <td><tiles:insert attribute="header"/></td>
    </tr>
    <tr>
    <td><div id="appcontent"><tiles:insert attribute="body"/></div></td>
    </tr>
    <tr>
    <td><tiles:insert attribute="footer"/></td>
    </tr>
    </table>
    </body>
    </html:html>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
    <html:javascript formName="customerForm" />
    <html:errors/>
    <h1><fmt:message key="ProvisionCustomer.title"/></h1>
    <html:form action="/saveCustomer"
    onsubmit="return validateCustomerForm(this)" >
    <table>
    <tr>
    <td><h2><fmt:message key="ProvisionCustomer.TenantName"/>:</h2></td><td> <html:text property="tenantName"/></td>
    </tr>
    <tr>
    <td><h2><fmt:message key="ProvisionCustomer.TenantID"/>:</h2></td><td> <html:text property="tenantID"/></td>
    </tr>
    <tr>
    <td><h2><fmt:message key="ProvisionCustomer.CustomerID"/>:</h2></td><td> <html:text property="customerID"/></td>
    <td></td><td><input type="submit" value=<fmt:message key="ProvisionCustomer.insert"/>></td>
    </tr>
    </table>
    </html:form>

    you can always get the locale from the request like so....
    <html>
    <%
    request.getLocale().toString();
    %>
    </html>
    you can even stuff it into javascript like so....
    <html>
    <head>
    <script>
    function foo() {
    var locale = '<%=request.getLocale().toString()%>';
    </script>
    </head>
    </html>
    then you can have access to it in javascript code.

  • Problem with Item Validation

    Hello,
    I am running an advanced tutorial: http://download.oracle.com/docs/cd/E14373_01/appdev.32/e13363/issue_track_ui.htm#BGBJCGIC
    and I have a problem with item Validation.
    Tutorial offers the following:
    You must manually create another validation to ensure that the Actual End Date is the same or later then the Start Date.
    To add a validation for the Actual End Date:
    1.Under Page Processing, Validations, click the Create icon.
    2.For Level, accept the default, Item level validation, and click Next.
    3.For Item, select Project Details: 50.P3_ACTUAL_END_DATE (Actual End Date) and click Next.
    4.For Validation Method:
    a.Select PL/SQL and click Next.
    b.Accept the default, PL/SQL Expression and click Next.
    5.For Sequence and Name:
    a.Sequence - Enter 50.
    b.Validation Name - Enter P3_END_AFTER_START.
    c.Accept the remaining defaults and click Next.
    6.For Validation:
    a.Validation - Enter:
    to_date(:P3_ACTUAL_END_DATE,:APP_DATE_FORMAT) >= to_date
    (:P3_START_DATE,:APP_DATE_FORMAT)
    b.Error Message - Enter:
    Actual End Date must be same or after Start Date.
    c.Click Next.
    7.For Conditions:
    a.Condition Type - Select Value of Item in Expression 1 is NOT NULL
    b.Expression 1 - Enter P3_ACTUAL_END_DATE
    8.Click Create.
    Is there a mistake in explanation? I did it 3 times already, very carefully! I ran the page, entered the date, which is After the Start date, and get the error message: Actual End Date must be same or After Start Date!!
    Thank you for your consideration...

    I got it solved. I don't know if this is documented(or a bug) but what I did was declare an exception and then raise it and put the form_trigger_failure into the exception handler rather than raise form_trigger_failure in the body.
    declare
    alreadyExists exception;
    begin
    -- select .....
    raise alreadyExists;
    exception
    when alreadyExists then
    message('.....exists');
    raise form_trigger_failure
    end;

  • Help! Problem with Struts tag html:errors/

    Hi everybody,
    In my JSP page called addUser.jsp, i have the different Struts Tag
    <html:errors/>
    <html:form action="/addUser" focus="firstName">
    </html:form>
    I have of course the ApplicationResources.properties file with differents Struts properties:
    errors.footer=</ul><hr>
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.ioException=I/O exception rendering error messages: {0}
    and an other one:
    error.fieldsNeeded=<font color="#FF0000">Some fields are missing.</font>
    when I call the addUser form, my JSP page display:
    null Some fields are missing. null
    Have u any suggestion about my prob?
    tx a lot
    s.

    Hi,
    can u post the java code where u are actually adding the error to the action errors. may be there is something wrong with that. I dont see any problem with the jsp or the applicationsResources.properties.
    Thanks
    Latha

  • Problem with date validation

    The enclosed trivial sample illustrates a problem I'm experiencing with validating dates
    The date field is initialized when the form opens.
    Once the form is open,  click the button and a popup appears saying there is a validation problem with the date field. Yet if the date is selected with the date selection widget the appearance is exactly the same, but without the validation problem. What's going on?

    OK, I've solved this, but I am hoping some kind person can tell me why I solved it.
    On the trivial form I enclosed before before, the "click" script used to say
    xfa.forms.recalculate(1);
    Now I've changed it to
    xfa.forms.recalculate (0);
    And I no longer see the undesired date validtion errors when I click the button. (See updated enclosure on this post).
    The difference is supposed to be that, if the parameter is 0 (or false) then only "pending" calculation scripts are fired, and if 1 (or true) then all calculation scripts are fired. So what does it mean to my DateTime field having unjust validation errors? The DateTime field has no calculation script, only an iitialize script.

  • A problem with struts -  DispatchAction class

    Hi,
    I am facing a problem with DispatchAction class in struts 1.1.
    Here is my senario:
    I have a two classes that extend DispatchAction - classA and classB.
    In classA, I have a start method. In classB, I have two methods - display and submit.
    When my application starts, my index.jsp does a logic:forward to the struts-config.xml file.
    e.g.:
    index.jsp<logic:forward name="startApp"/>
    struts-config.xml<form-beans>
         <form-bean name="testFormBean" type="package.testFormBean">
         </form-bean>
    </form-beans>
    <global-forwards>
         <forward name="startApp" path="/startApp.do?method=start"/>
    </global-forwards>
    <action-mappings>
         <action name="testFormBean"
    path="/startApp"
    parameter="method"
    validate="false"
    scope="request"
    type="package.StartAppActions">
         <forward name="successOneUser" path="/runSearch.do?method=display"/>
         </action>
         <action name="testBean"
    path="/runSearch"
    parameter="method"
    validate="false"
    scope="request"
    type="package.SearchActions">
                   <forward name="success" path="/html/jsps/success.jsp"/>
         </action>
    </action-mappings>
    when my application starts, the control goes to the index.jsp and then because of the logic forward goes to the start method of the /startApp action(i.e. the StartAppActions class). I return a ActionForward element with the value of "successOneUser".
    Uptill this point everything works fine.
    But now it should go the /runSearch element (i.e. SearchActions class) and the display method of it. But it is not going there. The error I am getting is action[runSearch] does not have a method named "start".
    I checked the value for the method parameter using the RAD/WSAD debugger, the value of parameter is "method" is still "start".
    I do not understand why it is not overiding the value of parameter "method" with display even though I am doing a
    <forward name="successOneUser" path="/runSearch.do?method=display"/> in the /startApp element, which should send the control to the display method of the [runSearch] element (i.e. in the startActions class).
    Can anyone tell me what the problem is ?
    Thanks in advance.
    kaushal

    Try this:
    Runtime.getRuntime().exec("your_batch_file.bat");
    where your_batch_file is:
    SET CLASSPATH=....(place all needed classes here)
    javac.exe filename
    must work,but there is some limitation...
    you must think to solve this problems.
    i hope that will help,
    Marius

  • Problem in struts validator

    hai
    I have a problem while using the struts validator in my program.
    It gives the error as:
    HTTP Status 404 - Servlet action is not available
    type Status report
    message Servlet action is not available
    description The requested resource (Servlet action is not available) is not available.
    The program is given below
    File : one.jsp
    <html:form action="/test" method="post">
    <table width="309">
    <tr>
    <td width="149"><div align="right">User Name: </div></td>
    <td width="148"><html:text property="username" value=""/></td>
    </tr>
    <tr>
    <td><div align="right">PassWord: </div></td>
    <td><html:password property="password" value="" /> </td>
    </tr>
         <tr>
    <td><div align="right">Number: </div></td>
    <td><html:password property="number" value="" /> </td>
    </tr>
    <tr>
    <td><div align="right"></div></td>
    <td><html:submit /> </td>
    </tr>
    </table>
    </html:form>
    web.xml file is ordineary file which contains the tag which is necessary for the struts.
    File : struts-config.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!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>
    <global-forwards>
    <forward name="database" path="/database"/>
    </global-forwards>
    <form-beans>
    <form-bean name="form1" type="struts1.bean1">
    </form-bean>      
    </form-beans>
    <action-mappings>
    <action path="/test" name="form1" type="struts1.one" input="one.jsp" validate="true" scope="request" >
         <forward name="success" path="/two.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="ApplicationResources" />
    <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>
    File validator.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!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">
    <form-validation>
    <formset>
    <!-- Form for Validation example -->
    <form name="form1">
    <field property="username" depends="required">
    <arg0 key="test.string"/>
    </field>
    <field property="password" depends="required">
    <arg0 key="test.password"/>
    </field>
    <field property="number" depends="required">
    <arg0 key="test.number"/>
    </field>
    </form>
    </formset>
    </form-validation>
    File validator-rules.xml
    The validator-rules.xml file is default validator-rules.xml file.
    Iam using the two java file for ActionForm and Action
    ActionForm file
    package struts1;
    import org.apache.struts.validator.ValidatorForm;
    public class bean1 extends ValidatorForm
    private String username=null;
    private String password=null;
    private int number=0;
    public void setUsername(String username)
    this.username=username;
    public String getUsername()
    return username;
    public void setPassword(String password)
    this.password=password;
    public String getPassword()
    return password;
    public void setNumber(int number)
    this.number=number;
    public int getNumber()
    return number;
    Action class:
    package struts1;
    import struts1.bean1;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.DynaActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.validator.ValidatorActionForm;
    import org.apache.struts.validator.ValidatorForm;
    import java.io.IOException;
    import javax.servlet.ServletException;
    public class one extends Action
    public ActionForward execute(ActionMapping mapping,ActionForm form1,HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
    String uname=null;
    String pword=null;
    String target=new String("success");
    int num=0;
    HttpSession session=request.getSession(true);
    try
    if(form1 !=null)
    bean1 form=(bean1) form1;
    uname=form.getUsername();
    pword=form.getPassword();
    num=form.getNumber();
    session.setAttribute("uname",uname);
    session.setAttribute("word",pword);
    session.setAttribute("num",""+num);
    catch(Exception e)
    return mapping.findForward(target);
    In two.jsp file Iam just getting the session value and displaying the result.
    The Action and ActionForm are used inside the struts1 file which is placed inside the classes folder.
    The Two file is also compiled successful.
    When executing the one.jsp file is displayed but when clicking the submit button it giving the error as servlet action is not available.
    So Iam try to change some coding in the Action Class
    In the execute method I changed ValidatorForm instead of ActionForm.
    but it giving the same error.
    The same error is displayed when Iam trying the DynaValidatorForm
    instead of struts bean class i.e ActionForm.
    If any one knows what is the problem in the program please give some instrutction to correct the error or give some simple example program for practice.
    Regards
    A.K. Raj

    Add the Validator as the 6th argument and it should work fine.
    Amy
    <validator name="required"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateRequired"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionMessages,
    org.apache.commons.validator.Validator,
    javax.servlet.http.HttpServletRequest"
    msg="errors.required"/>

  • Problem in struts validation

    hi,
    i am doing a project using struts framework.
    i've configured strtus-config.xml , validation.xml
    but validation framework is not working for me.
    when i click submitt button without entering any values, it directly maps to the success page. but it should show the errors.
    i've attached all the files with this. plz give me the solution
    struts-config.xml
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <struts-config>
    <form-beans>
    <form-bean name="allotIssueFormBean" type="issues.AllotIssueFormBean"/>
    </form-beans>
    <action-mappings>
    <action path="/allotIssue"
    type="issues.AllotIssueAction"
    scope="request"
    name="allotIssueFormBean"
    validate="true"
    input="/allotIssue.jsp">
    <forward name="success"
    path="/results/success.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="MessageResources" />
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validator/validation.xml" />
    <set-property property="stopOnFirstError" value="true" />
    </plug-in>
    </struts-config>
    -- validation.xml --
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
    <form-validation>
    <!--
    This is a minimal Validator form file with a couple of examples.
    -->
    <global>
    <!-- An example global constant
    <constant>
    <constant-name>postalCode</constant-name>
    <constant-value>^\d{5}\d*$</constant-value>
    </constant>
    end example-->
    </global>
    <formset>
    <!-- An example form -->
    <form name="AllotIssueFormBean">
    <field
    property="issueID"
    depends="required" >
    <arg0 key="ddd" resource="false"/>
    </field>
    <field
    property="listName"
    depends="required">
    <arg0 key="ddd"/>
    </field>
    <field
    property="projectName"
    depends="required">
    <arg0 key="ddd"/>
    </field>
    <field
    property="selectAllotting"
    depends="required">
    <arg0 key="ddd"/>
    </field>
    <field
    property="selectDate"
    depends="required">
    <arg0 key="ddd"/>
    </field>
    <field
    property="selectMonth"
    depends="required">
    <arg0 key="ddd"/>
    </field>
    <field
    property="selectYear"
    depends="required">
    <arg0 key="ddd"/>
    </field>
    </form>
    </formset>
    </form-validation>
    allotIssue.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <html:html>
    <head>
    <TITLE> ALLOTT ISSUE </TITLE>
    <html:javascript formName="allotIssueFormBean" staticJavascript="true" method="validateAllotIssueFormBean"/>
    <STYLE>
    body{
    font-family:verdana;
    background-color:#0111d3;
    color:white;
    font-size:8px;
    table
    font-size:10px;
    </STYLE>
    </head>
    <html:errors/>
    <html:form action="/allotIssue.do" >
    <TABLE border="1" align="center" bodercolor="silver" bgcolor='#4478f0' width="40%">
    <tr>
    <td colspan="2" style='border:0px' align="center">ALLOT ISSUE</td>
    </tr>
    <TR style='border:0px'>
    <TD>IssueID:</TD>
    <TD><html:text property="issueID"/></TD>
    </TR>
    <TR style='border:0px'>
    <TD>List Name:</TD>
    <TD><html:text property="listName"/></TD>
    </TR>
    <TR style='border:0px'>
    <TD>Project Name:</TD>
    <TD><html:text property="projectName"/></TD>
    </TR>
    <TR style='border:0px'>
    <TD>Allotted To:</TD>
    <TD><html:select property="selectAllotting" >
    <html:option value="associatename1">Name1</html:option>
    <html:option value="associateName2">Name2</html:option>
    <html:option value="associatename3">Name3</html:option>
    </html:select>
    </TD>
    </TR>
    <TR CLASS="tr">
    <TD CLASS="td" style='border:0px'>Projected-End-Date</td>
    <TD><html:select property="selectDate" >
    <html:option value="1">1</html:option>
    <html:option value="2">2</html:option>
    <html:option value="3">3</html:option>
    </html:select>
    <html:select property="selectMonth" >
    <html:option value="1" >Jan</html:option>
    <html:option value="2" >Feb</html:option>
    </html:select>
    <html:select property="selectYear">
    <html:option value="1990">1990</html:option>
    <html:option value="1991">1991</html:option>
    </html:select>
    </TD>
    </TR>
    <TR style='border:0px'>
    <TD colspan="2" align="center">
    <html:submit value="AllotIssue"/>
    <html:reset value="Reset"/>
    </TD>
    </TR>
    </TABLE>
    </html:form>
    </html:html>
    -- AllotIssueAction.java --
    * AllotIssueAction.java
    * Created on April 27, 2006, 4:49 PM
    * To change this template, choose Tools | Options and locate the template under
    * the Source Creation and Management node. Right-click the template and choose
    * Open. You can then make changes to the template in the Source Editor.
    package issues;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    public class AllotIssueAction extends Action {
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
    return(mapping.findForward("success"));
    -- AllotIssueFormBean --
    package issues;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    import org.apache.struts.validator.*;
    public class AllotIssueFormBean extends ValidatorForm {
    private String issueID = "";
    private String listName = "";
    private String projectName = "";
    private String selectAllotting = "";
    private String selectDate="";
    private String selectMonth="";
    private String selectYear="";
    public String getIssueID() {
    return(issueID);
    public void setIssueID(String issueID) {
    this.issueID = issueID;
    public String getListName() {
    return(listName);
    public void setListName(String listName) {
    this.listName = listName;
    public String getProjectName() {
    return(projectName);
    public void setProjectName(String projectName) {
    this.projectName = projectName;
    public String getSelectAllotting() {
    return(selectAllotting);
    public void setSelectAllotting(String selectAllotting) {
    this.selectAllotting = selectAllotting;
    public String getSelectDate() {
    return(selectDate);
    public void setSelectDate(String selectDate) {
    this.selectDate = selectDate;
    public String getSelectMonth() {
    return(selectMonth);
    public void setSelectMonth(String selectMonth) {
    this.selectMonth = selectMonth;
    public void setSelectYear(String selectYear) {
    this.selectYear = selectYear;
    public String getSelectYear() {
    return(selectYear);
    }

    In the following code...
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <struts-config>
    <form-beans>
    <form-bean name="allotIssueFormBean" type="issues.AllotIssueFormBean"/>
    </form-beans>... should the <form-bean> type attribute be org.apache.struts.validator.DynaValidatorForm? I've only done validation in this way (though I'm still a novice myself). Then you wouldn't need your allotIssueFormBean, and instead you would define the properties in the struts-config using...
    <form-bean ...>
      <form-property name="issueID" type="java.lang.String" />
      <form-property name="listName" type="java.lang.String" />
    ... etc...
    </form-bean>

  • Help with certficates - problems with CSSMERR_TP_NOT_TRUSTED & validating

    I'm having problems with my machine, and it appears to be a certificate problem. The problems first started showing up with codesigning and when trying to re-install XCode. I've been trying to understand things through keychain, but I don't know if what I'm seeing is normal or not.
    I've got two copies of Apple Root CA and Apple Root Certificate Authority in my keychains (one of each in "System", one of each in "System Roots"). I have no idea if that is normal or if that part of the problem. These all show up with "This root certificate is not trusted". I'm assuming that's OK, maybe that's part of the problem? (They are all have trust set to "use system defaults").
    The Apple Worldwide Developer Relations intermediate certificate that I download from Apple doesn't appear to find or trust the Apple Root CA (in keychain, the AWWDR shows "This certificate was signed by an unknown authority, and keychain "evaluate" doesn't find a root certificate, even though Apple Root CA is in the keychain).
    Note that the AWWDR certificate says that it's issuer was Apple Root CA, serial number 25, version 3, but the Apple Root CA certificate says that it's serial number 2, version 3. I'm not sure if that makes any difference.
    The big problem is that because of what I believe to be certificate problems, I'm getting the CSSMERRTP_NOTTRUSTED error reported when I try to codesign or even when I try to install the iPhone SDK.
    I did have my motherboard replaced a couple of months back, but things were working just fine (including codesigning) after that, and suddenly stopped working (I don't know when, I just know that I noticed the problem around Oct 12).
    For what it's worth, the error when trying to install XCode (with iPhone SDK) is:
    10/16/10 12:20:02 PM Installer[1582] Failed install preflight: Error Domain=PKInstallErrorDomain Code=102 UserInfo=0x19dd99d0 "The package “iPhoneSDKTools.pkg” is untrusted." Underlying Error=(Error Domain=NSOSStatusErrorDomain Code=-2147409622 UserInfo=0x1aa22360 "The operation couldn’t be completed. CSSMERRTP_NOTTRUSTED")

    Reinstalling Snow Leopard from the original DVD seems to have cleared up the problem. My Apple Root CA certificate now shows "valid".

  • Problem with custom validated data types using domain on 11g

    Hi,
    I ' m on a migration process from 10 to 11 and I notice that a custom domain didn't work correctly anymore
    to be more specific every time that I was submiting a page a was getting an error cannot convert from myclass to oracle.jbo.domain.String
    I search the forum and I saw a similar problem
    Cannot convert type class java.lang.String to class oracle.jbo.domain.Clob
    at which Frank says that it is a known bug and suggests a work around.
    I use the workaround and it worked but some more issues came up:
    1. If the validation fails I get the error that I throw at the validate method not in a popup with just my message
    but in the whole window with the whole error stack, meaning that my custom validation is not handled like native ADF validation errors by
    the framework (at 10.1.3.4 worked OK)
    2 If i dont give a value at the attribute in the validation phase mdata variable is not null but is length is zero (at 10.1.3.4 its value was null)
    public class AFM implements DomainInterface, Serializable {
    public AFM(String val) {
    mData = new String(val);
    validate();
    private String mData;
    protected void validate() {
    // ### Implement custom domain validation logic here. ###
    mData==null // returns false
    mData.length()==0 // returns true
    3. Can i force validation only for new or updated values? I saw that the validation process is taking place every time a row is fetched.
    This is not only a performance issue, the bigger problem is that if a fetched from the DB value fails the validation an error is return but the
    user cannot change the value to correct it.
    TIA
    Tilemahos

    since i don't get any answer I wonder if i should have use a more provocative title like
    "custom domains in 11g don't work"
    is it true?
    Tilemahos

  • Problem with XSD validation in Java 5

    Hi everyone,
    my application creates in memory schema using JDOM. In Java 6 validation runs fine, but in Java 5 (which is the target platform currently) it fails.
    I tried a second test with just parsing an existing XSD document (not created using JDOM) and that works.
    The textual representation of both (file and JDOM generated) are identical. If I replace the XSD file with the JDOM output, the "file test" runs fine, too.
    Here's the test code:
        protected void assertXsdValid(Source xsdSource, InputSource xmlInputSource) throws SAXException, ParserConfigurationException, IOException {
            isValid = true;
            SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
            sf.setErrorHandler(myErrorHandler);
            Schema schema = sf.newSchema(xsdSource); // <<--------- THIS LINE FAILS IN JAVA 5
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            dbf.setSchema(schema);
            DocumentBuilder db = dbf.newDocumentBuilder();
            db.setErrorHandler(myErrorHandler);
            db.parse(xmlInputSource);
            assertTrue(isValid);
        }This is the XSD:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://some.org/metamodel" elementFormDefault="qualified">
      <xs:element name="system">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="name" type="xs:string" />
            <xs:element name="vendor" type="xs:string" />
            <xs:element name="version" type="xs:decimal" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>This is the error message I get:
    ERROR: org.xml.sax.SAXParseException: s4s-att-invalid-value: Invalid attribute value for 'type' in element 'element'. Recorded reason: UndeclaredPrefix: Cannot resolve 'xs:string' as a QName: the prefix 'xs' is not declared.
    This is how I call the test code in the JDOM test:
            assertXsdValid(new JDOMSource(xsdDoc), new JDOMSource(xmlDoc).getInputSource());If I change the code to parsing not the JDOMSource, but a StreamSource reading the textual representation of the XSD, it works fine!
            assertXsdValid(new StreamSource(new ByteArrayInputStream(new XMLOutputter().outputString(xsdDoc).getBytes())), new JDOMSource(xmlDoc).getInputSource());But this is not what I want (I expect suboptimal performance with large XSD documents). So, if it works with Java 6, then why doesn't it work with Java 5?
    How can I use the Java 6 JAXP in Java 5?
    Thank you.

    A new user name?
    I can think of ways round your problem but can you first provide a reference that indicates that byte 0x80 is the MS936 encoding for the Euro?
    P.S. This is a forum and the vast majority of participants, including me, have no direct relationship with Oracle so getting definitive answers from Oracle via this forum is unlikely. If you think you have found a bug in 1.5 and/or 1.6, and I am not convinced you have, you need to report it via the bug database. If it is a bug then the response time for a fix is likely to be months rather than days.
    P.P.S No I can't explain why it works in 1.7!

  • UiXML: dataBinding problem with decimal validator

    I'm trying to use the decimal validator inside a uit template and dataBind the minValue, maxValue, maxScale and maxPrecision attributes to the ui:rootAttr dataObject like so:
    <textInput ...>
    <onSubmitValidater>
    <decimal
    data:minValue="minValue@ui:rootAttr"
    data:maxValue="maxValue@ui:rootAttr"
    data:maxPrecision="maxPrecision@ui:rootAttr"
    data:maxScale="maxScale@ui:rootAttr"/>
    </onSubmitValidater>
    </textInput>
    However that doesn't seem to work the validation never executes.
    But when I don't use dataBinding it works fine.
    Example:
    <textInput ...>
    <onSubmitValidater>
    <decimal
    minValue="0"
    maxValue="10"
    maxPrecision="2"
    maxScale="3"/>
    </onSubmitValidater>
    </textInput>
    Could it be that there is some bug with the decimal validator? I'm using the dateValidator in just the same way and it works fine.
    Guido

    We'll at least warn you of the problem starting in 9.0.5.
    Getting full databinding support in there may not happen
    by then.
    But there is a workaround today: databind the
    onSubmitValidater attribute:
    <textInput data:onSubmitValidater="decimal@someBean"/>
    ... to point to code that directly creates the
    DecimalValidater.
    public ClientValidater getDecimal()
    DecimalValidater validater = new DecimalValidater();
    validater.setMinValue(1.0);
    // etc...
    return validater;

  • Problems with the Validator

    Hi,
    I have a
    <h:command_hyperlink label="DataList" commandName="showList" actionRef="Bean.showDataListAction"/>
    and some late in the Code a <h:form .....> with some text fields using the custom validator. The value will be requaed for this text fields.
    The validator should only be invoked after the form submition.
    But it will be invoked every time that i click on the link, becouse the fields are empty.
    Goes every action from the JSP that have some fields to validate over the Validator?
    How can I obviate it?
    Thanks
    Viktoria Tokaev

    Hi Viktoria,
    I had that problem too. See what I wrote in following thread:
    http://forum.java.sun.com/thread.jsp?forum=427&thread=445506&message=2014319#2014319
    Greetings,
    Rene

  • [CS3] Publish problem with no valid HTML templates

    Hi,
    I have a project file which I have publish numerous times
    before without problems. It has come to finally publishing it for
    the last time and when I go to publish an error messages comes up
    saying...
    "no valid HTML templates are avaliable to complete this
    operation".
    I have reinstalled the app again but still getting the
    problem.
    Any ideas...

    I get to the point where you select Publish Settings in the
    file menu but then it comes up with the error message...

Maybe you are looking for