PDA

View Full Version : Setting command class for Master/Detail form


anieshuk
Aug 26th, 2005, 06:11 AM
Hai users,

Can anyone say me how to set command class for the master/detail form
where the master/detail form are in the same jsp page.


Thanks
anieshuk

Colin Yates
Aug 26th, 2005, 07:10 AM
Are you displaying both the "master" and the "detail" at the same time?

If you are, then it depends on how you objects are structured. If your "master" class has a "getDetail()" method, then in your jsp you can just reference "master.detail".

If they are two disconnected objects then you could have a command class which has a "getMaster" and a "getDetail".

If instead you are having a single controller where you pick a master and then display the detail, you would be better off (in my opinion) of having two seperate controllers/jsps to do this ;)

anieshuk
Aug 27th, 2005, 12:39 AM
Hai yatesco

Yes i am handling the detail in the same jsp page and there are seperate commandclass for the master and the detail.Can i make use of these two command class in the same jsp with one controller.


Thanks
anieshuk

Colin Yates
Aug 27th, 2005, 10:48 AM
Well you can, but it isn't recommended. I would suggest keeping one url to do one thing., i.e. one controller and one jsp.

HTH.

Col