You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pedro Herrera <pe...@hotmail.com> on 2007/06/24 04:47:19 UTC

autocompleter help

Hi,
  In the struts-showcase is showed an example of autocomplete.

http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp

 When the user changes the first combo(color or fruits) , the second combo
is changed (apple, banana,ect) too.
I need an example for the second combo be filled with names and keys too.
How I do this with autocomplete? What I need to change in options.ftl ??

Thanks 

Herrera 
(Strus2.0.8)
-- 
View this message in context: http://www.nabble.com/autocompleter-help-tf3971137.html#a11272073
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: [S2] How to integrate JSF with struts 2?

Posted by Jason Wyatt <jw...@itree.com.au>.
Thanks Don, I finally got JSF working with struts 2.

Seems like the docs at
http://struts.apache.org/2.x/docs/javaserver-faces.html could really use an
example of how to set up the jsf plugin. 

I didn't realise the JSF plugin isn't normally "plugged in" until I saw the
struts-plugin.xml inside the struts2-jsf-plugin-2.0.6.jar and the
struts-jsf.xml file under the showcase\web\WEB-INF\classes directory.

Maybe I missed some other resource on the web?

Regards
Jason
 

-----Original Message-----
From: Don Brown [mailto:donald.brown@gmail.com] 
Sent: Monday, 25 June 2007 6:54 PM
To: Struts Users Mailing List
Subject: Re: [S2] How to integrate JSF with struts 2?

How the JSF integration works is we decompose the JSF Lifecycle object into
its phases and store each in a Struts 2 Interceptor.  Therefore, the request
enters the Struts 2 FilterDispatcher like normal, then if the action mapping
includes the JSF interceptors (like it does in your example by including the
"jsfStack"), the request will go through the JSF phases.  The page
displayed, employee.jsp, is determined using normal JSF means (taking the
action name and appending a ".jsp").
Even that might be configurable, though I couldn't say for sure.

Don

On 6/25/07, Jason Wyatt <jw...@itree.com.au> wrote:
> I'm confused as to how to integrate a third-party JSF component with 
> our Struts 2 app.
>
> I've been able to get a the third-party example JSF page working with 
> using one web.xml file, and our Struts 2 app works with another 
> ordinary web.xml file, but I can't seem to get both working together using
one web.xml file.
>
> The example at http://struts.apache.org/2.x/docs/javaserver-faces.html 
> shows one way of integrating JSF with Struts 2 - by adding  
> <interceptor-ref name="jsfStack" /> to the action definition.
>
> However, I don't really understand the example... How does the action 
> know to go to the employee page on success? It seems to be missing 
> something. The example code:
>
> <action name="employee"
> class="org.apache.struts.action2.showcase.jsf.EmployeeAction">
>     <interceptor-ref name="basicStack"/>
>     <interceptor-ref name="jsfStack"/>
>     <result name="success" type="jsf" />
>     <result name="index" type="redirect-action">index</result>
> </action>
>
>
> The "showcase" JSF example seems to use another way - by setting up a 
> javax.faces.webapp.FacesServlet to process all *.action requests.
>
> This seems quite different to the documented example above, and 
> counterintuitive... If Faces is processing the actions, then how does 
> the struts framework get called?
>
>
> Thanks for any help, regards
>
> Jason
>
>
> -----
> Falun Dafa  Truth - Compassion - Forbearance
>
> A mind & body practice under persecution in China
>
> http://www.faluninfo.net
>
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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





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


Re: [S2] How to integrate JSF with struts 2?

Posted by Don Brown <do...@gmail.com>.
How the JSF integration works is we decompose the JSF Lifecycle object
into its phases and store each in a Struts 2 Interceptor.  Therefore,
the request enters the Struts 2 FilterDispatcher like normal, then if
the action mapping includes the JSF interceptors (like it does in your
example by including the "jsfStack"), the request will go through the
JSF phases.  The page displayed, employee.jsp, is determined using
normal JSF means (taking the action name and appending a ".jsp").
Even that might be configurable, though I couldn't say for sure.

Don

On 6/25/07, Jason Wyatt <jw...@itree.com.au> wrote:
> I'm confused as to how to integrate a third-party JSF component with our
> Struts 2 app.
>
> I've been able to get a the third-party example JSF page working with using
> one web.xml file, and our Struts 2 app works with another ordinary web.xml
> file, but I can't seem to get both working together using one web.xml file.
>
> The example at http://struts.apache.org/2.x/docs/javaserver-faces.html shows
> one way of integrating JSF with Struts 2 - by adding  <interceptor-ref
> name="jsfStack" /> to the action definition.
>
> However, I don't really understand the example... How does the action know
> to go to the employee page on success? It seems to be missing something. The
> example code:
>
> <action name="employee"
> class="org.apache.struts.action2.showcase.jsf.EmployeeAction">
>     <interceptor-ref name="basicStack"/>
>     <interceptor-ref name="jsfStack"/>
>     <result name="success" type="jsf" />
>     <result name="index" type="redirect-action">index</result>
> </action>
>
>
> The "showcase" JSF example seems to use another way - by setting up a
> javax.faces.webapp.FacesServlet to process all *.action requests.
>
> This seems quite different to the documented example above, and
> counterintuitive... If Faces is processing the actions, then how does the
> struts framework get called?
>
>
> Thanks for any help, regards
>
> Jason
>
>
> -----
> Falun Dafa  Truth - Compassion - Forbearance
>
> A mind & body practice under persecution in China
>
> http://www.faluninfo.net
>
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


[S2] How to integrate JSF with struts 2?

Posted by Jason Wyatt <jw...@itree.com.au>.
I'm confused as to how to integrate a third-party JSF component with our
Struts 2 app.

I've been able to get a the third-party example JSF page working with using
one web.xml file, and our Struts 2 app works with another ordinary web.xml
file, but I can't seem to get both working together using one web.xml file.

The example at http://struts.apache.org/2.x/docs/javaserver-faces.html shows
one way of integrating JSF with Struts 2 - by adding  <interceptor-ref
name="jsfStack" /> to the action definition. 

However, I don't really understand the example... How does the action know
to go to the employee page on success? It seems to be missing something. The
example code:

<action name="employee"
class="org.apache.struts.action2.showcase.jsf.EmployeeAction">
    <interceptor-ref name="basicStack"/>
    <interceptor-ref name="jsfStack"/>
    <result name="success" type="jsf" />
    <result name="index" type="redirect-action">index</result>
</action>


The "showcase" JSF example seems to use another way - by setting up a
javax.faces.webapp.FacesServlet to process all *.action requests. 

This seems quite different to the documented example above, and
counterintuitive... If Faces is processing the actions, then how does the
struts framework get called?


Thanks for any help, regards

Jason


-----
Falun Dafa  Truth - Compassion - Forbearance

A mind & body practice under persecution in China

http://www.faluninfo.net












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


Re: autocompleter help

Posted by Musachy Barroso <mu...@gmail.com>.
All you have to do is make sure that the url used to load the second
autocompleter returns a JSON that has keys and values, like it is explained
here:

http://struts.apache.org/2.x/docs/ajax-tags.html

musachy

On 6/24/07, Pedro Herrera <pe...@hotmail.com> wrote:
>
>
> ok. but How I do this  ?
>
>
> I need an example for the second combo be filled with names and keys too.
> How I do this with autocomplete? What I need to change in options.ftl ?? I
> need a complete example
>
> Thanks
>
> Pedro
>
>
>
>
> Musachy Barroso wrote:
> >
> > You can linked them if the second one will have its options loaded using
> > ajax.
> >
> > musachy
> >
> > On 6/24/07, Pedro Herrera <pe...@hotmail.com> wrote:
> >>
> >>
> >> yes ...
> >>
> >>
> >>
> >> Musachy Barroso wrote:
> >> >
> >> > Do you want the options on the second autocompleter to be
> pre-populated
> >> > like
> >> > in the first one "%{'a','b'}"?
> >> >
> >> > musachy
> >> >
> >> > On 6/23/07, Pedro Herrera <pe...@hotmail.com> wrote:
> >> >>
> >> >>
> >> >> Hi,
> >> >>   In the struts-showcase is showed an example of autocomplete.
> >> >>
> >> >>
> >> >>
> >>
> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp
> >> >>
> >> >> When the user changes the first combo(color or fruits) , the second
> >> combo
> >> >> is changed (apple, banana,ect) too.
> >> >> I need an example for the second combo be filled with names and keys
> >> too.
> >> >> How I do this with autocomplete? What I need to change in
> >> options.ftl??
> >> >>
> >> >> Thanks
> >> >>
> >> >> Herrera
> >> >> (Strus2.0.8)
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/autocompleter-help-tf3971137.html#a11272073
> >> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/autocompleter-help-tf3971137.html#a11275905
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/autocompleter-help-tf3971137.html#a11277778
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: autocompleter help

Posted by Pedro Herrera <pe...@hotmail.com>.
ok. but How I do this  ?


I need an example for the second combo be filled with names and keys too.
How I do this with autocomplete? What I need to change in options.ftl ?? I
need a complete example 

Thanks 

Pedro




Musachy Barroso wrote:
> 
> You can linked them if the second one will have its options loaded using
> ajax.
> 
> musachy
> 
> On 6/24/07, Pedro Herrera <pe...@hotmail.com> wrote:
>>
>>
>> yes ...
>>
>>
>>
>> Musachy Barroso wrote:
>> >
>> > Do you want the options on the second autocompleter to be pre-populated
>> > like
>> > in the first one "%{'a','b'}"?
>> >
>> > musachy
>> >
>> > On 6/23/07, Pedro Herrera <pe...@hotmail.com> wrote:
>> >>
>> >>
>> >> Hi,
>> >>   In the struts-showcase is showed an example of autocomplete.
>> >>
>> >>
>> >>
>> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp
>> >>
>> >> When the user changes the first combo(color or fruits) , the second
>> combo
>> >> is changed (apple, banana,ect) too.
>> >> I need an example for the second combo be filled with names and keys
>> too.
>> >> How I do this with autocomplete? What I need to change in
>> options.ftl??
>> >>
>> >> Thanks
>> >>
>> >> Herrera
>> >> (Strus2.0.8)
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/autocompleter-help-tf3971137.html#a11272073
>> >> Sent from the Struts - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > "Hey you! Would you help me to carry the stone?" Pink Floyd
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/autocompleter-help-tf3971137.html#a11275905
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> 

-- 
View this message in context: http://www.nabble.com/autocompleter-help-tf3971137.html#a11277778
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: autocompleter help

Posted by Musachy Barroso <mu...@gmail.com>.
You can linked them if the second one will have its options loaded using
ajax.

musachy

On 6/24/07, Pedro Herrera <pe...@hotmail.com> wrote:
>
>
> yes ...
>
>
>
> Musachy Barroso wrote:
> >
> > Do you want the options on the second autocompleter to be pre-populated
> > like
> > in the first one "%{'a','b'}"?
> >
> > musachy
> >
> > On 6/23/07, Pedro Herrera <pe...@hotmail.com> wrote:
> >>
> >>
> >> Hi,
> >>   In the struts-showcase is showed an example of autocomplete.
> >>
> >>
> >>
> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp
> >>
> >> When the user changes the first combo(color or fruits) , the second
> combo
> >> is changed (apple, banana,ect) too.
> >> I need an example for the second combo be filled with names and keys
> too.
> >> How I do this with autocomplete? What I need to change in options.ftl??
> >>
> >> Thanks
> >>
> >> Herrera
> >> (Strus2.0.8)
> >> --
> >> View this message in context:
> >> http://www.nabble.com/autocompleter-help-tf3971137.html#a11272073
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/autocompleter-help-tf3971137.html#a11275905
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

Re: autocompleter help

Posted by Pedro Herrera <pe...@hotmail.com>.
yes ...



Musachy Barroso wrote:
> 
> Do you want the options on the second autocompleter to be pre-populated
> like
> in the first one "%{'a','b'}"?
> 
> musachy
> 
> On 6/23/07, Pedro Herrera <pe...@hotmail.com> wrote:
>>
>>
>> Hi,
>>   In the struts-showcase is showed an example of autocomplete.
>>
>>
>> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp
>>
>> When the user changes the first combo(color or fruits) , the second combo
>> is changed (apple, banana,ect) too.
>> I need an example for the second combo be filled with names and keys too.
>> How I do this with autocomplete? What I need to change in options.ftl ??
>>
>> Thanks
>>
>> Herrera
>> (Strus2.0.8)
>> --
>> View this message in context:
>> http://www.nabble.com/autocompleter-help-tf3971137.html#a11272073
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> 

-- 
View this message in context: http://www.nabble.com/autocompleter-help-tf3971137.html#a11275905
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: autocompleter help

Posted by Musachy Barroso <mu...@gmail.com>.
Do you want the options on the second autocompleter to be pre-populated like
in the first one "%{'a','b'}"?

musachy

On 6/23/07, Pedro Herrera <pe...@hotmail.com> wrote:
>
>
> Hi,
>   In the struts-showcase is showed an example of autocomplete.
>
>
> http://www.planetstruts.org/struts2-showcase/viewSource.action?page=/ajax/autocompleter/index.jsp
>
> When the user changes the first combo(color or fruits) , the second combo
> is changed (apple, banana,ect) too.
> I need an example for the second combo be filled with names and keys too.
> How I do this with autocomplete? What I need to change in options.ftl ??
>
> Thanks
>
> Herrera
> (Strus2.0.8)
> --
> View this message in context:
> http://www.nabble.com/autocompleter-help-tf3971137.html#a11272073
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd