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

Action not getting called

 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm new to struts and have had lots of questions since I started. I have a page where I want to iterate a list from the database. When the form shows up it always says there is no information to display and when I debug the action class never gets hit.

This is my struts-config:



This is my jsp:


My action's name is ProjectListAction.java and my form's name is ProjectListForm.java
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm wondering if the problem might be that you don't understand how to invoke a page from a Struts application. If the logic to populate the list of projects is in the ProjectListAction class, you should invoke this page with the following URL:

http://myserver.com/myApp/projectList.do

One other tip: The "attribute" in an action mapping is only used if it is different than the "name". Since yours are the same, I'd suggest you just eliminate the "attribute" from your action mapping.
 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, I am hitting the action now and am happily on my way to discoverying the reason behind my new error:-).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic