struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Navjot Singh" <>
Subject RE: [OT] What layer does an XSL transform belong to
Date Wed, 04 Jun 2003 04:30:03 GMT
The coupling may not be necessary at all. It's the way you look at it.

_First Approach_

Controller -> Model -> View (jsp)
View has the power of do some computation here. So, it create 1 composition

class T
private String xml;
private String xsl;

and pass T to view layer. Where jsp can run some taglib to do the
** You are NOT coupled at all. **

_Second Approach_

However, the other (and rather complex) way around could be to have
+ MyAction and MyRequestProcessor,
+ override the necessary methods.

In MyAction write some method to handle null ActionForwards and
pass on T's object to some method in MyRequestProcessor that does
the transformation.

** View is definitely coupled to some extent **

I have been using this latter method before i know taglibs
and may still prefer it over JSPs ;-)

Navjot Singh

|-----Original Message-----
|From: Jeff Kyser []
|Sent: Wednesday, June 04, 2003 5:25 AM
|To: Struts Users Mailing List
|Subject: Re: [OT] What layer does an XSL transform belong to
|Hey Dave, Navjot,
|Thanks for the responses - and I agree with your assessments.
|The nagging thing that bugs me is that by doing this (having a
|legacy app return its data in the form of an XML document, and
|then rendering the document directly on the presentation layer),
|is that it would seem that the presentation layer is more tightly
|coupled to the model layer than I would like it to be.
|So maybe the better question is - is this just generally a bad way
|to do things? with the better way being to parse the document into
|a model object behind the scenes, let the controller (Action) transfer
|information as needed into form beans and have the jsp do the
|rendering at that point?
|As I said before, its not a 'from scratch' effort, and I've been
|pushing it in the right direction, but hard to know sometimes
|how far to push...
|On Tuesday, June 3, 2003, at 05:43  PM, David Tobey wrote:
|> I would argue presentation layer. In a more typical Struts
|> application, the
|> content would consist of one or more Java bean objects. The
|> presentation
|> layer, eg JSP pages, then renders those objects.
|> But in your case, the content is in the form of an XML document. The
|> presentation layer is still the one responsible for rendering the
|> content
|> into something, in your case, by using XSL to transform the XML.
|> dave
|>> -----Original Message-----
|>> From: Jeff Kyser []
|>> Sent: Tuesday, June 03, 2003 8:09 AM
|>> To:
|>> Subject: [OT] What layer does an XSL transform belong to
|>> Hey all,
|>> A bit philisophical I suppose, but we've integrated some
|>> legacy apps into a Struts application, and they return their
|>> data as an XML document.
|>> In a previous version of the app, the JSP made the legacy
|>> call (gakk!), and then performed an XSL transform to display
|>> the info to the user. (I didn't write it :)
|>> I'm trying to migrate things towards their proper places, and
|>> my question is where (if anywhere) the XSL transform belongs.
|>> Ideally, I would either call the legacy app from within a
|>> Action, or pushed down yet another  layer behind some
|>> model call.
|>> But if I did a model layer, then I'd probably transfer the data
|>> from the XML document to a Java model object and then
|>> transfer data from the model to a form via the Action and let
|>> the tag libraries take it from there.
|>> I don't have the luxury of a rewrite, so trying to incrementally
|>> migrate and just not sure where the XSL transform should
|>> land (or at least roost).
|>> your insights would be appreciated
|>> regards,
|>> -jeff
|> ---------------------------------------------------------------------
|> To unsubscribe, e-mail:
|> For additional commands, e-mail:
|To unsubscribe, e-mail:
|For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message