File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes validation-blank pop up window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation-blank pop up window" Watch "validation-blank pop up window" New topic

validation-blank pop up window

natasa jones
Ranch Hand

Joined: Aug 20, 2006
Posts: 45
i am trying to use struts validator,but i am having the following problem.the alert window pops up,but there is no text in it!!

my code in validation.xml is :
<form name="registerForm">
<field property="firstName"
<arg0 key=""/>
i have <message-resources> in struts-config and it works fine in other cases but not in this one!
i havent made any changes in validator-rules.xml.
can anyone help???
Vijendra Babar

Joined: Jul 28, 2006
Posts: 18

As you have specified <arg0 key=""/> tag in your .xml file, you need to first check wether there is any message present in your file.

Put this line in .properties file{0} is required.

This will prompt alert message saying "--Field Name-- is required"

Hope so your problem is solved.
natasa jones
Ranch Hand

Joined: Aug 20, 2006
Posts: 45
actually,my mistake was that i believed that errors.required which is the value of msg in validator-rules.xml already exists as an expression!Something like: errors.required={0} is a required field.
therefore i didnt write these messages myself and finally nothing appeared in the window!!
in .properties i have now errors.required and also:,register.message.surname=surname etc,so now in place of {0} of the error.required it puts name,or surname as i wanted!
thanks for your help anyway!
I agree. Here's the link:
subject: validation-blank pop up window
It's not a secret anymore!