dcsimg
I would like to know how to pass a servlet as a src in a html frame?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adam_Lotrowski
Posted On:   Wednesday, October 24, 2001 03:32 PM

I am trying to display a checkout page from a shopping cart servlet. The checkout page is to be in frameset, consiting of two frames. The top part will display all products ordered. the information is stored in a HttpSession as hashtable. The bottom frame will be for customer input, pure html. i would like the source for the top frame to be passed to a servlet to display the page in the top frame, rather than a the traditional html page. I have set up a dumby html page that onLoad calls the following JavaScript function: function go(loc) { (window.)location.href = loc; } I have tried with and without window.    More>>

I am trying to display a checkout page from a shopping cart servlet.


The checkout page is to be in frameset, consiting of two frames. The top part will display all products ordered. the information is stored in a HttpSession as hashtable.


The bottom frame will be for customer input, pure html.


i would like the source for the top frame to be passed to a servlet to display the page in the top frame, rather than a the traditional html page.


I have set up a dumby html page that onLoad calls the following JavaScript function:

			
function go(loc)
{
(window.)location.href = loc;
}


I have tried with and without window.


here is my onLoad statement:


			BODY onload="go('http://localhost:8080/servlet/ProductsOrdered\');">
			
/BODY


With your suggestion befor submitting this question I tried your suggested solution for this question:

How do I open and redirect to a popup window from a servlet? (Under certain circumstances I want my servlet to bust out of the frames and redirect to another servlet or page.)


I switched open for location which gave me the new page in the frame, but failed to connect to the servlet, but it seems like it tried.


Do you have any suggestions. I have all the following code necessary for this to work and I am only a beginner programmer.

Thank you.

Adam

   <<Less

How about putting the servlet url in the frameset doc?

Posted By:   Roger_Hand  
Posted On:   Wednesday, October 24, 2001 05:12 PM

In the frameset doc that defines the top and bottom frame, make the src of the top frame the servlet url:




This will open that page in the top frame when the page is first opened. If it needs to change after something in the bottom frame is filled out and submitted, then in the tag you can set the action to be your servlet, and set the target to be either "_top" (which will refresh the entire frameset) or "top_cart", which will refresh only the top frame.


Hope this helps . . . I'm not 100% clear on what you're trying to achieve.

About | Sitemap | Contact