You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Johannes Hoechstaedter <j....@memocomp.de> on 2008/06/25 15:43:48 UTC

Form base authentication in tomcat

Hi everybody,

how can I etablixh a form based authentication in coconn running in tomcat?

My web.xml login-config looks as follows:

 <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Example Form-Based Authentication Area</realm-name>
      <form-login-config>
        <form-login-page>/myBlock1/login</form-login-page>
        <form-error-page>/myBlock1/login</form-error-page>
      </form-login-config>
    </login-config>

I have a match pattern in my sitemap for this:

<map:match pattern="login">
             
                  <!-- init -->
                 <map:generate src="resource/internal/pageTemplate.xml" />
             
                  <map:transform type="xslt" 
src="resource/internal/transform2LoginForm.xsl" />
                 
                  <!-- html ouptut -->
                   <map:serialize type="xhtml"/>
             
</map:match>

Running this pattern in jetty works fine, and my login form is shown. 
But when I load my webapp into Tomcat and when I run it, Tomcat doesn't 
complain, too. I get no Error message as I am expecting. The thing is, 
that I  get only an empty screen. Do anybody know something?

cheers
Johannes

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form based authentication in tomcat

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
I included the css by xinclude. That works fine. Never mind, the favicon 
is still missing.

Barbara Slupik schrieb:
> I had the same problem. In the end I put my styles inside login form, 
> because the link to css did not work. I hope someone knows better 
> solution.
>
> Barbara
>
> On 26 Jun, 2008, at 9:34 am, Johannes Hoechstaedter wrote:
>
>> same behaviour with:
>>
>> <html>
>> <head>
>> <title>test</title>
>> <link href="../../resource/external/style/style-main.css" 
>> type="text/css" rel="stylesheet" />
>> </head>
>> <body>
>>
>> Johannes Hoechstaedter schrieb:
>>> Hi,
>>>
>>> can you explain me why I can't add a style sheet to the login form? 
>>> everything works without style and favicon, but when I add these 
>>> features tomcat cannot find the resourc and I the login procedure 
>>> doesn't work anymore. Tomcat crashes with an exception, or the url 
>>> which is build by after successfully logged in is broken. This 
>>> behavior depends on the path.
>>>
>>> resource /......style.css
>>> ../resource/....style.css
>>>
>>> Result:
>>> javax.servlet.ServletException: No pipeline matched request
>>> org.apache.cocoon.ResourceNotFoundException: No pipeline matched 
>>> request
>>>
>>> ../../resource.....style.css
>>>
>>> Result:
>>> broken URL. The request is forwarded into my style sheet after 
>>> login, and not into the pipeline pattern.
>>>
>>> ../../../resource ...style.css
>>>
>>> Result:
>>> No block for /resource/external/style/style.css
>>>
>>> In none of these cases the style is applied to the login page. The 
>>> start of my page is for example:
>>>
>>> <html>
>>> <header>
>>> <title>test</title>
>>> <link href="../../resource/external/style/style-main.css" 
>>> type="text/css" rel="stylesheet" />
>>> </header>
>>> <body>
>>>
>>> Is it possible to apply a css to a tomcat login form?
>>>
>>> thanks in advance
>>> cheers
>>> Johannes
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form base authentication in tomcat

Posted by Barbara Slupik <ba...@ntlworld.com>.
I had the same problem. In the end I put my styles inside login form,  
because the link to css did not work. I hope someone knows better  
solution.

Barbara

On 26 Jun, 2008, at 9:34 am, Johannes Hoechstaedter wrote:

> same behaviour with:
>
> <html>
> <head>
> <title>test</title>
> <link href="../../resource/external/style/style-main.css"  
> type="text/css" rel="stylesheet" />
> </head>
> <body>
>
> Johannes Hoechstaedter schrieb:
>> Hi,
>>
>> can you explain me why I can't add a style sheet to the login  
>> form? everything works without style and favicon, but when I add  
>> these features tomcat cannot find the resourc and I the login  
>> procedure doesn't work anymore. Tomcat crashes with an exception,  
>> or the url which is build by after successfully logged in is  
>> broken. This behavior depends on the path.
>>
>> resource /......style.css
>> ../resource/....style.css
>>
>> Result:
>> javax.servlet.ServletException: No pipeline matched request
>> org.apache.cocoon.ResourceNotFoundException: No pipeline matched  
>> request
>>
>> ../../resource.....style.css
>>
>> Result:
>> broken URL. The request is forwarded into my style sheet after  
>> login, and not into the pipeline pattern.
>>
>> ../../../resource ...style.css
>>
>> Result:
>> No block for /resource/external/style/style.css
>>
>> In none of these cases the style is applied to the login page. The  
>> start of my page is for example:
>>
>> <html>
>> <header>
>> <title>test</title>
>> <link href="../../resource/external/style/style-main.css"  
>> type="text/css" rel="stylesheet" />
>> </header>
>> <body>
>>
>> Is it possible to apply a css to a tomcat login form?
>>
>> thanks in advance
>> cheers
>> Johannes
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form base authentication in tomcat

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
same behaviour with:

<html>
<head>
<title>test</title>
<link href="../../resource/external/style/style-main.css" type="text/css" rel="stylesheet" />
</head>
<body>

Johannes Hoechstaedter schrieb:
> Hi,
>
> can you explain me why I can't add a style sheet to the login form? 
> everything works without style and favicon, but when I add these 
> features tomcat cannot find the resourc and I the login procedure 
> doesn't work anymore. Tomcat crashes with an exception, or the url 
> which is build by after successfully logged in is broken. This 
> behavior depends on the path.
>
> resource /......style.css
> ../resource/....style.css
>
> Result:
> javax.servlet.ServletException: No pipeline matched request
> org.apache.cocoon.ResourceNotFoundException: No pipeline matched request
>
> ../../resource.....style.css
>
> Result:
> broken URL. The request is forwarded into my style sheet after login, 
> and not into the pipeline pattern.
>
> ../../../resource ...style.css
>
> Result:
> No block for /resource/external/style/style.css
>
> In none of these cases the style is applied to the login page. The 
> start of my page is for example:
>
> <html>
> <header>
> <title>test</title>
> <link href="../../resource/external/style/style-main.css" 
> type="text/css" rel="stylesheet" />
> </header>
> <body>
>
> Is it possible to apply a css to a tomcat login form?
>
> thanks in advance
> cheers
> Johannes
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form base authentication in tomcat

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
Hi,

can you explain me why I can't add a style sheet to the login form? 
everything works without style and favicon, but when I add these 
features tomcat cannot find the resourc and I the login procedure 
doesn't work anymore. Tomcat crashes with an exception, or the url which 
is build by after successfully logged in is broken. This behavior 
depends on the path.

resource /......style.css
../resource/....style.css

Result:
javax.servlet.ServletException: No pipeline matched request
org.apache.cocoon.ResourceNotFoundException: No pipeline matched request

../../resource.....style.css

Result:
broken URL. The request is forwarded into my style sheet after login, 
and not into the pipeline pattern.

../../../resource ...style.css

Result:
No block for /resource/external/style/style.css

In none of these cases the style is applied to the login page. The start 
of my page is for example:

<html>
<header>
<title>test</title>
<link href="../../resource/external/style/style-main.css" 
type="text/css" rel="stylesheet" />
</header>
<body>

Is it possible to apply a css to a tomcat login form?

thanks in advance
cheers
Johannes




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form base authentication in tomcat

Posted by Johannes Hoechstaedter <j....@memocomp.de>.
YES !!! works ;)

Barbara Slupik schrieb:
> I had the same problem. I fixed it by adding:
>
> <filter>
> <filter-name>springRequestContextFilter</filter-name>   
> <filter-class>org.springframework._web.filter.RequestContextFilter_ 
> <http://web.filter.RequestContextFilter/></filter-class>
> </filter>
>
> <filter-mapping>
> <filter-name>springRequestContextFilter</filter-name>
> <url-pattern>/*</url-pattern>
> <dispatcher>FORWARD</dispatcher>
> <dispatcher>REQUEST</dispatcher>
> </filter-mapping>
>
> to my application _web.xml_ <http://web.xml/> file.
>
> Barbara
>
> On 25 Jun, 2008, at 2:43 pm, Johannes Hoechstaedter wrote:
>
>> Hi everybody,
>>
>> how can I etablixh a form based authentication in coconn running in 
>> tomcat?
>>
>> My web.xml <http://web.xml> login-config looks as follows:
>>
>> <login-config>
>>      <auth-method>FORM</auth-method>
>>      <realm-name>Example Form-Based Authentication Area</realm-name>
>>      <form-login-config>
>>        <form-login-page>/myBlock1/login</form-login-page>
>>        <form-error-page>/myBlock1/login</form-error-page>
>>      </form-login-config>
>>    </login-config>
>>
>> I have a match pattern in my sitemap for this:
>>
>> <map:match pattern="login">
>>                              <!-- init -->
>>                 <map:generate src="resource/internal/pageTemplate.xml" />
>>                              <map:transform type="xslt" 
>> src="resource/internal/transform2LoginForm.xsl" />
>>                                  <!-- html ouptut -->
>>                   <map:serialize type="xhtml"/>
>>             </map:match>
>>
>> Running this pattern in jetty works fine, and my login form is shown. 
>> But when I load my webapp into Tomcat and when I run it, Tomcat 
>> doesn't complain, too. I get no Error message as I am expecting. The 
>> thing is, that I  get only an empty screen. Do anybody know something?
>>
>> cheers
>> Johannes
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
>> <ma...@cocoon.apache.org>
>> For additional commands, e-mail: users-help@cocoon.apache.org 
>> <ma...@cocoon.apache.org>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Form base authentication in tomcat

Posted by Barbara Slupik <ba...@ntlworld.com>.
I had the same problem. I fixed it by adding:

	<filter>
		<filter-name>springRequestContextFilter</filter-name>
		<filter-class>org.springframework.web.filter.RequestContextFilter</ 
filter-class>
	</filter>

	<filter-mapping>
		<filter-name>springRequestContextFilter</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
	</filter-mapping>

to my application web.xml file.

Barbara

On 25 Jun, 2008, at 2:43 pm, Johannes Hoechstaedter wrote:

> Hi everybody,
>
> how can I etablixh a form based authentication in coconn running in  
> tomcat?
>
> My web.xml login-config looks as follows:
>
> <login-config>
>      <auth-method>FORM</auth-method>
>      <realm-name>Example Form-Based Authentication Area</realm-name>
>      <form-login-config>
>        <form-login-page>/myBlock1/login</form-login-page>
>        <form-error-page>/myBlock1/login</form-error-page>
>      </form-login-config>
>    </login-config>
>
> I have a match pattern in my sitemap for this:
>
> <map:match pattern="login">
>                              <!-- init -->
>                 <map:generate src="resource/internal/ 
> pageTemplate.xml" />
>                              <map:transform type="xslt"  
> src="resource/internal/transform2LoginForm.xsl" />
>                                  <!-- html ouptut -->
>                   <map:serialize type="xhtml"/>
>             </map:match>
>
> Running this pattern in jetty works fine, and my login form is  
> shown. But when I load my webapp into Tomcat and when I run it,  
> Tomcat doesn't complain, too. I get no Error message as I am  
> expecting. The thing is, that I  get only an empty screen. Do  
> anybody know something?
>
> cheers
> Johannes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>