• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Struts Virtual Form validation no longer working after 1.3.10 upgrade

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Upgrade from Struts 1.1 to Struts 1.3.10 java 7

The original Struts used to allow validation of a virtual form concept, where the form called in the validation.xml is not actually defined in the struts-config.
Does anyone know how to fix this issue without having to re-write?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
         "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
         "http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>

<!-- FORM BEANS -->
<form-beans>
<form-bean name="juvenilePhysicalCharacteristicsForm" type="ui.juvenilecase.form.JuvenilePhysicalCharacteristicsForm"/>

</form-beans>
<!-- END FORM BEANS -->
<!-- ========== Exception Definitions ========================= -->
<global-exceptions>
<exception key="exception.title" type="java.lang.Exception" handler="ui.exception.StrutsExceptionHandler" />
<exception key="exception.title" type="javax.servlet.jsp.JspException" handler="ui.exception.StrutsExceptionHandler" />
<exception key="exception.title" type="javax.servlet.error.exception" handler="ui.exception.StrutsExceptionHandler" />
<exception key="exception.title" type="org.apache.struts.action.EXCEPTION" handler="ui.exception.StrutsExceptionHandler" />
<exception key="exception.title" type="mojo.km.messaging.exception.ReturnException" handler="ui.exception.ReturnExceptionHandler" />
</global-exceptions>

<!-- Global Forwards -->
<global-forwards>
<forward name="handleException" path="/jsp/error.jsp" />
</global-forwards>


<!-- **ACTION MAPPINGS** -->


   <action-mappings>
<!--  ~~~~~~~~~~~~~~~~~~~~~ GENERIC  MAPPINGS  ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<action path="/globalBack" forward="/jsp/back.jsp"/>
<action path="/globalCancel" forward="/jsp/cancel.htm"/>

<action name="juvenilePhotoForm" path="/getJuvenilePhoto" scope="session" type="ui.juvenilecase.action.GetJuvenilePhotoAction" parameter="submitAction">
<forward name="success" path="/jsp/caseworkCommon/juvenilePhoto.jsp"/>
<!-- GANG TATTOO PHOTO-11051 starts-->
<forward name="tattooSuccess" path="/jsp/caseworkCommon/juvenileTattoo.jsp"/>
<!-- GANG TATTOO PHOTO-11051 ends-->
</action>



<!-- ~~~~~~~~~~~~~~~~~~~~~ JUVENILE Physical Characteristics MAPPINGS ~~~~~~~~~~~~~~~~~~~~~~~ -->
<action name="juvenilePhysicalCharacteristicsForm" path="/displayJuvenilePhysicalCharacteristicsCreate" scope="session" type="ui.juvenilecase.action.DisplayJuvenilePhysicalCharacteristicsCreateAction" parameter="submitAction">
<forward name="success" path="/jsp/juvTabMain/juvenilePhysicalCharacteristicCreate.jsp"/>
<forward name="scarsAndTattoos" path="/jsp/juvTabMain/juvenileScarsAndTatoos.jsp"/>
</action>

<action name="juvenilePhysicalCharacteristicsForm" path="/displayJuvenilePhysicalCharacteristicsCreateSummary" scope="session" type="ui.juvenilecase.action.DisplayJuvenilePhysicalCharacteristicsCreateSummaryAction" parameter="submitAction">
<forward name="back" path="/globalBack.do"/>
<forward name="cancel" path="/displayJuvenileMasterInformation.do"/>
<forward name="success" path="/jsp/juvTabMain/juvenilePhysicalCharacteristicCreateSummary.jsp"/>
</action>

<action name="juvenilePhysicalCharacteristicsForm" path="/displayJuvenileTattooAndScarsCreateSummary" scope="session" type="ui.juvenilecase.action.DisplayJuvenileTattooAndScarsCreateSummaryAction" parameter="submitAction">
<forward name="back" path="/globalBack.do"/>
<forward name="cancel" path="/displayJuvenileMasterInformation.do"/>
<forward name="success" path="/jsp/juvTabMain/juvenileScarsAndTattoosUpdateConfirmation.jsp"/>
<forward name="error" path="/jsp/juvTabMain/juvenileScarsAndTatoos.jsp"/>
</action>

<action name="juvenilePhysicalCharacteristicsForm" path="/saveJuvenileTattooAndScarsCreateSummary" scope="session" type="ui.juvenilecase.action.SaveJuvenileTattooAndScarsCreateSummaryAction" parameter="submitAction">
<forward name="back" path="/globalBack.do"/>
<forward name="cancel" path="/displayJuvenileMasterInformation.do"/>
<forward name="success" path="/jsp/juvTabMain/juvenileScarsAndTattoosUpdateConfirmation.jsp"/>
</action>

<action name="juvenilePhysicalCharacteristicsForm" path="/submitJuvenilePhysicalCharacteristicsCreate" scope="session" type="ui.juvenilecase.action.SubmitJuvenilePhysicalCharacteristicsCreateAction" parameter="submitAction">
<forward name="success" path="/jsp/juvTabMain/juvenilePhysicalCharacteristicCreateSummary.jsp"/>
<forward name="back" path="/globalBack.do"/>
<forward name="cancel" path="/displayJuvenileMasterInformation.do"/>
</action>


</action-mappings>  

<!-- ========== Message Resources ============================= -->
<message-resources parameter="ApplicationResources_JuvCasework"/>

<!-- ========== Plug Ins 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>


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
       "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN"
       "http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd">

<form-validation>

<!-- ========== Default Language Form Definitions ===================== -->
<formset>

<!-- JUVENILE PHYSICAL CHARACTERISTICS -->
<form name="juvenilePhysicalCharacteristicsCreateForm">
<field property="buildId" depends="required">
<arg key="prompt.build" />
</field>
<field property="heightFeet" depends="required,mask,range">
<arg key="prompt.heightFeet" />
<arg name="range" key="${var:min}" resource="false"/>
     <arg name="range" key="${var:max}" resource="false"/>
       <msg name="mask" key="errors.numeric" />
       <var>
<var-name>mask</var-name>
<var-value>^[0-9]*$</var-value>
</var>
<var>
                   <var-name>min</var-name>
                   <var-value>3</var-value>
       </var>
       <var>
                   <var-name>max</var-name>
                   <var-value>8</var-value>
       </var>
</field>

<field property="heightInch" depends="required,mask,range,minlength">
<arg key="prompt.heightInch" />
   <arg name="range" key="${var:min}" resource="false"/>
   <arg name="range" key="${var:max}" resource="false"/>
<arg name="minlength" key="${var:minlength}" resource="false"/>
<msg name="mask" key="errors.numeric" />
<var>
<var-name>mask</var-name>
<var-value>^[0-9]*$</var-value>
</var>
<var>
<var-name>minlength</var-name>
<var-value>1</var-value>
</var>
<var>
               <var-name>min</var-name>
               <var-value>0</var-value>
       </var>
       <var>
               <var-name>max</var-name>
               <var-value>11</var-value>
       </var>
</field>

<field property="weight" depends="required,mask,range">
<arg key="prompt.weight" />
<arg name="range" key="${var:min}" resource="false"/>
<arg name="range" key="${var:max}" resource="false"/>
<msg name="mask" key="errors.numeric" />
<var>
<var-name>mask</var-name>
<var-value>^[0-9]*$</var-value>
</var>
<var>
           <var-name>min</var-name>
           <var-value>50</var-value>
   </var>
   <var>
           <var-name>max</var-name>
           <var-value>499</var-value>
   </var>
</field>

</form>


</formset>
</form-validation>

<%--THESE TWO LINES FOR STRUTS & JAVASCRIPTS VALIDATIONS--%>
<html:javascript formName="juvenilePhysicalCharacteristicsCreateForm" />

<%-- Javascript for emulated navigation --%>
<title><bean:message key="title.heading"/> - juvenilePhysicalCharacteristicsCreate.jsp</title>
<!--JQUERY FRAMEWORK-->
<%@include file="../jQuery.fw"%>
<script type='text/javascript' src="/<msp:webapp/>js/casework.js"></script>
<script type='text/javascript' src="/<msp:webapp/>js/juvenileProfileInfo.js"></script>
<script type='text/javascript' src="/<msp:webapp/>js/casework_util.js"></script>
<script type='text/javascript' src="/<msp:webapp/>js/app.js"></script>
</head>
<%--END HEADER TAG--%>

 
Saloon Keeper
Posts: 6633
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Struts 1 has multiple well-documented security holes that will not get patched. If you make an effort to migrate your app, I strongly advise to migrate to Struts 2.5.
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic