Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to add static resources and a welcome page to RWT Standalone?
How to add static resources and a welcome page to RWT Standalone? [message #1392599] Wed, 02 July 2014 15:10 Go to next message
Stefan Klaus is currently offline Stefan KlausFriend
Messages: 21
Registered: February 2011
Junior Member
Hi!

I start my rwt standalone app with an embedded jetty with spring (see configuration below). Now i want to add a static welcome page like mentioned in the RAP FAQ but i have no idea how to?

One more note: Before i started rap in OSGi context. There i added the static resources with org.osgi.service.http.HttpService in the ApplicationConfiguration.

Any ideas?
Stefan

How i startup the jetty with spring
	<bean id="eclipseRap" class="org.eclipse.jetty.server.Server"
		init-method="start" destroy-method="stop">
		<property name="threadPool">
			<bean id="ThreadPoolWS" class="org.eclipse.jetty.util.thread.QueuedThreadPool">
				<constructor-arg value="200" />
			</bean>
		</property>
		<property name="connectors">
			<list>
				<bean id="ConnectorWS" class="org.eclipse.jetty.server.nio.SelectChannelConnector"
					p:port="10080" />
			</list>
		</property>

		<property name="handler">
			<bean class="org.eclipse.jetty.server.handler.HandlerCollection">
				<property name="handlers">
					<list>
						<bean class="com.eclipse.RAPServer" init-method="init"/>
					</list>
				</property>
			</bean>
		</property>
	</bean>


How i add the rwtservlet and merge up the applicationcontext
public class RAPServer extends WebAppContext implements ApplicationContextAware {

	private ApplicationContext applicationContext;

	public RAPServer() {
		super(null, "/");

	}

	public void init() {
		setSessionHandler(new SessionHandler());
		setContextPath("/");

		setResourceBase(".");

		this.addServlet(RWTServlet.class, "/rap");

		setClassLoader(Thread.currentThread().getContextClassLoader());
		setInitParameter(ApplicationConfiguration.CONFIGURATION_PARAM,
				"ApplicationConfiguration");

		addEventListener(new RWTServletContextListener());

		GenericWebApplicationContext wctx = new GenericWebApplicationContext();
		wctx.setParent(this.applicationContext);
		wctx.setConfigLocation("");
		wctx.setServletContext(getServletContext());
		wctx.refresh();

		getServletContext().setAttribute(
				WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,
				wctx);

	}

Re: How to add static resources and a welcome page to RWT Standalone? [message #1395685 is a reply to message #1392599] Mon, 07 July 2014 08:40 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1298
Registered: July 2009
Senior Member

Hi Stefan,

in a standalone applications, you have to add your static resources in
the web application (web.xml).

Regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Browser widget problem
Next Topic:TableViewer in IE9, problem with arrow-down keys
Goto Forum:
  


Current Time: Wed Apr 01 22:41:14 GMT 2015

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

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