Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Eclipse RCP plugin + embedded Jetty + JSF
Eclipse RCP plugin + embedded Jetty + JSF [message #892918] Sun, 01 July 2012 21:08
elena ctinescu is currently offline elena ctinescuFriend
Messages: 2
Registered: July 2012
Junior Member

I made an RCP plugin with embedded Jetty as following:

1) In plugin.xml -> Dependencies, I have added the following:


2) In plugin.xml -> Extensions, I have added a Servlet extension point (org.eclipse.equinox.http.registry.servlet)

class: TemperatureServlet

The TemperatureServlet looks like this:


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TemperatureServlet extends HttpServlet {

protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {

System.out.println("doGet Called");


The file Convertor.jsp looks like this:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<h:panelGrid columns="2">
<h:outputLabel value="Celsius"></h:outputLabel>
<h:inputText value="#{temperatureConvertor.celsius}"></h:inputText>
<h:commandButton action="#{temperatureConvertor.celsiusToFahrenheit}" value="Calculate"></h:commandButton>
<h:commandButton action="#{temperatureConvertor.reset}" value="Reset"></h:commandButton>
<h:messages layout="table"></h:messages>

<h:panelGroup rendered="#{temperatureConvertor.initial!=true}">
<h3> Result </h3>
<h:outputLabel value="Fahrenheit "></h:outputLabel>
<h:outputLabel value="#{temperatureConvertor.fahrenheit}"></h:outputLabel>

The file faces-config.xml contains:

<?xml version="1.0" encoding="UTF-8"?>

xmlns="http: //"
xmlns:xsi="http: //"
xsi:schemaLocation="http: // http: //"


My plugin has the following hierarchy:

------class package
In Activator class, method start(), I have started the web server like this:

public void start(BundleContext context) throws Exception {
plugin = this;

Bundle bundle = Platform.getBundle("org.eclipse.equinox.http.registry");
if (bundle.getState() == Bundle.RESOLVED) {

Dictionary settings = new Hashtable();
settings.put("http.enabled", Boolean.TRUE);
settings.put("http.port", 8080);
settings.put("", "");
settings.put("https.enabled", Boolean.FALSE);
settings.put("context.path", "/");
settings.put("context.sessioninactiveinterval", 1800);

try {
JettyConfigurator.startServer(PLUGIN_ID + ".jetty", settings);
} catch (Exception e) {
To this plugin I have added also the following libraries:

- JSTL: javax.servlet.jsp.jstl-1.2.1-javadoc.jar; javax.servlet.jsp.jstl-api-1.2.1-javadoc.jar
- JSF 2.0 (Apache MyFaces JSF Core-2.0 API 2.0.2)
After I launch the application, if I type in my browser localhost:8080/temperature

It doesn't know where to find Convertor.jsp. My question is: how can I configure this plugin to know the resource location WebContent and the most important, how can I configure the plugin to know how to process JSFs and to know about the faces-config.xml and web.xml.

Can I, for example, when I define the extension org.eclipse.equinox.http.registry.servlets, do something like this? class: javax.faces.webapp.FacesServlet alis: /*.jsp

(all the files *.jsp to be processed by the FacesServlet)?

Thank you very much and sorry if the questions are silly, but I am new in this area of RCP plugins, Jetty and JSF.
Previous Topic:How to remove RCP view icon?
Next Topic:Building Product with maven tycho
Goto Forum:

Current Time: Tue Oct 06 18:50:53 GMT 2015

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

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