You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jian Liao <no...@gmail.com> on 2005/12/30 13:30:53 UTC

An issue about TomcatGeronimoRealm

Hi all,
I am running Jetspeed on geronimo-tomcat-j2ee-1.0-2005-12-22. My jetspeed
web app context is jetspeed and I also have a servlet named   "jetspeed"
defined in web.xml. When there is request for url:
http://localhost:8080/jetspeed/. The private method getServletName(Request
request) defined in TomcatGeronimoRealm will return a "default" string, is
that what it expects?(I know default is configured by tomcat,
http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html)
Why it does not return "jetspeed", I did have a servlet named that. The
following is a snippet from my web.xml.

<servlet>
    <servlet-name>jetspeed</servlet-name>
    <servlet-class>org.apache.jetspeed.engine.JetspeedServlet
</servlet-class>
    <init-param>
      <param-name>properties</param-name>
      <param-value>/WEB-INF/conf/jetspeed.properties</param-value>
    </init-param>
    <init-param>
      <param-name>applicationRoot</param-name>
      <param-value>webContext</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
......
<servlet-mapping>
       <servlet-name>jetspeed</servlet-name>
       <url-pattern>/jetspeed/*</url-pattern>
</servlet-mapping>

Any help would be appreciated!

- Jian Liao

Re: An issue about TomcatGeronimoRealm

Posted by Jian Liao <no...@gmail.com>.
Thanks Jeff, I will try it ASAP and let you know if there is any problem.

Thanks again,

- Jian Liao

On 12/31/05, Jeff Genender <jg...@apache.org> wrote:
>
> Hi Jian,
>
> I am sorry, I had to read your problem closer to get the gist of the
> problem...so here is a second go on this:
>
> Upon closer inspection of this...
>
> /jetspeed/* should be picked up fine in the getServletName().  Upon
> running some tests, it seems fine.
>
> You stated your web app context is named "jetspeed", and thus this is
> probably causing your problem.  Since you called it "jetspeed", this is
> the context portion and thus is not part of the relative URI.  Thus, the
> http://localhost:8080/jetspeed/ URL's relative URI truly is "default" or
> "/".
>
> With that context name, the way you will get this to work in your
> configuration is with this URL:
>
> http://localhost:8080/jetspeed/jetspeed/
>
> If you want http://localhost:8080/jetspeed/ to work, then you must set
> the context-root to <context-root>/</context-root> in your
> plan/geronimo-web.xml.
>
> Jeff
>
>
> Jeff Genender wrote:
> > Remove the forward slash and it will give you what you are looking for.
> >
> > Please try this:
> >
> > <servlet-mapping>
> >        <servlet-name>jetspeed</servlet-name>
> >        <url-pattern>jetspeed/*</url-pattern>
> > </servlet-mapping>
> >
> >
> > Jian Liao wrote:
> >> Hi all,
> >> I am running Jetspeed on geronimo-tomcat-j2ee-1.0-2005-12-22. My
> jetspeed
> >> web app context is jetspeed and I also have a servlet named
> "jetspeed"
> >> defined in web.xml. When there is request for url:
> >> http://localhost:8080/jetspeed/. The private method
> getServletName(Request
> >> request) defined in TomcatGeronimoRealm will return a "default" string,
> is
> >> that what it expects?(I know default is configured by tomcat,
> >> http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html)
> >> Why it does not return "jetspeed", I did have a servlet named that. The
> >> following is a snippet from my web.xml.
> >>
> >> <servlet>
> >>     <servlet-name>jetspeed</servlet-name>
> >>     <servlet-class>org.apache.jetspeed.engine.JetspeedServlet
> >> </servlet-class>
> >>     <init-param>
> >>       <param-name>properties</param-name>
> >>       <param-value>/WEB-INF/conf/jetspeed.properties</param-value>
> >>     </init-param>
> >>     <init-param>
> >>       <param-name>applicationRoot</param-name>
> >>       <param-value>webContext</param-value>
> >>     </init-param>
> >>     <load-on-startup>1</load-on-startup>
> >>   </servlet>
> >> ......
> >> <servlet-mapping>
> >>        <servlet-name>jetspeed</servlet-name>
> >>        <url-pattern>/jetspeed/*</url-pattern>
> >> </servlet-mapping>
> >>
> >> Any help would be appreciated!
> >>
> >> - Jian Liao
> >>
> >
>

Re: An issue about TomcatGeronimoRealm

Posted by Jeff Genender <jg...@apache.org>.
Hi Jian,

I am sorry, I had to read your problem closer to get the gist of the
problem...so here is a second go on this:

Upon closer inspection of this...

/jetspeed/* should be picked up fine in the getServletName().  Upon
running some tests, it seems fine.

You stated your web app context is named "jetspeed", and thus this is
probably causing your problem.  Since you called it "jetspeed", this is
the context portion and thus is not part of the relative URI.  Thus, the
http://localhost:8080/jetspeed/ URL's relative URI truly is "default" or
"/".

With that context name, the way you will get this to work in your
configuration is with this URL:

http://localhost:8080/jetspeed/jetspeed/

If you want http://localhost:8080/jetspeed/ to work, then you must set
the context-root to <context-root>/</context-root> in your
plan/geronimo-web.xml.

Jeff


Jeff Genender wrote:
> Remove the forward slash and it will give you what you are looking for.
> 
> Please try this:
> 
> <servlet-mapping>
>        <servlet-name>jetspeed</servlet-name>
>        <url-pattern>jetspeed/*</url-pattern>
> </servlet-mapping>
> 
> 
> Jian Liao wrote:
>> Hi all,
>> I am running Jetspeed on geronimo-tomcat-j2ee-1.0-2005-12-22. My jetspeed
>> web app context is jetspeed and I also have a servlet named   "jetspeed"
>> defined in web.xml. When there is request for url:
>> http://localhost:8080/jetspeed/. The private method getServletName(Request
>> request) defined in TomcatGeronimoRealm will return a "default" string, is
>> that what it expects?(I know default is configured by tomcat,
>> http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html)
>> Why it does not return "jetspeed", I did have a servlet named that. The
>> following is a snippet from my web.xml.
>>
>> <servlet>
>>     <servlet-name>jetspeed</servlet-name>
>>     <servlet-class>org.apache.jetspeed.engine.JetspeedServlet
>> </servlet-class>
>>     <init-param>
>>       <param-name>properties</param-name>
>>       <param-value>/WEB-INF/conf/jetspeed.properties</param-value>
>>     </init-param>
>>     <init-param>
>>       <param-name>applicationRoot</param-name>
>>       <param-value>webContext</param-value>
>>     </init-param>
>>     <load-on-startup>1</load-on-startup>
>>   </servlet>
>> ......
>> <servlet-mapping>
>>        <servlet-name>jetspeed</servlet-name>
>>        <url-pattern>/jetspeed/*</url-pattern>
>> </servlet-mapping>
>>
>> Any help would be appreciated!
>>
>> - Jian Liao
>>
> 

Re: An issue about TomcatGeronimoRealm

Posted by Jeff Genender <jg...@apache.org>.
Remove the forward slash and it will give you what you are looking for.

Please try this:

<servlet-mapping>
       <servlet-name>jetspeed</servlet-name>
       <url-pattern>jetspeed/*</url-pattern>
</servlet-mapping>


Jian Liao wrote:
> Hi all,
> I am running Jetspeed on geronimo-tomcat-j2ee-1.0-2005-12-22. My jetspeed
> web app context is jetspeed and I also have a servlet named   "jetspeed"
> defined in web.xml. When there is request for url:
> http://localhost:8080/jetspeed/. The private method getServletName(Request
> request) defined in TomcatGeronimoRealm will return a "default" string, is
> that what it expects?(I know default is configured by tomcat,
> http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html)
> Why it does not return "jetspeed", I did have a servlet named that. The
> following is a snippet from my web.xml.
> 
> <servlet>
>     <servlet-name>jetspeed</servlet-name>
>     <servlet-class>org.apache.jetspeed.engine.JetspeedServlet
> </servlet-class>
>     <init-param>
>       <param-name>properties</param-name>
>       <param-value>/WEB-INF/conf/jetspeed.properties</param-value>
>     </init-param>
>     <init-param>
>       <param-name>applicationRoot</param-name>
>       <param-value>webContext</param-value>
>     </init-param>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
> ......
> <servlet-mapping>
>        <servlet-name>jetspeed</servlet-name>
>        <url-pattern>/jetspeed/*</url-pattern>
> </servlet-mapping>
> 
> Any help would be appreciated!
> 
> - Jian Liao
> 

Re: An issue about TomcatGeronimoRealm

Posted by Jacek Laskowski <el...@gmail.com>.
2005/12/30, Jian Liao <no...@gmail.com>:
> Hi,
> Thanks for your respond! If the request url is:
> http://localhost:8080/jetspeed/, and getServletName() return "default",
> TomcatGeronimoRealm will use this name and role to construct a
> WebRoleRefPermission instance to be evaluated. Evaluation result is always
> false.

Hi.

How is it with Jetty? Does it work any better?

Just an idea: is there a way to set up the webapp, so that "default"
(which is the return value) would match?

> I think getServletName() should return "jetspeed", and then my configuration
> in web.xml can make JACC  evaluation successfully.

Probably. Would you give it a try and see how it works? You work with
the binary release, don't you? You'd have to pull down the sources (or
just a part of them) and try it out. I can't wait till you respond
it's fixed ;) That'd be awesome.

> - Jian Liao

Jacek

Re: An issue about TomcatGeronimoRealm

Posted by Jian Liao <no...@gmail.com>.
Hi,
Thanks for your respond! If the request url is:
http://localhost:8080/jetspeed/, and getServletName() return "default",
TomcatGeronimoRealm will use this name and role to construct a *
WebRoleRefPermission*<http://java.sun.com/j2ee/1.4/docs/api/javax/security/jacc/WebRoleRefPermission.html>
instance
to be evaluated. Evaluation result is always false.

I think getServletName() should return "jetspeed", and then my configuration
in web.xml can make JACC  evaluation successfully.

- Jian Liao


On 12/30/05, Jacek Laskowski <el...@gmail.com> wrote:
>
> 2005/12/30, Jian Liao <no...@gmail.com>:
> > Hi all,
> > I am running Jetspeed on
> > geronimo-tomcat-j2ee-1.0-2005-12-22. My jetspeed web app
> > context is jetspeed and I also have a servlet named   "jetspeed" defined
> in
> > web.xml. When there is request for url: http://localhost:8080/jetspeed/.
> The
> > private method getServletName(Request request) defined in
> > TomcatGeronimoRealm will return a "default" string, is that what it
> > expects?(I know default is configured by tomcat,
> > http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html)
> > Why it does not return "jetspeed", I did have a servlet named that.
>
> Hi,
>
> I don't know the answer, but has it caused any trouble and that's why
> you asked about it?
>
> > - Jian Liao
>
> Jacek
>

Re: An issue about TomcatGeronimoRealm

Posted by Jacek Laskowski <el...@gmail.com>.
2005/12/30, Jian Liao <no...@gmail.com>:
> Hi all,
> I am running Jetspeed on
> geronimo-tomcat-j2ee-1.0-2005-12-22. My jetspeed web app
> context is jetspeed and I also have a servlet named   "jetspeed" defined in
> web.xml. When there is request for url: http://localhost:8080/jetspeed/. The
> private method getServletName(Request request) defined in
> TomcatGeronimoRealm will return a "default" string, is that what it
> expects?(I know default is configured by tomcat,
> http://tomcat.apache.org/tomcat-5.5-doc/default-servlet.html)
> Why it does not return "jetspeed", I did have a servlet named that.

Hi,

I don't know the answer, but has it caused any trouble and that's why
you asked about it?

> - Jian Liao

Jacek