Solved

incorrect jsp display problem

Posted on 2013-11-14
8
438 Views
Last Modified: 2013-12-09
I have a legacy app written using STRUTS 1.3 which uses a set of frames to display content. We have a header, footer, left panel, right panel, and a center frame.

The footer has a Save button (among others). When I press Save the form executes the validate() method which checks that the user entered the fields properly. If a field is incorrect (in this case I force the error by leaving one of the dropdowns blank), an error message is added into the header stating which field is wrong.

Pressing Save works fine up to maybe 8 times out of 10 at best, or might fail 2-3 times in a row and then work.

When it works, all the frames get refreshed and the message is displayed in the header.

When it doesn’t work the entire frameset gets displayed/repeated in the center frame with the inner center frame blank/white.    

The center jsp has <html:form action="/LocEndOfficeInfo.do" method="post"> in it. I have tried adding target=”center” or target=”_top” to it but doesn’t make any difference. It just randomly works or doesn’t work. Almost feels like a timing issue with the browser as it renders the frames. I’m using IE8 (only browser this app officially supports) but I also tried Firefox (latest version) and both have the problem.

Also tried calling a javascript function (from the center frame) to reload itself but it then reloads repeatedly without any user input.

Strange thing is that this app has two other center pages which are extremely similar (uses the same header, footer, etc) but never have a problem.

Any ideas on what else I can try?
0
Comment
Question by:Gandharva_Guy
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 39651155
Two things:

a) First see if there is something in the logs
b) Turn on javascript debugging and see if it fails at some point.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39651476
Framesets are a 2oth century technology that has basically disappeared in modern development; and even back in the days if IE8 it was already considered a deadend methodology.  If you post a link to the page we might be able to see what is wrong. If all you ever have to support is IE8, then leaving the legacy code is probably okay, but if you ever have to support modern browsers you may run into multiple issues with it.

Cd&
0
 
LVL 26

Expert Comment

by:mrcoffee365
ID: 39651792
Framesets are still very widely used.  They have not disappeared in modern development at all.   They are a part of the HTML standard, and will continue to be, since they solve a problem.

Gandharva_Guy:  it sounds as if there's a problem in your html and possibly your javascript.  If you're seeing a problem with behavior in IE8, you are likely to see even more problems with Chrome.

Without the code, we can't debug the issue.  You can post the code, as other experts have asked, or post the page somewhere where we can see it.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39652469
Framesets are still very widely used.

I don't know where you come up with that.  Your source of stats would be interesting.

Current usage is 1.8%. I get my stats from:
http://w3techs.com/technologies/overview/site_element/all

Modern sites do not use frames, though iframes are relatively common primarily for offsite content like video and connections to social networking APIs.

As for support, frameset is not part of the HTML5 standard, having been dropped along with other obsolete attributes like font.  The browsers still recognize the obsolete bits for backward compatibility, but the manufacturers can drop support anytime they want and still be standards compliant.

Cd&
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Gandharva_Guy
ID: 39663807
Logs show nothing unfortunately.
I did use Fiddler (a debugging tool) and it clearly shows that 10 jsps are returned when it fails, and 6 when it works. So now I'm not really sure if the problem lies with the jsp below or something else since it works intermittently.

Here's a snip of the jsp which comes up blank. Note that I removed the content (which is some tables, dropdowns etc) for simplicity.

<%@ page language="java" extends="ca.ncams.wisor.filter.FilterJspBase" 
    import="ca.ncams.wisor.presentation.IPresentation"%>
<%@ page import="ca.ncams.wisor.presentation.tables.LocEndOfficeInfoForm" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>

<html:html >
<head>
<html:base/>
<link rel=stylesheet type="text/css" href="../contentstyles.css" title="Content Style">
<jsp:include page="/javascript/mainSubmit.js" flush="true" />
<jsp:include page="/javascript/auto.js" />
</head>

<body bgcolor="#F5F5DC">
<html:form action="/LocEndOfficeInfo.do" method="post"> 
<html:hidden property="action"/>

<!-- content removed for simplicity -->

</html:form>
</body>
</html:html>

Open in new window

0
 
LVL 26

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 500 total points
ID: 39664523
Weird -- do you have 10 or 6 frames?  I don't see why you would get 10 or 6 files returned from the server.

Using fiddler to watch the actual files returned is an excellent start.

However, if you don't have enough logging to determine the problem on the server, I don't think we can help you until you have more information to work with.

We can recommend tools.  Fiddler is a good start.  You should also look at your code to see why 10 .jsp files are returned, and why 6 is ... better? worse?  Are you using individual .jsp files as the returned html for each frame in an html page?

So many things can cause different files returned to a browser.  A short list:
* different browser
* diff user OS
* diff user login
* different browser settings
* different parameters in the query to the server
* different requests to the server
* different states in the server in the responses
* badly written code on the server which ... does not close db connections, is not threadsafe, relies on shared data when it shouldn't and the data isn't shared, ... the list here is endless
* poorly understood server configuration.  If you are load-balancing among several web servers, one (or more) of them could be wronly configured, and returning the unexpected files

The best bet was for you to look in your webapp logs and determine what was different in the 2 cases.  You should add logging to your app so that you can start tracking down the problem.  It's harder to do by code inspection.

If you cannot debug the code on the server, you can go the longer way and get more info from the client side.  Using something like a network monitor -- Windows has one, or you can install an open source one like Ethereal or Wireshark -- will show you a lot of detail about the behavior the client sees in requests to the server and responses from the server.

In any case, you'll need to continue to do a lot more investigation and post what you've found here to get further.

Ignore the "nobody uses framesets" discussion -- it's completely irrelevant to your question.
0
 

Accepted Solution

by:
Gandharva_Guy earned 0 total points
ID: 39696974
Ok, update. Turns out it was a code issue on the server side that was telling STRUTS to go to the wrong jsp (even though it looked correct). We compared with an older version of the java class that caused the problem and were able to come up with a fix that solves it for the majority of cases...there's still one or two other unusual/uncommon cases that have the problem but I gather it's the same type of issue. If push comes to shove we'll probably try upgrading from STRUTS 1.3 to the latest release (which would require some architecture changes) but I think we'll be able to live with it as it is now.

Thanks all for your input!  

ps. I do hope to upgrade this app to use a much more modern framework to get rid of framesets someday! GWT is looking pretty good to me.
0
 

Author Closing Comment

by:Gandharva_Guy
ID: 39705722
Found my own solution but all the feedback was still useful.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now