Skip to main content


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 messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
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/
Re: How to add static resources and a welcome page to RWT Standalone? [message #1719167 is a reply to message #1395685] Tue, 05 January 2016 17:48 Go to previous message
excellion fdfds is currently offline excellion fdfdsFriend
Messages: 14
Registered: July 2012
Junior Member
Hi. I try to do exactly what you described in this post:
i also started rap in OSGi context.
But I do not know how to configure spring and jetty to get to this result. Could you help me? Thank you!
Previous Topic:How to make table tooltip sort.
Next Topic:RAP Javascript url and browser caching
Goto Forum:
  


Current Time: Sat Apr 27 03:50:10 GMT 2024

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

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

Back to the top