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 error messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation error messages" Watch "validation error messages" New topic

validation error messages

Lukas Alamar
Ranch Hand

Joined: Mar 17, 2004
Posts: 68
hi all
i get the following exception

javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE

here's what i wrote im my ActionForm class

i suppose i must create a file and map "error.param.notValid" to a message string or something ..

how can i display my error message in a jsp if say the param in the ActionForm class is empty??


[ July 12, 2005: Message edited by: Lukas Alamar ]

SCJP 1.4
Cendy Nguvy
Ranch Hand

Joined: May 25, 2005
Posts: 37

You have to create an application resource file in the src folder with your java code.

For example, you can call it

In this file, put :

In your struts-config:


In your jsp :

And in your ActionForm class :

In Struts-config.xml, don't forget to code :

And normally messageparam is required. will be displayed.

I hope it helps you.
[ July 13, 2005: Message edited by: cendy nguvy ]
I agree. Here's the link:
subject: validation error messages
It's not a secret anymore!