You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by einundswanzig <ei...@yahoo.com.hk> on 2007/01/24 03:32:55 UTC

Struts service facade

Im new in Struts, in fact im pretty new in Java, but i have programmed for
Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server with
Struts on it using Flex. Flex is able to call a java component on the server
and execute a method and then serialize the result and deserialize it in an
Actionscript(scripting language of flex) object. In my imaginary app Flex
will provide the View, so im trying to find a way to enable Struts to serve
just a result without a JSP or HTML page, i just want the result. Oh god
this is confusing....
-- 
View this message in context: http://www.nabble.com/Struts-service-facade-tf3078810.html#a8553935
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts service facade

Posted by Martin Cooper <ma...@apache.org>.
On 1/24/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>
> Well, you can use the plugin to "send the data back", using a "json"
> result, instead of writing to the OutputStream directly, like Joe
> mentioned.


Oh, *that* plugin. Sorry. I thought you were talking about the contents of
the link you had just posted, rather than the S2 plugin. I also assumed the
original poster was talking about S1 rather than S2, but it could have been
either. The class I mentioned will work for S1.

--
Martin Cooper

The plugin has a helper class to write to an stream, or build
> an string from an object also. I recently added an interceptor, to
> populate an action from a request containing a JSON string.
>
> regards
> musachy
>
>
> Martin Cooper wrote:
> > On 1/23/07, Musachy Barroso <mb...@wfscorp.com> wrote:
> >>
> >> I have never used Flex, but it seems like it plays nicely with JSON:
> >
> >
> > It does, and you don't need a plugin. If you just want to get data
> > back from
> > the server, you can send JSON and use ActionScript's 'eval' function
> > to turn
> > that into a data structure, just like you would in JavaScript.
> >
> > For rendering beans or other Java object into JSON, you might want to
> > take a
> > look at some code that Don wrote that's sitting in the Struts sandbox.
> > See:
> >
> >
> https://svn.apache.org/repos/asf/struts/sandbox/trunk/flow/src/java/org/apache/struts/flow/json/JSONSerializer.java
> >
> >
> > I wrote a more generalised and extensible JSON renderer at my day job,
> > but
> > I'd need to get permission before I could post that.
> >
> > --
> > Martin Cooper
> >
> >
> > http://weblogs.macromedia.com/mesh/archives/2006/03/one_of_the_litt.html
> >>
> >> You can use the JSON plugin to serialize your actions into JSON. If you
> >> post this question on the user list, you'll probably get more answers
> >>
> >> regards
> >> musachy
> >>
> >> Joe Germuska wrote:
> >> > What do you mean by "just the result?"  If your Flex app is calling
> >> > Struts,
> >> > then it needs some kind of data back.  Are you saying that you want
> >> the
> >> > result to be ActionScript, kind of like a JSON result?  Or XML?
> >> >
> >> > In the general case, if a Struts action writes data to the Servlet
> >> > response,
> >> > then it should return null.  But often, an easier way to do something
> >> > like a
> >> > simple XML or JSON result is to use a JSP with a content type other
> >> than
> >> > text/html.  Automatic serialization of a POJO to JSON or XML is
> >> probably
> >> > more elegant, but for a quick solution, you can render that stuff in
> a
> >> > JSP
> >> > -- in any case, better than writing directly to the output stream,
> >> > which I'd
> >> > generally only want to do with downloads or other binary data.
> >> >
> >> > I don't know if this helps at all...
> >> >
> >> > Joe
> >> >
> >> >
> >> > On 1/23/07, einundswanzig <ei...@yahoo.com.hk> wrote:
> >> >>
> >> >>
> >> >> Im new in Struts, in fact im pretty new in Java, but i have
> >> >> programmed for
> >> >> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server
> >> with
> >> >> Struts on it using Flex. Flex is able to call a java component on
> the
> >> >> server
> >> >> and execute a method and then serialize the result and deserialize
> it
> >> in
> >> >> an
> >> >> Actionscript(scripting language of flex) object. In my imaginary app
> >> >> Flex
> >> >> will provide the View, so im trying to find a way to enable Struts
> to
> >> >> serve
> >> >> just a result without a JSP or HTML page, i just want the result. Oh
> >> god
> >> >> this is confusing....
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Struts-service-facade-tf3078810.html#a8553935
> >> >> Sent from the Struts - Dev mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: dev-help@struts.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: dev-help@struts.apache.org
> >>
> >>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts service facade

Posted by Musachy Barroso <mb...@wfscorp.com>.
Well, you can use the plugin to "send the data back", using a "json" 
result, instead of writing to the OutputStream directly, like Joe 
mentioned. The plugin has a helper class to write to an stream, or build 
an string from an object also. I recently added an interceptor, to 
populate an action from a request containing a JSON string.

regards
musachy


Martin Cooper wrote:
> On 1/23/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>>
>> I have never used Flex, but it seems like it plays nicely with JSON:
>
>
> It does, and you don't need a plugin. If you just want to get data 
> back from
> the server, you can send JSON and use ActionScript's 'eval' function 
> to turn
> that into a data structure, just like you would in JavaScript.
>
> For rendering beans or other Java object into JSON, you might want to 
> take a
> look at some code that Don wrote that's sitting in the Struts sandbox. 
> See:
>
> https://svn.apache.org/repos/asf/struts/sandbox/trunk/flow/src/java/org/apache/struts/flow/json/JSONSerializer.java 
>
>
> I wrote a more generalised and extensible JSON renderer at my day job, 
> but
> I'd need to get permission before I could post that.
>
> -- 
> Martin Cooper
>
>
> http://weblogs.macromedia.com/mesh/archives/2006/03/one_of_the_litt.html
>>
>> You can use the JSON plugin to serialize your actions into JSON. If you
>> post this question on the user list, you'll probably get more answers
>>
>> regards
>> musachy
>>
>> Joe Germuska wrote:
>> > What do you mean by "just the result?"  If your Flex app is calling
>> > Struts,
>> > then it needs some kind of data back.  Are you saying that you want 
>> the
>> > result to be ActionScript, kind of like a JSON result?  Or XML?
>> >
>> > In the general case, if a Struts action writes data to the Servlet
>> > response,
>> > then it should return null.  But often, an easier way to do something
>> > like a
>> > simple XML or JSON result is to use a JSP with a content type other 
>> than
>> > text/html.  Automatic serialization of a POJO to JSON or XML is 
>> probably
>> > more elegant, but for a quick solution, you can render that stuff in a
>> > JSP
>> > -- in any case, better than writing directly to the output stream,
>> > which I'd
>> > generally only want to do with downloads or other binary data.
>> >
>> > I don't know if this helps at all...
>> >
>> > Joe
>> >
>> >
>> > On 1/23/07, einundswanzig <ei...@yahoo.com.hk> wrote:
>> >>
>> >>
>> >> Im new in Struts, in fact im pretty new in Java, but i have
>> >> programmed for
>> >> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server 
>> with
>> >> Struts on it using Flex. Flex is able to call a java component on the
>> >> server
>> >> and execute a method and then serialize the result and deserialize it
>> in
>> >> an
>> >> Actionscript(scripting language of flex) object. In my imaginary app
>> >> Flex
>> >> will provide the View, so im trying to find a way to enable Struts to
>> >> serve
>> >> just a result without a JSP or HTML page, i just want the result. Oh
>> god
>> >> this is confusing....
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Struts-service-facade-tf3078810.html#a8553935
>> >> Sent from the Struts - Dev mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: dev-help@struts.apache.org
>> >>
>> >>
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts service facade

Posted by Martin Cooper <ma...@apache.org>.
On 1/23/07, Musachy Barroso <mb...@wfscorp.com> wrote:
>
> I have never used Flex, but it seems like it plays nicely with JSON:


It does, and you don't need a plugin. If you just want to get data back from
the server, you can send JSON and use ActionScript's 'eval' function to turn
that into a data structure, just like you would in JavaScript.

For rendering beans or other Java object into JSON, you might want to take a
look at some code that Don wrote that's sitting in the Struts sandbox. See:

https://svn.apache.org/repos/asf/struts/sandbox/trunk/flow/src/java/org/apache/struts/flow/json/JSONSerializer.java

I wrote a more generalised and extensible JSON renderer at my day job, but
I'd need to get permission before I could post that.

--
Martin Cooper


http://weblogs.macromedia.com/mesh/archives/2006/03/one_of_the_litt.html
>
> You can use the JSON plugin to serialize your actions into JSON. If you
> post this question on the user list, you'll probably get more answers
>
> regards
> musachy
>
> Joe Germuska wrote:
> > What do you mean by "just the result?"  If your Flex app is calling
> > Struts,
> > then it needs some kind of data back.  Are you saying that you want the
> > result to be ActionScript, kind of like a JSON result?  Or XML?
> >
> > In the general case, if a Struts action writes data to the Servlet
> > response,
> > then it should return null.  But often, an easier way to do something
> > like a
> > simple XML or JSON result is to use a JSP with a content type other than
> > text/html.  Automatic serialization of a POJO to JSON or XML is probably
> > more elegant, but for a quick solution, you can render that stuff in a
> > JSP
> > -- in any case, better than writing directly to the output stream,
> > which I'd
> > generally only want to do with downloads or other binary data.
> >
> > I don't know if this helps at all...
> >
> > Joe
> >
> >
> > On 1/23/07, einundswanzig <ei...@yahoo.com.hk> wrote:
> >>
> >>
> >> Im new in Struts, in fact im pretty new in Java, but i have
> >> programmed for
> >> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server with
> >> Struts on it using Flex. Flex is able to call a java component on the
> >> server
> >> and execute a method and then serialize the result and deserialize it
> in
> >> an
> >> Actionscript(scripting language of flex) object. In my imaginary app
> >> Flex
> >> will provide the View, so im trying to find a way to enable Struts to
> >> serve
> >> just a result without a JSP or HTML page, i just want the result. Oh
> god
> >> this is confusing....
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Struts-service-facade-tf3078810.html#a8553935
> >> Sent from the Struts - Dev mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: dev-help@struts.apache.org
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts service facade

Posted by Musachy Barroso <mb...@wfscorp.com>.
I have never used Flex, but it seems like it plays nicely with JSON:

http://weblogs.macromedia.com/mesh/archives/2006/03/one_of_the_litt.html

You can use the JSON plugin to serialize your actions into JSON. If you 
post this question on the user list, you'll probably get more answers

regards
musachy

Joe Germuska wrote:
> What do you mean by "just the result?"  If your Flex app is calling 
> Struts,
> then it needs some kind of data back.  Are you saying that you want the
> result to be ActionScript, kind of like a JSON result?  Or XML?
>
> In the general case, if a Struts action writes data to the Servlet 
> response,
> then it should return null.  But often, an easier way to do something 
> like a
> simple XML or JSON result is to use a JSP with a content type other than
> text/html.  Automatic serialization of a POJO to JSON or XML is probably
> more elegant, but for a quick solution, you can render that stuff in a 
> JSP
> -- in any case, better than writing directly to the output stream, 
> which I'd
> generally only want to do with downloads or other binary data.
>
> I don't know if this helps at all...
>
> Joe
>
>
> On 1/23/07, einundswanzig <ei...@yahoo.com.hk> wrote:
>>
>>
>> Im new in Struts, in fact im pretty new in Java, but i have 
>> programmed for
>> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server with
>> Struts on it using Flex. Flex is able to call a java component on the
>> server
>> and execute a method and then serialize the result and deserialize it in
>> an
>> Actionscript(scripting language of flex) object. In my imaginary app 
>> Flex
>> will provide the View, so im trying to find a way to enable Struts to
>> serve
>> just a result without a JSP or HTML page, i just want the result. Oh god
>> this is confusing....
>> -- 
>> View this message in context:
>> http://www.nabble.com/Struts-service-facade-tf3078810.html#a8553935
>> Sent from the Struts - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts service facade

Posted by Joe Germuska <jo...@germuska.com>.
What do you mean by "just the result?"  If your Flex app is calling Struts,
then it needs some kind of data back.  Are you saying that you want the
result to be ActionScript, kind of like a JSON result?  Or XML?

In the general case, if a Struts action writes data to the Servlet response,
then it should return null.  But often, an easier way to do something like a
simple XML or JSON result is to use a JSP with a content type other than
text/html.  Automatic serialization of a POJO to JSON or XML is probably
more elegant, but for a quick solution, you can render that stuff in a JSP
-- in any case, better than writing directly to the output stream, which I'd
generally only want to do with downloads or other binary data.

I don't know if this helps at all...

Joe


On 1/23/07, einundswanzig <ei...@yahoo.com.hk> wrote:
>
>
> Im new in Struts, in fact im pretty new in Java, but i have programmed for
> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server with
> Struts on it using Flex. Flex is able to call a java component on the
> server
> and execute a method and then serialize the result and deserialize it in
> an
> Actionscript(scripting language of flex) object. In my imaginary app Flex
> will provide the View, so im trying to find a way to enable Struts to
> serve
> just a result without a JSP or HTML page, i just want the result. Oh god
> this is confusing....
> --
> View this message in context:
> http://www.nabble.com/Struts-service-facade-tf3078810.html#a8553935
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>


-- 
Joe Germuska
Joe@Germuska.com * http://blog.germuska.com

"The truth is that we learned from João forever to be out of tune."
-- Caetano Veloso

Re: Struts service facade

Posted by einundswanzig <ei...@yahoo.com.hk>.
Well in that article in the 
http://www.adobe.com/devnet/flex/articles/struts_05.html page number 5  the
author says that we could create some kind of service facade to solve the
problem, my question is how can i do that in Struts?



Eric Rank-2 wrote:
> 
> Hi,
> 
> First, this is probably not a question for the dev list, but rather  
> for the user list (http://struts.apache.org/mail.html#subscribing)
> 
> I haven't done much with Flex, but I'm familiar enough with the  
> technology to hopefully shed some light on your situation. Struts is  
> designed to serve HTTP requests. I don't think Flex is designed out  
> of the box to use HTTP to transfer the serialized objects you need.  
> Basically, Struts, and the servlet container that it runs in, just  
> sends HTTP responses. By default, Flex uses a different protocol.
> 
> As such, you probably want to check out the Flex HTTPService, which  
> looks like it is designed to make use of HTTP responses, which a  
> Struts app will serve, within Flex.
> 
> Check out this article:
> 
> http://www.adobe.com/devnet/flex/articles/struts.html
> 
> Eric Rank
> 
> 
> 
> On Jan 24, 2007, at 9:00 AM, einundswanzig wrote:
> 
>>
>>
>>
>> einundswanzig wrote:
>>>
>>> Im new in Struts, in fact im pretty new in Java, but i have  
>>> programmed for
>>> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server  
>>> with
>>> Struts on it using Flex. Flex is able to call a java component on the
>>> server and execute a method and then serialize the result and  
>>> deserialize
>>> it in an Actionscript(scripting language of flex) object. In my  
>>> imaginary
>>> app Flex will provide the View, so im trying to find a way to enable
>>> Struts to serve just a result without a JSP or HTML page, i just  
>>> want the
>>> result. Oh god this is confusing....
>>>
>>
>> Sorry, may be i am unable to explain what i want to do, so i will  
>> enter in
>> some details. What i understand is that when a request to a Struts- 
>> enabled
>> app, the request is passed to the controller, the controller then  
>> create
>> some kind of object based on the request and then send that to the  
>> "handler"
>> then the handler do whatever it should and then send a result
>> (forwardsomehing is called) back to the controller which at the end  
>> render a
>> page. What i want to do its avoiding the controller render that  
>> page, and
>> just sent back "the result", for example an object, a bean to be  
>> consumed by
>> flex...Just like if you were calling a function, since Flex is able to
>> serialize java objects and deserialize them into actionscript  
>> objects. I
>> mean, im trying to enable Struts to serve to different clients, for  
>> example
>> Flex or an applet...
>> -- 
>> View this message in context: http://www.nabble.com/Struts-service- 
>> facade-tf3078810.html#a8563271
>> Sent from the Struts - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Struts-service-facade-tf3078810.html#a8565432
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts service facade

Posted by Martin Cooper <ma...@apache.org>.
On 1/24/07, Eric Rank <er...@lo-fi.net> wrote:
>
> Hi,
>
> First, this is probably not a question for the dev list, but rather
> for the user list (http://struts.apache.org/mail.html#subscribing)
>
> I haven't done much with Flex, but I'm familiar enough with the
> technology to hopefully shed some light on your situation. Struts is
> designed to serve HTTP requests. I don't think Flex is designed out
> of the box to use HTTP to transfer the serialized objects you need.
> Basically, Struts, and the servlet container that it runs in, just
> sends HTTP responses. By default, Flex uses a different protocol.


Well, sort of. If you just ignore all the fancy bits of Flex, you can use
the loadXML API to make a request to a servlet and send back JSON wrapped in
minimal XML. Then 'eval' the JSON, and you have your response in an
ActionScript data structure.

--
Martin Cooper


As such, you probably want to check out the Flex HTTPService, which
> looks like it is designed to make use of HTTP responses, which a
> Struts app will serve, within Flex.
>
> Check out this article:
>
> http://www.adobe.com/devnet/flex/articles/struts.html
>
> Eric Rank
>
>
>
> On Jan 24, 2007, at 9:00 AM, einundswanzig wrote:
>
> >
> >
> >
> > einundswanzig wrote:
> >>
> >> Im new in Struts, in fact im pretty new in Java, but i have
> >> programmed for
> >> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server
> >> with
> >> Struts on it using Flex. Flex is able to call a java component on the
> >> server and execute a method and then serialize the result and
> >> deserialize
> >> it in an Actionscript(scripting language of flex) object. In my
> >> imaginary
> >> app Flex will provide the View, so im trying to find a way to enable
> >> Struts to serve just a result without a JSP or HTML page, i just
> >> want the
> >> result. Oh god this is confusing....
> >>
> >
> > Sorry, may be i am unable to explain what i want to do, so i will
> > enter in
> > some details. What i understand is that when a request to a Struts-
> > enabled
> > app, the request is passed to the controller, the controller then
> > create
> > some kind of object based on the request and then send that to the
> > "handler"
> > then the handler do whatever it should and then send a result
> > (forwardsomehing is called) back to the controller which at the end
> > render a
> > page. What i want to do its avoiding the controller render that
> > page, and
> > just sent back "the result", for example an object, a bean to be
> > consumed by
> > flex...Just like if you were calling a function, since Flex is able to
> > serialize java objects and deserialize them into actionscript
> > objects. I
> > mean, im trying to enable Struts to serve to different clients, for
> > example
> > Flex or an applet...
> > --
> > View this message in context: http://www.nabble.com/Struts-service-
> > facade-tf3078810.html#a8563271
> > Sent from the Struts - Dev mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> > For additional commands, e-mail: dev-help@struts.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts service facade

Posted by Eric Rank <er...@lo-fi.net>.
Hi,

First, this is probably not a question for the dev list, but rather  
for the user list (http://struts.apache.org/mail.html#subscribing)

I haven't done much with Flex, but I'm familiar enough with the  
technology to hopefully shed some light on your situation. Struts is  
designed to serve HTTP requests. I don't think Flex is designed out  
of the box to use HTTP to transfer the serialized objects you need.  
Basically, Struts, and the servlet container that it runs in, just  
sends HTTP responses. By default, Flex uses a different protocol.

As such, you probably want to check out the Flex HTTPService, which  
looks like it is designed to make use of HTTP responses, which a  
Struts app will serve, within Flex.

Check out this article:

http://www.adobe.com/devnet/flex/articles/struts.html

Eric Rank



On Jan 24, 2007, at 9:00 AM, einundswanzig wrote:

>
>
>
> einundswanzig wrote:
>>
>> Im new in Struts, in fact im pretty new in Java, but i have  
>> programmed for
>> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server  
>> with
>> Struts on it using Flex. Flex is able to call a java component on the
>> server and execute a method and then serialize the result and  
>> deserialize
>> it in an Actionscript(scripting language of flex) object. In my  
>> imaginary
>> app Flex will provide the View, so im trying to find a way to enable
>> Struts to serve just a result without a JSP or HTML page, i just  
>> want the
>> result. Oh god this is confusing....
>>
>
> Sorry, may be i am unable to explain what i want to do, so i will  
> enter in
> some details. What i understand is that when a request to a Struts- 
> enabled
> app, the request is passed to the controller, the controller then  
> create
> some kind of object based on the request and then send that to the  
> "handler"
> then the handler do whatever it should and then send a result
> (forwardsomehing is called) back to the controller which at the end  
> render a
> page. What i want to do its avoiding the controller render that  
> page, and
> just sent back "the result", for example an object, a bean to be  
> consumed by
> flex...Just like if you were calling a function, since Flex is able to
> serialize java objects and deserialize them into actionscript  
> objects. I
> mean, im trying to enable Struts to serve to different clients, for  
> example
> Flex or an applet...
> -- 
> View this message in context: http://www.nabble.com/Struts-service- 
> facade-tf3078810.html#a8563271
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts service facade

Posted by Martin Cooper <ma...@apache.org>.
First, this is really a question for the User list. This list is for
discussion of the development of Struts itself. Please follow up on that
list rather than here.

Second, you haven't actually said whether you're trying to use Struts 1 or
Struts 2. Joe has provided the answer for S1; Musachy has provided the
answer for S2. If you read a little bit more of the corresponding
documentation, you will see that either way, the solution to your problem is
simple.

--
Martin Cooper


On 1/24/07, einundswanzig <ei...@yahoo.com.hk> wrote:
>
>
>
>
> einundswanzig wrote:
> >
> > Im new in Struts, in fact im pretty new in Java, but i have programmed
> for
> > Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server with
> > Struts on it using Flex. Flex is able to call a java component on the
> > server and execute a method and then serialize the result and
> deserialize
> > it in an Actionscript(scripting language of flex) object. In my
> imaginary
> > app Flex will provide the View, so im trying to find a way to enable
> > Struts to serve just a result without a JSP or HTML page, i just want
> the
> > result. Oh god this is confusing....
> >
>
> Sorry, may be i am unable to explain what i want to do, so i will enter in
> some details. What i understand is that when a request to a Struts-enabled
> app, the request is passed to the controller, the controller then create
> some kind of object based on the request and then send that to the
> "handler"
> then the handler do whatever it should and then send a result
> (forwardsomehing is called) back to the controller which at the end render
> a
> page. What i want to do its avoiding the controller render that page, and
> just sent back "the result", for example an object, a bean to be consumed
> by
> flex...Just like if you were calling a function, since Flex is able to
> serialize java objects and deserialize them into actionscript objects. I
> mean, im trying to enable Struts to serve to different clients, for
> example
> Flex or an applet...
> --
> View this message in context:
> http://www.nabble.com/Struts-service-facade-tf3078810.html#a8563271
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts service facade

Posted by einundswanzig <ei...@yahoo.com.hk>.


einundswanzig wrote:
> 
> Im new in Struts, in fact im pretty new in Java, but i have programmed for
> Coldfusion, C#/VB and Flex. Im trying to connect to a J2EE server with
> Struts on it using Flex. Flex is able to call a java component on the
> server and execute a method and then serialize the result and deserialize
> it in an Actionscript(scripting language of flex) object. In my imaginary
> app Flex will provide the View, so im trying to find a way to enable
> Struts to serve just a result without a JSP or HTML page, i just want the
> result. Oh god this is confusing....
> 

Sorry, may be i am unable to explain what i want to do, so i will enter in
some details. What i understand is that when a request to a Struts-enabled
app, the request is passed to the controller, the controller then create
some kind of object based on the request and then send that to the "handler"
then the handler do whatever it should and then send a result
(forwardsomehing is called) back to the controller which at the end render a
page. What i want to do its avoiding the controller render that page, and
just sent back "the result", for example an object, a bean to be consumed by
flex...Just like if you were calling a function, since Flex is able to
serialize java objects and deserialize them into actionscript objects. I
mean, im trying to enable Struts to serve to different clients, for example
Flex or an applet...
-- 
View this message in context: http://www.nabble.com/Struts-service-facade-tf3078810.html#a8563271
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org