|
From: Matthew P. H. <mp...@en...> - 2003-04-11 16:55:48
|
Hello,
I'm trying to get a reletively simple form working with the formproc API
for demonstration purposes however i'm running into some problems with the
script validators. I've been trying to use the FieldsMatch.py in my own
form and I get some odd results. The following is a snippet from my form
include:
<element name="session_1" optional="true">
<validator type="shared" name="forbidden_chars"/>
<message classname="org.formproc.message.ResourceBundleMessageProvider">
<bundle>org.formproc.example.ExampleResourceBundle</bundle>
<key>session_1.message</key>
</message>
</element>
<element name="session_1_class" optional="true">
<validator type="shared" name="forbidden_chars"/>
<message></message>
</element>
<element-group name="session_1">
<element name="session_1"/>
<element name="sessoin_1_class"/>
<validator type="script">
<script>FieldsMatch.py</script>
<error>Passwords must must match.</error>
</validator>
</element-group>
Now session_1_class and session_1 are both select boxes with different
values so they will never validate correctly but I should still get the
"Passwords must must match." error in my form when I do
<%= results.getErrorOrMessage("session_1") %>
in the jsp. But instead I get the following error when the above code is
included in the xml include:
org.formproc.FormConfigurationException: Form configuration not found for
'campcaen-page1'
at
org.formproc.FormManager.getFormConfiguration(FormManager.java:209)
at org.formproc.FormManager.configure(FormManager.java:196)
at
org.apache.jsp.campcaen_0002dpage1$jsp._jspService(campcaen_0002dpage1$jsp.java:183)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
etc...
'campcaen-page1' is the name of my form. I don't get this exception
without the <element-group><element-group/>. Also is there anyway to
return an error message from the script? I'm checking for schedule
conflicts between selections and it would be helpful if the script could
generate the error message based on what the problem was.
One more thing. It would be very helpful to have a more extensive example
that spans multiple pages and has more than just input boxes.
Thanks
Matt Hardy
mp...@um...
|