Hello Raif,

I have several remarks.

I think you can remove the following parameter which is useless in a context of a servlet container (you can see this tutorial http://www.restlet.org/documentation/1.1/firstSteps):
       <server protocols="HTTP HTTPS" port="8080" />
I would like to add also that c.n.r.e.simple.jar is not required here since the servlet container can be considered as the HTTP/HTTPS connector.

Regarding the trace log, this kind of trace is only informative and can't be interpreted as a warning:
       FINE: The connector has been instantiated without any protocol.

Regarding this part of the configuration, it means that from your application, you will send requests with these protocols:
       <client protocols="CLAP FILE HTTP HTTPS" />
That means also that your classpath must contain the client connectors that support these protocols. If you have a look at this page [1] taken from the wiki (http://wiki.restlet.org, or http://www.restlet.org/documentation/1.1/ and choose "User Guide"), you will see that the HTTPS protocol is supported by either the Apache HttpClient based client connector or the JDK based client connector. So you need to complete the WEB-INF/lib folder.


Finally, I succeed in getting parameter value as follow:
getContext().getParameters().getFirstValue("myParamName");
Could you provide a sample test case?

I hope I forget nothing,

[1] http://wiki.restlet.org/docs_1.1/13-restlet/27-restlet/37-restlet.html


Best regards,
Thierry Boileau
-- Restlet ~ Core developer ~ http://www.restlet.org <http://www.restlet.org/> Noelios Technologies ~ Co-founder ~ http://www.noelios.com <http://www.noelios.com/>
hello,

i'm a new user to the RESTlet library and i'm having problems getting few things done. i would appreciate it if a seasoned user can point me to some documentation which can help me solve my problems. i'll describe later the make-up of the test application in case it's known to have a bearing on the problems:

1. in my browser when i enter the url to the resource/page i want to go to i see in the logs the following:

Nov 19, 2008 8:16:06 PM org.restlet.Connector <init>
FINE: The connector has been instantiated without any protocol.
Nov 19, 2008 8:16:06 PM com.noelios.restlet.Engine createHelper
WARNING: No available client connector supports the required protocols: 'CLAP' 'FILE' 'HTTP' 'HTTPS' . Please add the JAR of a matching connector to your classpath.
Nov 19, 2008 8:16:06 PM com.noelios.restlet.Engine createHelper
WARNING: No available server connector supports the required protocols: 'HTTP' 'HTTPS' . Please add the JAR of a matching connector to your classpath.
Nov 19, 2008 8:16:06 PM org.restlet.Connector <init>
FINE: The connector has been instantiated without any protocol.
Nov 19, 2008 8:16:06 PM org.restlet.Connector <init>
FINE: The connector has been instantiated without any protocol.
Nov 19, 2008 8:16:06 PM org.restlet.Connector <init>
FINE: The connector has been instantiated without any protocol.
Nov 19, 2008 8:16:06 PM org.restlet.Connector <init>
FINE: The connector has been instantiated without any protocol.

the Application is wired with a restlet.xml that has the following elements;

...
<client protocols="CLAP FILE HTTP HTTPS" />
<server protocols="HTTP HTTPS" port="8080" />
...

my WEB-INF/lib folder contains the required (i think) JARs: com.noelios.restlet-1.1.1.jar, c.n.r.ext.servlet-1.1.1.jar, c.n.r.e.simple-1.1.1.jar, org.restlet-1.1.1.jar and o.r.ext.freemarker-1.1.1.jar.


am i missing a JAR?  can i ignore the warnings?


2. the example uses a hard-coded path for configuring FreeMarker. wanting to experiment with the restlet API i tried to use an "initParam" name-value to pass this path to my Application but so far unsuccessfully. i interpreted the c.n.r.ext.servlet.ServerServlet javadoc part about the initParameters to mean as follows (in my webapp web.xml):

<servlet>
  <servlet-name>RestletServlet</servlet-name>
  <servlet-class>...ServerServlet</servlet-class>
  <init-param>
    <param-name>myParamName</param-name>
    <param-value>myParamValue</param-value>
  </init-param>
</servlet>

and tried to get it from both the context getAttributes() and getParameters() methods but they both return an empty collection in the constructor of my Application as well as in the createRoot method.

i tested also the assumption that the Context returned could be a ServletContextAdapter in the hope that i can then getServletContext() on it and invoke getInitParamater(xxx) but it wasn't.

how can i access from my Application or Filter such parameters?


in case it matters, my test application is a modified version of the book ch8 example running in Tomcat 6.0.18 and protected by a <security-role> in the web.xml. the config.xml of this webapp uses a JDBCRealm to check user credentials from a database.


thanks in advance for any help + cheers;
rsn

Reply via email to