You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sumit Arora <su...@gmail.com> on 2016/03/05 06:23:02 UTC

How CXF helps to redirect to non-matching http request to a static HTML page

As CXF provides configuration to set default page from :

<init-param>
            <param-name>static-welcome-file</param-name>
            <param-value>/main.html</param-value>
        </init-param>

This is working fine.

My question : *How to redirect to non-matching http request to a static
HTML page  ?*

'Sumit

Re: How CXF helps to redirect to non-matching http request to a static HTML page

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

If CXFServlet has a wildcard pattern then another idea might be to catch 
404 with ExceptionMapper and then redirect with the help of 
RequestDispatcherProvider (ex, the mapper returns Error bean in Response 
and the provider is configured to map Error to error.html) - in this 
case CXFServlet will need to be additionally configured to redirect 
requests to say error.html to a 'default' servlet.

Sergey
On 05/03/16 17:15, Jose María Zaragoza wrote:
> Hi
>
> You could use a custom error page for 404 error code
> Look at error-page and error code in web.xml
>
>
> 2016-03-05 6:23 GMT+01:00 Sumit Arora <su...@gmail.com>:
>> As CXF provides configuration to set default page from :
>>
>> <init-param>
>>              <param-name>static-welcome-file</param-name>
>>              <param-value>/main.html</param-value>
>>          </init-param>
>>
>> This is working fine.
>>
>> My question : *How to redirect to non-matching http request to a static
>> HTML page  ?*
>>
>> 'Sumit


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: How CXF helps to redirect to non-matching http request to a static HTML page

Posted by Jose María Zaragoza <de...@gmail.com>.
Hi

You could use a custom error page for 404 error code
Look at error-page and error code in web.xml


2016-03-05 6:23 GMT+01:00 Sumit Arora <su...@gmail.com>:
> As CXF provides configuration to set default page from :
>
> <init-param>
>             <param-name>static-welcome-file</param-name>
>             <param-value>/main.html</param-value>
>         </init-param>
>
> This is working fine.
>
> My question : *How to redirect to non-matching http request to a static
> HTML page  ?*
>
> 'Sumit