• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Struts1.2.7

 
Abhishek Asthana
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am not entirely new to struts, hence this problem is bothering me even more!

I made a simple struts application: Passing a value from a JSP and returning a corresponding result from ActionForm to another JSP. The problem is that the after I press the submit button, the control is not able to detect the ActionServlet.

Here is the code of JSP and the .xml files:



The web.xml is:


Struts-Config.xml:


On pressing the submit button, the URL visited is http://localhost:8080/Lookup?symbol=value

Clearly it is not going to .do! What can be the problem? I am working on Tomcat 5.5 and Struts1.2.7


Please help.Thanks
Abhishek
 
Eric Gero
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that in the JSP, you have type="pkg1.LookupForm" yet the form bean declaration in struts-config.xml says type="ch03.LookupForm". Maybe you have the packages switched?
 
Abhishek Dwaraki
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I completely agree with Eric. The type attribute in your form bean definition is supposed to be the fully qualified class name of that bean in the package. Since your's says pkg1 as the package, its supposed to be pkg1.LookupAction something where LookupAction is the name of your class. As a further practice, just make sure that you name your classes in correspondence with the base classes they extend. It will make it easier for you to debug them later. If they extend ActionForm, add a Form to the class name at the end, or Action at the end if they extend Action. It looks like a simple mapping error. Hope this helps...
 
Abhishek Dwaraki
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And I noticed the thing about the naming. You have followed it pretty much to the letter. I just mentioned it as an afterthought. Cheers.
 
Abhishek Asthana
Ranch Hand
Posts: 146
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhhh

I am sorry I misspelt some things. But now I managed to make some changes and some progress was made but I didn't reach anywhere!
First of all, I started using the struts html tags so on the click of submit button, the path of ActionServlet is being displayed in the browser's address bar, but the Servlet is not getting invoked! I checked the log files of Tomcat, even there there is no trace of Servlet getting executed.
What can be the error?

Please tell.
Abhishek
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic