You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Matt Raible <li...@raibledesigns.com> on 2004/11/23 15:56:17 UTC

Friendly URLs don't seem to work for me

I've obtained the Friendly URLs patch and integrated it into my 
project.  I'm using SiteMesh for decoration and JSPs to handle 
form-based authentication.  That all works and I doubt they're causing 
issues with Tapestry.

On my index.jsp, the user is forwarded to mainMenu.html.  I have *.html 
protected, so the user is prompted to login.  After logging in, they're 
taken to mainMenu.html, which is configured with:

<page name="Home" specification-path="pages/mainMenu.page"/>

This page has Tapestry components in it and seems to work fine.  
However, I don't know if mainMenu.html is resolving to "Home" - or its 
just being sent there since "Home" is the default location.  This is 
before I override the "extractServiceName" method in my BaseEngine 
class.  Instructions for this are on the wiki at 
http://wiki.apache.org/jakarta-tapestry/FriendlyUrls#head-f77e051ff2302a8588245c11c593fa38509d3797.

When I do this, I get the following exception:

java.lang.NullPointerException
Stack Trace:

    * 
org.apache.tapestry.engine.AbstractService.getServiceContext(AbstractService.java:92)
    * org.apache.tapestry.engine.PageService.service(PageService.java:58)
    * 
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:872)
    * 
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197)
    * 
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
    * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    * javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    * 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    * 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    * 
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
    * 
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
    * 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    * 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

Also, the friendly URLs path calls for setting a "page" and "service" 
url-suffix.  Is it possible to just set one, or use .html for both?  Do 
I have to use different extensions?

Thanks,

Matt




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Friendly URLs don't seem to work for me

Posted by Paul Ferraro <pm...@columbia.edu>.
Technically speaking, there's nothing preventing you from doing so - so 
long as you don't have any service/page name collisions.  The purpose of 
separate file extensions is to enable a service and a page to share the 
same name while keeping them distinguishable.

Paul

Matt Raible wrote:

> Nevermind, I forgot to override all the services - works great now.  
> I'm still curious to know if I need two extensions or if one will 
> suffice (see question at bottom of this message).
>
> Thanks,
>
> Matt
>
> Matt Raible wrote:
>
>> I've obtained the Friendly URLs patch and integrated it into my 
>> project.  I'm using SiteMesh for decoration and JSPs to handle 
>> form-based authentication.  That all works and I doubt they're 
>> causing issues with Tapestry.
>>
>> On my index.jsp, the user is forwarded to mainMenu.html.  I have 
>> *.html protected, so the user is prompted to login.  After logging 
>> in, they're taken to mainMenu.html, which is configured with:
>>
>> <page name="Home" specification-path="pages/mainMenu.page"/>
>>
>> This page has Tapestry components in it and seems to work fine.  
>> However, I don't know if mainMenu.html is resolving to "Home" - or 
>> its just being sent there since "Home" is the default location.  This 
>> is before I override the "extractServiceName" method in my BaseEngine 
>> class.  Instructions for this are on the wiki at 
>> http://wiki.apache.org/jakarta-tapestry/FriendlyUrls#head-f77e051ff2302a8588245c11c593fa38509d3797. 
>>
>>
>> When I do this, I get the following exception:
>>
>> java.lang.NullPointerException
>> Stack Trace:
>>
>>    * 
>> org.apache.tapestry.engine.AbstractService.getServiceContext(AbstractService.java:92) 
>>
>>    * org.apache.tapestry.engine.PageService.service(PageService.java:58)
>>    * 
>> org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:872) 
>>
>>    * 
>> org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197) 
>>
>>    * 
>> org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158) 
>>
>>    * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>    * javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>    * 
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 
>>
>>    * 
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
>>
>>    * 
>> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) 
>>
>>    * 
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) 
>>
>>    * 
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) 
>>
>>    * 
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
>>
>>
>> Also, the friendly URLs path calls for setting a "page" and "service" 
>> url-suffix.  Is it possible to just set one, or use .html for both?  
>> Do I have to use different extensions?
>>
>> Thanks,
>>
>> Matt
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Friendly URLs don't seem to work for me

Posted by Matt Raible <li...@raibledesigns.com>.
Nevermind, I forgot to override all the services - works great now.  I'm 
still curious to know if I need two extensions or if one will suffice 
(see question at bottom of this message).

Thanks,

Matt

Matt Raible wrote:

> I've obtained the Friendly URLs patch and integrated it into my 
> project.  I'm using SiteMesh for decoration and JSPs to handle 
> form-based authentication.  That all works and I doubt they're causing 
> issues with Tapestry.
>
> On my index.jsp, the user is forwarded to mainMenu.html.  I have 
> *.html protected, so the user is prompted to login.  After logging in, 
> they're taken to mainMenu.html, which is configured with:
>
> <page name="Home" specification-path="pages/mainMenu.page"/>
>
> This page has Tapestry components in it and seems to work fine.  
> However, I don't know if mainMenu.html is resolving to "Home" - or its 
> just being sent there since "Home" is the default location.  This is 
> before I override the "extractServiceName" method in my BaseEngine 
> class.  Instructions for this are on the wiki at 
> http://wiki.apache.org/jakarta-tapestry/FriendlyUrls#head-f77e051ff2302a8588245c11c593fa38509d3797. 
>
>
> When I do this, I get the following exception:
>
> java.lang.NullPointerException
> Stack Trace:
>
>    * 
> org.apache.tapestry.engine.AbstractService.getServiceContext(AbstractService.java:92) 
>
>    * org.apache.tapestry.engine.PageService.service(PageService.java:58)
>    * 
> org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:872) 
>
>    * 
> org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197) 
>
>    * 
> org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
>    * javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>    * javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>    * 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) 
>
>    * 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
>
>    * 
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) 
>
>    * 
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) 
>
>    * 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) 
>
>    * 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) 
>
>
> Also, the friendly URLs path calls for setting a "page" and "service" 
> url-suffix.  Is it possible to just set one, or use .html for both?  
> Do I have to use different extensions?
>
> Thanks,
>
> Matt
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org