Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Not able to Call The Action class

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your searchWorkchecDepartment method have the same signature as an execute() method in a normal Action class? If not, that's the problem.
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not going inside the Action Class.
 
dimpsonu arora
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
bacon. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!