struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Mistroni" <>
Subject RE: Strus Web Service Enablement
Date Thu, 03 Jun 2004 14:56:26 GMT
Hello again,

>Exactly! Actually...not sure about the template, but when u go via
>WS (webservices) all the client is interested is in getting back XML...
>The XML generated by you action class as a response...

>That's the thing I want to avoid though... I don't want the Actions to
>altered at all (and the ActionForms either if I can help it).
>the idea is to do all the Web Service stuff externally to those

Yeah... :-) I was meaning some XML as a response.

>That's what the current template JSP does... It just uses reflection to
>a list of all members of the ActionForm, without knowing the specific
>of the ActionForm, and then iterates over the members, calilng the 

just do u pick the ActionForm from request? Each ActionForm
has potentially a different name....   is it a struts trick?

>appropriate getter for each, and constructing a simple XML response.
>the RequestProcessor already set the response type to XML, the JSP is
>responsible for constructing the proper SOAP-based response, nothing

Two things about that though are problematic...

>(1) It's just dumping all the members of the class, there's currently
no >way 
>to select which members to incluide, or what order, or any notion of 
>structure beyond a flat list

well, as long as they are in an XML I don't see any problems... it
be enough that the element is in the XML, not necessarily element1
elemen2...  coz when the XML arrives to the client, the client will look
for certain elements, without caring on the order.

(2) While this simple template might be OK for many situations, it
allow for any flexibility in the returned XML.

That's where my idea of an added config file comes in... I picture it
loaded into memory via a plug-in, just like Struts-Config.xml is.  It
probably, off the top of my head, have a structure something like this:


  <service-mapping path="xxxx" target="yyyy" members="zzzz" />


... where:

xxxx - matches exactly the path attribute of the <action> from 
Struts-Config.xml being exposed
yyyy - is the path to the JSP to generate the XML output.  This would be

optional.  If it's NOT present, be default the "webServiceResponse.jsp" 
template is used, which is what is there now, which just dumps all
of the ActionForm.  You can also specify a special value of "simple",
would use a new "simpleServiceResponse.jsp" template.  This would make
of the members element...
zzzz - is a comma-separated list of members to display using the
template.  Basically the same thing as the default template except that
can specify which elements to return and in what order.

Any other target would be a JSP designed for a specific Action, so you
do whatever you wanted there, as long as you generate a valid SOAP-based
response.  This is where a new taglib would probably be useful, to help 
ensure proper structure and whatnot.

Further, if no entry is found for a given Action mapping, or there never
this config file, then it would just proceed as it currently does, using
existing "dump everything" template.  That leaves all of this optional, 
which I think is a good thing (tm).

Then this looks the way :-) ..hopefully during the night u will find
Responses on this from Struts committers...

>Aspect Oriented Programming ...give it a check... u can add dynamic

>Ok, sure, I've heard of it, just didn't recognize the acronym :)  I'm
>sure how it would fit in here though, my admittedly limited
understanding >is 
>that AOP is more or less a technique for architecting a system (i.e.,
>things as Aspects instead of Objects, along those lines).

As I said, it was just a wild idea... if u can invoke aspects (to log
At certain point in a class/method, u could  reuse same technique before
Exiting the execute() method of an action... redirecting to the proper
page.. thought my brain stops here... I m talking from examples that I
have seen, I haven\t had the time 2 practice ...


Watch the online reality show Mixed Messages with a friend and enter to
a trip to NY

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

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

View raw message