?
Solved

incorrect jsp display problem

Posted on 2013-11-14
8
Medium Priority
?
456 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 27

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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 
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
 

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 27

Assisted Solution

by:mrcoffee365
mrcoffee365 earned 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

765 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