Solved

mvc architecture -- using framesets in a view

Posted on 2003-10-29
7
1,001 Views
Last Modified: 2013-11-19
I know often that the mvc architecture is used in java web programming so that's why I'm submitting my question here. Specifically specifically my question regards using a frameset in a view. I've written my own mvc framework and am quite satisfied with how it functions. I did this for the challenge and to gain some experience. However I've run into a bump with using framesets in a view.

Basically for every http request, the controller is instantiated and the request is processed. This determines the view I will end up with. If I have dynamic data that a view requires, the http request contains info that the controller needs to instanitate the appropriate action object and get the data.

The problem is, within a view that has framesets, there are several sets of url's -- serveral calls to the controller. As is obvious, the process of sending an http request to the controller is started by clicking a link, submitting a form, or entering a url into the url box of the browser. So the question(s) is/are:

How do I get the appropriate url's to the various src attributes of frame tags? It seems I either have to hard code part or all of the url in the src attribute.

Can I avoid littering my outer url with loads of parameters to dynamically generate the src attributes?

Should this be put somewhere else like in the application mapping?

Has anyone done anything in this aspect with struts or anything similar and can shed light on me? I've been googling and not finding anything.

Thanks
0
Comment
Question by:dave_mwi
  • 3
7 Comments
 
LVL 14

Expert Comment

by:kennethxu
ID: 9643921
look into tiles which come with struts 1.1 release. it is used to replace the frameset in mvc environment.

http://jakarta.apache.org/struts/userGuide/dev_tiles.html
0
 

Author Comment

by:dave_mwi
ID: 9644411
Did the tiles really replace frames? Or can you have a framesets which contain their own tiling layouts? I realize you could use tiles and get the same layout as a frameset, but I guess I'm not really looking for tiles as a solution. If it indeed was a replacement for frames, was it because frames were difficult to manage...or was it just a decision to move in that direction to increase modularity and reusablility....?
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 125 total points
ID: 9644927
>> Did the tiles really replace frames?
NO, its a different approach of doing similar thing.

>> it because frames were difficult to manage...or was it just a decision to move in that direction to increase modularity and reusablility....?
I think both.

There is nothing wrong of framesets, and you can still use it when you are using struts just like any other existing web technology. but as you have noticed, there is nothing been built in struts for framesets. so it could be cumbersome when you need to change the frame content from one to the other and you'll have handle framesets out of MVC framework. frame could also introduce other problems, for example, when session timeout, the login page will appear in one of he frame instead of the full window.

This is what I would do:
let's say we have 2 section, A and B

I would still use frameset when B is mostly driven by A, that means content in A frame is fairly static. content B is the main frame that used to disply changing content including the changes trigger from A frame.

I would use tile if A and B are interdependent, that means user action in section A could lead content change in section B and vice versa.
0
 
LVL 15

Assisted Solution

by:dualsoul
dualsoul earned 125 total points
ID: 9649496
>Can I avoid littering my outer url with loads of parameters to dynamically generate the src attributes?

hm...why no to use custom tag for it?
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9650728
yes, if you can elaborate the detail reqirement, we might find you a solution to your problem out of struts. for example, JSTL
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

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

17 Experts available now in Live!

Get 1:1 Help Now