You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Bryant, Doug" <DB...@scra.org> on 2002/09/13 15:24:45 UTC

Help using Validator running under sub-application

I'm trying to use validator with a sub-application.  To test to see if
validator could work under sub-applications, I am trying to validate just
one field on my DynaValidatorForm, expirationDate.

I can load the action/page that I need to validate, add some data to that
page, and then submit.  When I submit and I have bad data, I keep getting
404 errors, but when I insert valid data, the action successfully forwards
to where it is supposed to go.

I turned up struts logging to 99 in web.xml to try to see what was going on.
Validator appears to be setup correctly.  Validator catches the error in the
field it needs to validate, then, the uri gets mangled to produce the 404
error.  It is trying to forward off to "/mySubApp/mySubApp/inputPage.html"
instead of "/mySubApp/inputPage.html".     the method
"internalModuleRelativeForward" appears to be what is pre-pending the extra
path to the uri.

Has anyone ever run across this?  Am I doing something incorrectly?  I
changed the "input" to the action (editEtoRfq) that is getting validated
serveral times to try to resolve the issue, with not success.  I have put
the validator plugin in both the struts-config.xml and the
struts-config-eto.xml (not at the same time) with no luck.

Below is how my actions are setup.  Thanks very much for any feedback.

Thanks, Doug


<!-- action that we forward to to populate page data -->

<action path="/editEtoRfq"
   type="org.scra.emall.web.eto.actions.EditEtoRfqAction"
   scope="request" 
   name="etoRfqForm"
   input="/eto/editEtoRfq.jsp">
<forward name="success" 
         contextRelative="true"   
         path="/eto/editEtoRfq.jsp"/>
</action>


<!-- validating action for that page - 
     where editEtoRfq.jsp submits to -->

<action path="/saveEtoRfq" 
  type="org.scra.emall.web.eto.actions.SaveEtoRfqAction"
  scope="request" 
  name="etoRfqForm"
  input="/eto/editEtoRfq.jsp"
  parameter="save"
  validate="true">
  <forward name="success" 
          contextRelative="
          true" path="/eto/listEto.do"/>
</action>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Help using Validator running under sub-application

Posted by Eddie Bush <ek...@swbell.net>.
Bryant, Doug wrote:

>I'm trying to use validator with a sub-application.  To test to see if
>validator could work under sub-applications, I am trying to validate just
>one field on my DynaValidatorForm, expirationDate.
>
I don't know which version you're using, but someone voiced some issues 
with the validator wrt sub-apps.  I believe this behavior has been fixed 
in the nightly build.

>I can load the action/page that I need to validate, add some data to that
>page, and then submit.  When I submit and I have bad data, I keep getting
>404 errors, but when I insert valid data, the action successfully forwards
>to where it is supposed to go.
>
Wild ...

>I turned up struts logging to 99 in web.xml to try to see what was going on.
>Validator appears to be setup correctly.  Validator catches the error in the
>field it needs to validate, then, the uri gets mangled to produce the 404
>error.  It is trying to forward off to "/mySubApp/mySubApp/inputPage.html"
>instead of "/mySubApp/inputPage.html".     the method
>"internalModuleRelativeForward" appears to be what is pre-pending the extra
>path to the uri.
>
How are you getting here?  Using an action?  If you go directly to the 
page, the controller can't set the config.  Oh, and, where you 
submitting to?  I'm not sure, but it seems reasonable that submitting to 
an action in a different sub-app might cause problems (since you'd 
effectively be saying "go to that different sub-app") and thus your 
getinput might snag the wrong path.  I haven't had much coffee yet, so 
that could be *way* off!

>Has anyone ever run across this?  Am I doing something incorrectly?  I
>changed the "input" to the action (editEtoRfq) that is getting validated
>serveral times to try to resolve the issue, with not success.  I have put
>the validator plugin in both the struts-config.xml and the
>struts-config-eto.xml (not at the same time) with no luck.
>
>Below is how my actions are setup.  Thanks very much for any feedback.
>
>Thanks, Doug
>
>
><!-- action that we forward to to populate page data -->
>
><action path="/editEtoRfq"
>   type="org.scra.emall.web.eto.actions.EditEtoRfqAction"
>   scope="request" 
>   name="etoRfqForm"
>   input="/eto/editEtoRfq.jsp">
><forward name="success" 
>         contextRelative="true"   
>         path="/eto/editEtoRfq.jsp"/>
></action>
>
>
><!-- validating action for that page - 
>     where editEtoRfq.jsp submits to -->
>
><action path="/saveEtoRfq" 
>  type="org.scra.emall.web.eto.actions.SaveEtoRfqAction"
>  scope="request" 
>  name="etoRfqForm"
>  input="/eto/editEtoRfq.jsp"
>  parameter="save"
>  validate="true">
>  <forward name="success" 
>          contextRelative="
>          true" path="/eto/listEto.do"/>
></action>
>
I'm guessing this is all in the same config file (the actions).

What is *this* config?  Is this the eto cfg?  Why are your forwards 
marked context-relative?  Why do you have the sub-app in the path? 
 You'd only need that to *change* sub-apps, right?

Disclaimer:  I'm on CoC (Cup of Coffee) #1, so forgive me if I'm *way* 
off here.

Regards,

Eddie



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>