Re: Portlets and filters
Hello, I have a struts portlet which uses a filter. The SvcIFilter call has to be the first on the way in and the last on the way out. It is used to open/close Connections to a database. The stand-alone struts application works fine, with the following configuration: filter-mapping filter-nameSvcI Filter/filter-name url-pattern/*/url-pattern /filter-mapping For the Portlet, I started getting into troubles because the close method of the filter was called to early. That is, we have a strict open-close sequence which works fine in the stand alone application. I first tried to configure the web.xml file like this: web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 . . . filter-mapping filter-nameSvcI Filter/filter-name url-pattern/*/url-pattern dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher dispatcherINCLUDE/dispatcher /filter-mapping Then I tried this: (change in the url-patttern) filter-mapping filter-nameSvcI Filter/filter-name url-pattern*.do/url-pattern dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher dispatcherINCLUDE/dispatcher /filter-mapping The latter configuration gave better results (I could get up to the initial display of the portlet), but any click on a link (invoking a struts action) gave Exceptions because the close method of the filter was executed to early. How should I configure the url-pattern so the filter gets called the first on the way in and the last on the way out ??? I repeat, the stand-alone struts application works fine... Note that I am using struts-bridge 0.1 Thanks in advance for any help. Regards Xavier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Portlets and filters
I guess you are not running under Servlet 2.4? Then it won't work. Only since Servlet 2.4 will filters work for dispatched requests. Xavier Lawrence wrote: Hello, I have a working struts application that I am trying to change to a portlet. I was asking myself how were filters managed in the portlet world. I seem to have a slight problem with those, they seem to be not considered by the portlet. That is, the non-portlet webApp works fine, but the portlet struts app encounters problems because some filter methods don't seem to be called... Any help is appreciated on the subject. Below is a piece of my web.xml file filter filter-nameXSLT Filter/filter-name filter-classedu.rpi.sss.util.servlets.ConfiguredXSLTFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedirectoryBrowsingDisallowed/param-name param-valueno/param-value /init-param /filter filter filter-nameSvcI Filter/filter-name filter-classedu.rpi.cct.uwcal.webcommon.UWCalSvciFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param /filter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Portlets and filters
I am using Tomcat 5.0.28 I guess you are not running under Servlet 2.4? Then it won't work. Only since Servlet 2.4 will filters work for dispatched requests. Xavier Lawrence wrote: Hello, I have a working struts application that I am trying to change to a portlet. I was asking myself how were filters managed in the portlet world. I seem to have a slight problem with those, they seem to be not considered by the portlet. That is, the non-portlet webApp works fine, but the portlet struts app encounters problems because some filter methods don't seem to be called... Any help is appreciated on the subject. Below is a piece of my web.xml file filter filter-nameXSLT Filter/filter-name filter-classedu.rpi.sss.util.servlets.ConfiguredXSLTFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedirectoryBrowsingDisallowed/param-name param-valueno/param-value /init-param /filter filter filter-nameSvcI Filter/filter-name filter-classedu.rpi.cct.uwcal.webcommon.UWCalSvciFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param /filter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -=[ xlawrence at jahia dot com ]=- Jahia : A collaborative source CMS and Portal Server www.jahia.org Community and product web site www.jahia.com Commercial services company www.collaborativesource.org Jahia's collaborative license - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Portlets and filters
So to do that, I need to specify the DTD version 2.4 in the DOCTYPE ??? Tomcat 5 still supports Servlet 2.3 and if you don't define your web.xml as requiring 2.4 it will behave as a 2.3 container. Xavier Lawrence wrote: I am using Tomcat 5.0.28 I guess you are not running under Servlet 2.4? Then it won't work. Only since Servlet 2.4 will filters work for dispatched requests. Xavier Lawrence wrote: Hello, I have a working struts application that I am trying to change to a portlet. I was asking myself how were filters managed in the portlet world. I seem to have a slight problem with those, they seem to be not considered by the portlet. That is, the non-portlet webApp works fine, but the portlet struts app encounters problems because some filter methods don't seem to be called... Any help is appreciated on the subject. Below is a piece of my web.xml file filter filter-nameXSLT Filter/filter-name filter-classedu.rpi.sss.util.servlets.ConfiguredXSLTFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedirectoryBrowsingDisallowed/param-name param-valueno/param-value /init-param /filter filter filter-nameSvcI Filter/filter-name filter-classedu.rpi.cct.uwcal.webcommon.UWCalSvciFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param /filter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -=[ xlawrence at jahia dot com ]=- Jahia : A collaborative source CMS and Portal Server www.jahia.org Community and product web site www.jahia.com Commercial services company www.collaborativesource.org Jahia's collaborative license - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Portlets and filters
No, 2.4 has a Schema definition. Use the following: ?xml version=1.0 encoding=ISO-8859-1? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 and read Servlet 2.4 SRV.6.2.5 Filters and the RequestDispatcher. Xavier Lawrence wrote: So to do that, I need to specify the DTD version 2.4 in the DOCTYPE ??? Tomcat 5 still supports Servlet 2.3 and if you don't define your web.xml as requiring 2.4 it will behave as a 2.3 container. Xavier Lawrence wrote: I am using Tomcat 5.0.28 I guess you are not running under Servlet 2.4? Then it won't work. Only since Servlet 2.4 will filters work for dispatched requests. Xavier Lawrence wrote: Hello, I have a working struts application that I am trying to change to a portlet. I was asking myself how were filters managed in the portlet world. I seem to have a slight problem with those, they seem to be not considered by the portlet. That is, the non-portlet webApp works fine, but the portlet struts app encounters problems because some filter methods don't seem to be called... Any help is appreciated on the subject. Below is a piece of my web.xml file filter filter-nameXSLT Filter/filter-name filter-classedu.rpi.sss.util.servlets.ConfiguredXSLTFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param init-param param-namedirectoryBrowsingDisallowed/param-name param-valueno/param-value /init-param /filter filter filter-nameSvcI Filter/filter-name filter-classedu.rpi.cct.uwcal.webcommon.UWCalSvciFilter/filter-class init-param param-namedebug/param-name param-value0/param-value /init-param /filter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]