• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Controlling the display of JSP pages

 
Donald Nunn
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a situation where I need to first display a jsp that allows the user to select records. That works great. However, once the desired row is selected, I need to display the results in the second half of the page. The selection process is a jsp and the result process is a jsp as well. I've tried using a frame, but, I'm having a problem controlling the jsp that produces the results. What's actually happening is both jsp's are displaying at the same time and the jsp that populates the bottom half of the page is producing an error because it's expecting a set of parameters. Any suggestions would be greatly appreciated.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so... what if you wrap the entire bottom half of the page in an if statement that checks for the presence of the parameter?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
He'll end up having to resend the entire page. Frames are better for this - that way only the part of the page that's changed needs to be redone.
Basic idea is that initially you send a frameset that references 2 jsp's - one in each frame. The bottom jsp initially will have a blank output (there are several ways to do this, including just using an empty HTML page). Now in the top frame, the master JSP does hyperlinks with target= options directing the output to the lower frame.
If the top part is a form, frames may not be better, since a form requires its own frame to be refreshed - though you should be able to fake it with enough JavaScript.
 
Donald Nunn
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Jessica. Thanks, for your suggestion, however, I've tried that and it doesn't work. I understand why, however, I haven't developed a solution yet. Again, thanks for your suggestion.
 
Donald Nunn
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Tim. If it's not to much trouble could you illustrate this in an example. I would really appreciate it.
Thanks
 
Donald Nunn
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Tim. This is the way I have it set up and the problem is when I execute the jsp from the top frame that's labeled "LIST_SELECT_JSP" the rsulting JSP won't display the results in the target labeled "RESULT_JSP". I did take your advise and I created a blank HTML which eliminated the error, however, as I mentioned the target isn't working. It's displaying the results in the top frame labeled "LIST_SELECT_JSP". Any advise would be greatly appreciated. Thanks

<HTML>
<HEAD>
<TITLE>Report Selection Interface</TITLE>
</HEAD>
<FRAMESET ROWS="50%, 50%" FRAMEBORDER="YES" BORDER="3">
<FRAME NAME="LIST_SELECT_JSP" SRC="LISTSELECT.jsp" TARGET="RESULT_JSP" SCROLLING="AUTO" >
<FRAME NAME="RESULT_JSP" SRC="LIST_RESULTS.HTML" SCROLLING="AUTO">
</FRAMESET>
<NOFRAMES>
<BODY>
<H2 ALIGN="center">Oops!, This browser doesn't Support Frames, Eh?</H2>
<BLOCKQUOTE>
<P>So you don't like frames. We'll too bad for you!
</BLOCKQUOTE>
<HR>
<DIV ALIGN="right">
<EM>Call Technical Support</EM>
</DIV>
</BODY>
</NOFRAMES>
</HTML>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic