java ee - Client-side Validation in Struts 2 -



java ee - Client-side Validation in Struts 2 -

i new @ java web. follow tutorial struts 2 at: http://viralpatel.net

i success @ create server-side validation, client-side not work. when submit, notice javascript method not defined. seek viewing source, see no script generated. generated html source

http://pastebin.com/lc49jnms

there no javascript 'validateform_customer()' method.

in customer.jsp, have added validate attrubute:

<s:form action="customer.action" method="post" theme="xhtml" validate="true">

and added:

<s:actionerror/> <s:fielderror />

and

<s:head/>

in struts.xml:

<action name="customer" class="mypackage.customeraction"> <result name="success">/success.jsp</result> <result name="error">/customer.jsp</result> </action>

in code, have extended actionsupport, , have customeraction-validation.xml file. client-side validation not work, server-side validation work perfectly.

i using struts 2.1.6. don't know newer vesion not work me. build success have error in dispatcher initialize, when using taglib "struts-tags", throw error

the struts dispatcher cannot found. caused using struts tags without associated filter. struts tags usable when request has passed through servlet filter, initializes struts dispatcher needed tag. - [unknown location]

caused

org.apache.struts2.views.gxp.inject.injectedobjectcontainer

class not found!

the struts 2.1.6 seems work until seek using validation.

what did wrong?

thanks , sorry bad english

struts tags usable when request has passed through servlet filter seems missed filter mappings in web.xml tags defined. create sure there.

java-ee struts2 client-side-validation

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -