On Mon, Dec 27, 2010 at 3:08 PM, Levend Sayar <[email protected]> wrote:
> Hi, all.
> I
> followed http://wiki.sipfoundry.org/display/sipXecs/How+to+create+a+simple+page+in+sipXconfig
> and added a page.
> On my page, I have a textbox that must be filled with a data read from a usb
> hardware. I have the java class that can access that hardware.
> I do not know any beans, tapestry, spring etc. technology used in
> sipxconfig.
> So can you help me for adding my java class in sipxconfig and use it in
> sipxconfig context ?
Declare your class that access hardware as a spring bean (in one of
the xml files used by spring to create the context, see
sipxconfig-web/context/WEB-INF/web.xml, contextConfigLocation
param-value), e.g. :
<bean id="classThatAccessHardware"
class="org.sipfoundry.sipxconfig.common.MyClass"/>
then inject it in Tapestry page as:
@InjectObject("spring:classThatAccessHardware")
public abstract MyClass getMyClass();
Then populate your textbox as: getMyClass().callMyMethod()
Post back with your code if you have problems
George
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/