Help determining why Struts App is no longer working

Posted on 2010-04-01
Medium Priority
Last Modified: 2013-11-24
I am a new to JAVA and Struts.  I had a working application until I decided to clean-up a few things (removed some SystemOut statements, removed duplicate code, etc.).  Now the application is not working and I can’t figure out why.  I didn’t modify the jsp or the struts-config.xml file.  There are no error messages in the console.   Before I include pieces of my code, I wanted to know where to look to try to determine what’s causing the problem.  Here’s a high level flow of what’s happening:

Index.jsp  invokes an action that will load values into a dropdown box.  It forwards “success”  
RptReq2.jsp is invoked if “success” is returned
Form is displayed and the dropdown list is populated
Once a value is selected from the dropdown, an onchange event will trigger a JAVA script function that will populate the values in another dropdown box (same form is submitted)
There is a button on the form that will trigger another function via an onclick event (same form is submitted)
There is a submit button to create a report based on the values in the form  (same form is submitted)

Everything was working okay as described above.  Now that I have done some cleanup, the form comes up as expected and the first dropdown list is populated.  However, when I make a selection nothing happens.  I put alerts in the functions to see if they were being invoked, but I am not getting alerts now.   I put a sysout in the load action to make sure I was reaching the point where “success” is returned.  I can see it on the console:

SystemOut     O about to return success from LoadAction
[4/1/10 9:42:18:734 EDT] 0000002b ServletWrappe I   SRVE0242I: [StrutsErrQueRptEAR] [/StrutsErrQueRpt] [/RptReq2.jsp]: Initialization successful

Any idea where I should start looking to try to figure out what is going on?
Question by:LianaD
  • 4
  • 2
LVL 23

Accepted Solution

cmalakar earned 1500 total points
ID: 29361238
System.out.println will be executed at the console.

As you are getting the page on the Client(browser), the execution of JSP is successful.

I hope the problem is somewhere in the javascript. mainly onchange event.

Check whether onchange event is getting triggered with javascript alerts.

Let me know.. if you get any progress.


Author Comment

ID: 29361753
I do have alerts and they are not getting triggered.  Any idea what would cause them not to function?  As I mentioned in my first post, I even tried adding a button that would trigger the same function and send an alert.  Nothing was sent.  So, does this seem like a javascript issue to you?
LVL 23

Expert Comment

ID: 29361911
Why dont you post your jsp ?
2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

LVL 23

Expert Comment

ID: 29361974
If you have firefox, check if there are any errors in ErrorConsole, after loading the page. (Clear all the errors, before loading the page)

Author Closing Comment

ID: 31709948
Okay, you made me focus in on the javascript, so i took a look at my functions.  One of the things that I did to "clean up the code" was to add another IF condition.  Unfortunately, my syntax was incorrect.  I'd seen earlier that the functions in the HTML were underlined in red and the message stated that the functions were undefined.  I ignored the message because I could see that they were there and spelled correctly.  Silly me for not investigating further.  It would have been nice to have a message detailing the root cause of the issue.  Any way, my app is working again. Thanks for pointing me in the right direction!!!!
LVL 23

Expert Comment

ID: 29363760
Glad to know.. that you app is back. :)

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month3 days, 11 hours left to enroll

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question