It works now :-)
I've edited my web.xml file to use this:

<servlet>
    <servlet-name>rest</servlet-name>
    <servlet-class>
      com.noelios.restlet.ext.spring.RestletFrameworkServlet
    </servlet-class>
    <init-param> 
        <param-name>targetRestletBeanName</param-name>   
        <param-value>guard</param-value>   
    </init-param> 
    <load-on-startup>1</load-on-startup> 
  </servlet>

Instead of this:
<servlet>
    <servlet-name>rest</servlet-name>
    <servlet-class>
      com.noelios.restlet.ext.spring.RestletFrameworkServlet
    </servlet-class>
</servlet>

Thanks again :-)


mkhatib wrote:
> 
> Sorry I meant to say Can I attach the Guard to the Router Directly in the
> xml file?
> 
> 
> mkhatib wrote:
>> 
>> Hey,
>> Thanks Sutphin! Now it works when I run it as a standalone application, 
>> SpringComponent component = (SpringComponent)
>> context.getBean("restletComponent");
>> component.start()
>> 
>> However when I run it on Tomcat, it still doesn't do much, Is there
>> specific configurations to use this Guard with Tomcat?
>> 
>> I've in My Web.xml:
>> 
>> <servlet>
>>     <servlet-name>rest</servlet-name>
>>     <servlet-class>
>>       com.noelios.restlet.ext.spring.RestletFrameworkServlet
>>     </servlet-class>
>>   </servlet>
>> 
>>   <servlet-mapping>
>>     <servlet-name>rest</servlet-name>
>>     <url-pattern>/*</url-pattern>
>>   </servlet-mapping>
>> 
>>   <listener>
>>    
>> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>>   </listener>
>> 
>> And my rest-servlet.xml is like what I post earlier,
>> My guess is that tomcat ignores the application and guard beans in the
>> rest-servlet.xml and uses the router directly. Can I attach the router
>> directly in the xml file?
>> 
>> Thanks again
>> 
>> 
>> 
>> 
>> Rhett Sutphin wrote:
>>> 
>>> Hi,
>>> 
>>> On Jan 18, 2010, at 6:09 AM, mkhatib wrote:
>>> 
>>>> I am trying to implement web services that will be used on an iPhone
>>>> client.
>>>> I need the user to authenticate and then make sure he is authorized
>>>> before
>>>> executing an action. I am using Spring 2.5.6 along with Restlet 1.1.7. 
>>>> 
>>>> <bean name="restletRouter" class="org.restlet.ext.spring.SpringRouter">
>>>> ....
>>>> <bean id="app" class="org.restlet.Application">
>>> 
>>> What is the root property for the "app" bean?  It should be the guard.
>>> 
>>> Rhett
>>> 
>>>> ....
>>>> <bean id="restletServer" class="org.restlet.ext.spring.SpringServer">
>>>> ....
>>>> <bean id="restletComponent"
>>>> class="org.restlet.ext.spring.SpringComponent">
>>>> ....
>>>> <bean name="secretResolver"
>>>> class="ps.exalt.iywave.server.api.security.CustomAuth"
>>>> scope="singleton"/>
>>>> ....
>>>> <bean name="guard"
>>>> class="ps.exalt.iywave.server.api.security.CustomGaurd"
>>>> scope="singleton">   
>>>>                <property name="next" ref="restletRouter"/> 
>>>>                <property name="secretResolver" ref="secretResolver"/>
>>>> </bean>
>>>> 
>>>> 
>>>> The problem is it is not asking for authentication, is there anything I
>>>> am
>>>> missing?
>>> 
>>> ------------------------------------------------------
>>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439985
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Basic-HTTP-Auth-without-Guards-tp4413298p4413770.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2439999

Reply via email to