You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Madan Narra <ma...@gmail.com> on 2007/05/07 09:49:49 UTC

[ Tobago ] Help Regarding invoking Managed Bean from dos/unix shell

Hi All,

I have a doubt which may / may not be related to Tobago , but its sure that
its related to JSF.

I have a cron job running on UNIX platform , which is scheduled to perform a
specific operation.

Previously the job calls a URL with a parameter passed to the Servlet ,
something like this

" http://localhost:8080/myApp/helloWorld?command=xxxyyy" .

Based upon the request parameter "command" the code is executed in the
servlet.

Now i need to perform the same action but with the managed beans as now we
were using JSF (Tobago)

I am not able to guess how to achieve this...

* Have to implement the logic in Managed Beans and not in Servlet's.

Any suggestions ... ?

-- 
Regards,
Madan N

Re: [ Tobago ] Help Regarding invoking Managed Bean from dos/unix shell

Posted by Madan Narra <ma...@gmail.com>.
Hi Udo,

Thnx for the response..

Its working fine now..

-- 
Regards,
Madan N

Re: [ Tobago ] Help Regarding invoking Managed Bean from dos/unix shell

Posted by Udo Schnurpfeil <ud...@schnurpfeil.de>.
In the FishServlet is a reference to the managed bean "fishPond".
It can be used after:

    FishPond fishPond = (FishPond) 
VariableResolverUtil.resolveVariable(facesContext, "fishPond");

Regards

Udo

By the way, the NonFacesRequestServlet is a way to provide external 
links with parameters to a JSF application. Internal command should be 
processed with the JSF methods (outcome/navigation-hander/...)


Madan Narra schrieb:
> Hi Udo,
>  
> Thnx for the quick  response.
>  
> I have another doubt to get clarified .
>  
> In the NonFacesRequest Example, the " FishServlet " extends 
> NonFacesRequestServlet.
> This class is specified in web.xml.
>  
> Can the same servlet be used as a Managed bean (registered in 
> faces-config.xml) ie if it can be referred in a Tobago Page and invoke 
> those methods that are attached to some of the components in that page ?
>  
>  


Re: [ Tobago ] Help Regarding invoking Managed Bean from dos/unix shell

Posted by Madan Narra <ma...@gmail.com>.
Hi Udo,

Thnx for the quick  response.

I have another doubt to get clarified .

In the NonFacesRequest Example, the " FishServlet " extends
NonFacesRequestServlet.
This class is specified in web.xml.

Can the same servlet be used as a Managed bean (registered in
faces-config.xml) ie if it can be referred in a Tobago Page and invoke those
methods that are attached to some of the components in that page ?

Re: [ Tobago ] Help Regarding invoking Managed Bean from dos/unix shell

Posted by Udo Schnurpfeil <ud...@schnurpfeil.de>.
You may extend the NonFacesRequestServlet like in the 
tobago-example-nonfacesrequest.

Regards

Udo

Madan Narra schrieb:
> Hi All,
>  
> I have a doubt which may / may not be related to Tobago , but its sure 
> that its related to JSF.
>  
> I have a cron job running on UNIX platform , which is scheduled to 
> perform a specific operation.
>  
> Previously the job calls a URL with a parameter passed to the Servlet 
> , something like this
>  
> " http://localhost:8080/myApp/helloWorld?command=xxxyyy" .
>  
> Based upon the request parameter "command" the code is executed in the 
> servlet.
>  
> Now i need to perform the same action but with the managed beans as 
> now we were using JSF (Tobago)
>  
> I am not able to guess how to achieve this...
>  
> * Have to implement the logic in Managed Beans and not in Servlet's.
>  
> Any suggestions ... ?
>  
> -- 
> Regards,
> Madan N