Trouble using frames
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   java_rine
Posted On:   Thursday, January 17, 2002 10:46 AM

I have 3 JSPs...namely view.jsp, details.jsp and tree.jsp. I included tree.jsp in details.jsp (i.e in details.jsp i wrote this : ----------------------------------- <%jsp:include page="ArticleTree.jsp" flush="true"> <%= at.topicId %>' /> ---------------------------------------- The view.jsp would be something like the page we see when we first enter the Java forum in codeguru. When the user clicks on one of the hyperlinks he is directed to details.jsp and gets to see the details of the topic as well as the hierarchical structure of the articles under that topic ( the display of this structure is handled by tree.jsp which was included at the bottom of the view.jsp ).   More>>

I have 3 JSPs...namely view.jsp, details.jsp and tree.jsp. I included tree.jsp in details.jsp (i.e in details.jsp i wrote this :

-----------------------------------
<%jsp:include page="ArticleTree.jsp" flush="true">
<%= at.topicId %>' />

----------------------------------------

The view.jsp would be something like the page we see when we first enter the Java forum in codeguru. When the user clicks on one of the hyperlinks he is directed to details.jsp and gets to see the details of the topic as well as the hierarchical structure of the articles under that topic ( the display of this structure is handled by tree.jsp which was included at the bottom of the view.jsp ). This UI works pretty much the way like in codeguru forums. And to see the details and tree structure, i need to pass a variable say x to details.jsp and a variable y to tree.jsp.

Now, because i'd like to add in the functionality of expanding and collapsing the tree structure, and this action should only take effect in tree.jsp, i decided i should put details.jsp and tree.jsp into a framed page, probably named frame.jsp. So now frame.jsp has 2 frames containing details.jsp and tree.jsp. And the user will get directed to frames.jsp ( instead of details.jsp previously ) when he clicks on the hyperlinks on view.jsp.

Here is the PROBLEM : the variables x and y that i have to pass to details.jsp and tree.jsp cannot get through to them in time when frame.jsp loads up and as a result error occurs. How can i solve this problem so that details.jsp and tree.jsp can receive the parameters x and y and display onto frames.jsp when it loads?

   <<Less

Re: Trouble using frames

Posted By:   Erik_Runia  
Posted On:   Friday, January 18, 2002 12:02 PM

If I understand the question you want to click a link, send a variable and have the result page end up in a framed window?


If that is correct then simply build your link with the http://www.mydomain.com/myServlet?page=detail&x=blah for example and encode a target="frameName" within your hyperlink.


That will post to your servlet, in which you can process the x=blah, forward the user to the detail page and it will be pushed into the frame named in your target.


Hopefully that helps

About | Sitemap | Contact