You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2005/03/17 07:48:11 UTC

Specifying .script/.page location in classpath?

Hello there.

I'm the one who prefers keeping my .jwc, .page, .script files as a
resources, for sake of keeping them beside their .java files, but it comes
with cost of specifying their location in .application. I'm OK with that,
but it's just that it seems a bit akward that specified location has to
start with :
/WEB-INF/classes/
as for example :
/WEB-INF/classes/my/company/myapp/pages/Home.page

Is there some way just to specify
my/company/myapp/pages/Home.page ?

Same thing with locating .script file when using Script component. As a
matter of fact, description of  "script" parameter inside Script component
says :
"The path of a resource (on the classpath) containing the script" which is
simply not true because I tried passing values such as :
my/company/myapp/pages/MyScript.script or
/my/company/myapp/pages/MyScript.script
and none works, until I try with:
/WEB-INF/classes/my/company/myapp/pages/MyScript.script

Is there some way to avoid this WEB-INF/classes ?

Regards,
Vjeran



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15.3.2005


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


Re: Specifying .script/.page location in classpath?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
An alternative is to create a custom ISpecificationSource and hook it 
into a custom engine implementation.

	Erik


On Mar 17, 2005, at 1:48 AM, Vjeran Marcinko wrote:

> Hello there.
>
> I'm the one who prefers keeping my .jwc, .page, .script files as a
> resources, for sake of keeping them beside their .java files, but it 
> comes
> with cost of specifying their location in .application. I'm OK with 
> that,
> but it's just that it seems a bit akward that specified location has to
> start with :
> /WEB-INF/classes/
> as for example :
> /WEB-INF/classes/my/company/myapp/pages/Home.page
>
> Is there some way just to specify
> my/company/myapp/pages/Home.page ?
>
> Same thing with locating .script file when using Script component. As a
> matter of fact, description of  "script" parameter inside Script 
> component
> says :
> "The path of a resource (on the classpath) containing the script" 
> which is
> simply not true because I tried passing values such as :
> my/company/myapp/pages/MyScript.script or
> /my/company/myapp/pages/MyScript.script
> and none works, until I try with:
> /WEB-INF/classes/my/company/myapp/pages/MyScript.script
>
> Is there some way to avoid this WEB-INF/classes ?
>
> Regards,
> Vjeran
>
>
>
> -- 
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15.3.2005
>
>
> ---------------------------------------------------------------------
> 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: I want friendlier URLs than FriendlyUrls

Posted by Howard Lewis Ship <hl...@gmail.com>.
A servlet filter allows us to do an end-run around the limitations of
the web.xml <url-pattern> element, which is amazingly stupid.

ServiceEncoders, the mechanism behind friendly URLs, are supposed to
be bi-directional ... that which is encoded can be decoded.

Augmenting a service encoder with servlet filter would be very powerful.

The encoder could encode:

app?service=direct&page=Foo&component=bar&sp=3&sp=Sabc

Into

/direct/Foo/bar/sp/3/sp/Sabc

This would be mapped to the /direct/* URL.  The ServiceEncoder would
have to use the path info to identify the page, component, and sp
query parameters.

The options are endless.  The fly in the ointment is that page names
("Foo") can contain slashes.  I might try a mapping like:

/direct/Foo.bar/sp/3/sp/Sabc

The dot character is not allowed as part of a component id or page
name, so its a clear seperator.

You do get to a situation where to achieve the shortests, barest URLs
you need to do a bit of configuration in web.xml and in hivemodule.xml
... the best part is that this is "polish" that can be added late in a
project cycle!


On Thu, 17 Mar 2005 06:12:50 -0500, Erik Hatcher
<er...@ehatchersolutions.com> wrote:
> For the ten millionth time.... YES!  Use a servlet filter :)
> 
> I've just started incorporating Tapestry 3.1 alpha into a new project
> and have been digging around under the covers - I haven't tried this in
> 3.1 yet, but it seems possible to control URL's very precisely with
> custom hooks via HiveMind configuration.  Howard, could you detail how
> this can be done in 3.1 a bit?
> 
>         Erik
> 
> 
> On Mar 17, 2005, at 2:53 AM, Cin Peng wrote:
> 
> >
> > Tapestry patch for friendly URLs here:
> > http://wiki.apache.org/jakarta-tapestry/FriendlyUrls is not friendly
> > enough..
> >
> > I want to map something like....
> >
> > http://localhost/app?service=direct/1/mydetail/$DirectLink&sp=Sabc
> >
> > to something like...
> >
> > http://localhost/service/direct/1/mydetail/directLink/Sabc
> >
> > instead of..
> >
> > http://localhost/path/mydetail.htm?
> > service=direct&service=1&service=$DirectLink&sp=Sabc
> >
> > my aim is to eliminate all query parameters altogether (so google
> > think it as directories instead of parameters).
> >
> > Has anyone done this? If not, can it even be done?
> >
> > ---------------------------------------------------------------------
> > 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
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: I want friendlier URLs than FriendlyUrls

Posted by Cin Peng <ro...@onepixel.com.my>.
I didn't mean Tapestry 3.1... but I got several ideas now... I think I know 
how to mimic super-friendly URL in 3.02.

I will try my theory and will post here the result. It seems trivial enough, 
I wonder I didn't think of it earlier.


----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, March 17, 2005 7:12 PM
Subject: Re: I want friendlier URLs than FriendlyUrls


> For the ten millionth time.... YES!  Use a servlet filter :)
>
> I've just started incorporating Tapestry 3.1 alpha into a new project  and 
> have been digging around under the covers - I haven't tried this in  3.1 
> yet, but it seems possible to control URL's very precisely with  custom 
> hooks via HiveMind configuration.  Howard, could you detail how  this can 
> be done in 3.1 a bit?
>
> Erik
>
>
> On Mar 17, 2005, at 2:53 AM, Cin Peng wrote:
>
>>
>> Tapestry patch for friendly URLs here: 
>> http://wiki.apache.org/jakarta-tapestry/FriendlyUrls is not friendly 
>> enough..
>>
>> I want to map something like....
>>
>> http://localhost/app?service=direct/1/mydetail/$DirectLink&sp=Sabc
>>
>> to something like...
>>
>> http://localhost/service/direct/1/mydetail/directLink/Sabc
>>
>> instead of..
>>
>> http://localhost/path/mydetail.htm? 
>> service=direct&service=1&service=$DirectLink&sp=Sabc
>>
>> my aim is to eliminate all query parameters altogether (so google  think 
>> it as directories instead of parameters).
>>
>> Has anyone done this? If not, can it even be done?
>>
>> ---------------------------------------------------------------------
>> 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: I want friendlier URLs than FriendlyUrls

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
For the ten millionth time.... YES!  Use a servlet filter :)

I've just started incorporating Tapestry 3.1 alpha into a new project  
and have been digging around under the covers - I haven't tried this in  
3.1 yet, but it seems possible to control URL's very precisely with  
custom hooks via HiveMind configuration.  Howard, could you detail how  
this can be done in 3.1 a bit?

	Erik


On Mar 17, 2005, at 2:53 AM, Cin Peng wrote:

>
> Tapestry patch for friendly URLs here:  
> http://wiki.apache.org/jakarta-tapestry/FriendlyUrls is not friendly  
> enough..
>
> I want to map something like....
>
> http://localhost/app?service=direct/1/mydetail/$DirectLink&sp=Sabc
>
> to something like...
>
> http://localhost/service/direct/1/mydetail/directLink/Sabc
>
> instead of..
>
> http://localhost/path/mydetail.htm? 
> service=direct&service=1&service=$DirectLink&sp=Sabc
>
> my aim is to eliminate all query parameters altogether (so google  
> think it as directories instead of parameters).
>
> Has anyone done this? If not, can it even be done?
>
> ---------------------------------------------------------------------
> 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


I want friendlier URLs than FriendlyUrls

Posted by Cin Peng <ro...@onepixel.com.my>.
Tapestry patch for friendly URLs here: 
http://wiki.apache.org/jakarta-tapestry/FriendlyUrls is not friendly 
enough..

I want to map something like....

http://localhost/app?service=direct/1/mydetail/$DirectLink&sp=Sabc

to something like...

http://localhost/service/direct/1/mydetail/directLink/Sabc

instead of..

http://localhost/path/mydetail.htm?service=direct&service=1&service=$DirectLink&sp=Sabc

my aim is to eliminate all query parameters altogether (so google think it 
as directories instead of parameters).

Has anyone done this? If not, can it even be done? 


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