aspose file tools*
The moose likes Struts and the fly likes Help Determining Why App is No Longer Working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Help Determining Why App is No Longer Working" Watch "Help Determining Why App is No Longer Working" New topic
Author

Help Determining Why App is No Longer Working

Liana Daughtry
Greenhorn

Joined: Mar 27, 2010
Posts: 13
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. Of course, I didn't bother to create a backup!!! 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 even added a temporary button to see if I could invoke a function, but no alerts where thrown. 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?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Liana Daughtry wrote:I didn't bother to create a backup

Or use a repository?! Horrible, horrible idea. And your IDE doesn't keep any local history?
I wanted to know where to look to try to determine what’s causing the problem.

Turn DEBUG logging on and check the logs.
However, when I make a selection nothing happens.

Oh, this is a *JavaScript* issue?

Use Firebug and see if you're getting JavaScript errors.
Liana Daughtry
Greenhorn

Joined: Mar 27, 2010
Posts: 13
Hi David, you are correct this was a javascript issue. I thought I didn't make any changes to the JSP, but it turns out I did. I took a look at my functions and remembered that I added another IF condition. Unfortunately, my ELSE IF syntax was incorrect. I did see that my functions in the HTML were underlined in red with a message stating that they were undefined. I ignored it because I could see that they were actually there!!! Silly me for not taking a closer look. Thanks for pointing me in the right direction!!! I knew it had to be something trivial, but I just wasn't sure where to look. My App is working again.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Good deal. It was pretty clear it was a JavaScript issue as soon as you said that your JavaScript wasn't working--so that's the logical place to look first.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help Determining Why App is No Longer Working