Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Faceted Project Framework » Adding a listener to the web.xml(using facets)
Adding a listener to the web.xml [message #764280] Sun, 11 December 2011 20:42 Go to next message
Benjamin Horst is currently offline Benjamin HorstFriend
Messages: 2
Registered: December 2011
Junior Member
Hello,

I stumbled over the Faceted Project Framework when my requirement was to develope a "New Project Wizard" for some custom J2EE-portlet project. And I used the tutorial by Konstantin Komissarchik to add files and added Context stuff to the web.xml.

Now I need to add two listeners (org.springframework.web.context.ContextLoaderListener and org.springframework.web.context.request.RequestContextListener) to the web.xml and I am stuck at the very begining of that task.

So my question is: How do I add listeners to the web.xml using a facet?
Should I use the Event Handlers mentioned in Appendix C? Or maybe someone has some example code of a project I could have a look at?
Everything else in the FPF seemed pretty straight forward. I am sure that I am just missing a small thing.

Thanks in advance

Benjamin

[Updated on: Sun, 11 December 2011 20:43]

Report message to a moderator

Re: Adding a listener to the web.xml [message #765530 is a reply to message #764280] Wed, 14 December 2011 09:01 Go to previous message
Benjamin Horst is currently offline Benjamin HorstFriend
Messages: 2
Registered: December 2011
Junior Member
If anyone stumbles over the same thing, the following worked for me:

	public static void addListener(WebApp webApp, String spring_listener) {
		Listener listener = CommonFactory.eINSTANCE.createListener();
		listener.setListenerClassName(spring_listener);
		webApp.getListeners().add(listener);
	}


Benjamin
Previous Topic:Questions related to org.eclipse.wst.common.project.facet.core.facets extension point
Goto Forum:
  


Current Time: Thu Dec 18 20:27:25 GMT 2014

Powered by FUDForum. Page generated in 0.01595 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software