File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Not able to Call The Action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Not able to Call The Action class" Watch "Not able to Call The Action class" New topic
Author

Not able to Call The Action class

Akshay Singhvi
Ranch Hand

Joined: Nov 08, 2005
Posts: 93
Hello Ranchers,
In my jsp i have this a button on click of whic hthere is a javascript code which has this code.



in struts-config.xml the entry is


I've decleared an Action class that has a method "searchWorkchecDepartment". this action class extends dispatchAction.
Now the problem is, when i click on this button, a new blank page appears with this

The problem is it is not going to Action class.
Can your help me out....


Regards,<br />Akshay Singhvi<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (86%)
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Does your searchWorkchecDepartment method have the same signature as an execute() method in a normal Action class? If not, that's the problem.


Merrill
Consultant, Sima Solutions
dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
Hi,
Try following two things.
1. Use debugger to see if control is reaching to Action class. OR if you don't know the use of debugger then in your method of Action class print some statements like System.out.println....This will help you knowing if the control is reaching to your action class or not.
2.if it is reaching and returning success then the problem is with the forwarded JSP page. To check that, remove all the code from JSP and just print Testing.....

As per my understanding, there is some problem with your JSP.
Akshay Singhvi
Ranch Hand

Joined: Nov 08, 2005
Posts: 93
It's not going inside the Action Class.
dimpsonu arora
Ranch Hand

Joined: Aug 13, 2003
Posts: 51
Change your script as follows:

document.forms[0].action = "/displayDepartment.do?methodToCall=searchWorkchecDepartment"document.forms[0].submit()

Earlier it was-> I have removed "."
document.forms[0].action = "./displayDepartment.do?
 
 
subject: Not able to Call The Action class