Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation error messages

 
Lukas Alamar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??


thanx

lukas
[ July 12, 2005: Message edited by: Lukas Alamar ]
 
Cendy Nguvy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

For example, you can call it Application.properties.

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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic