• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need Help in running a struts applicaton

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I am trying to run a sample application called miniHR.
Its give in the book Struts Complete Reference.
But when i try to run the application, using the URL

http://localhost:8080/index.jsp and click on the link
Search Employees, I get this exception in the browser -

javax.servlet.ServletException: Cannot retrieve definition for form bean searchForm on action /search

I have checked and rechecked the struts-config.xml file and everything seems to be all right.

I am uploading the code on this link download code

This link will take you to a website called rapidsahre.de
Scroll down and click on the FREE button to download the code.

Please help
Thanks in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niranjan,
In the Struts config XML, SearchAction takes a SearchForm. Where is the form on index.jsp that is getting passed to it?

In the future (or for follow ups to this question), please post the relevant code snippets in the forum. It's a lot of steps to download this large zip file - which discourages people from looking at the problem.

In this case, the relevant files would be the XML and the index.jsp.
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Niranjan,

Your expception basically tells that the Form Bean has not been associated correctly with struts-config or it is not present in the classes folder. There may be some typos also which are the most un-noticable errors.
This link gives a great refernce to the common struts errors. This should be helpful for common errors.
http://www.geocities.com/Colosseum/Field/7217/SW/struts/errors.html.

If some problem exists, please post the JSP, action class adn struts-config.
Regards,
Roshani
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic