Hum... I should have a closer look at IDEA then :-) Jérôme.
Cameron Braid wrote:
What IDE do you use ?
Eclispe can automatically create delegator calls for you, which makes tasks like that a piece of cake.
Cam
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jerome BERNARD
Sent: Monday, 29 September 2003 7:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [OS-webwork] Advanced URL mapping?
Cameron Braid wrote:
Cool idea :)to use the
Though, for the implementaion, wouldn't you have been better
wrapper pattern, rather than dynamic proxies :)Sure. I thought about it, but it's quite painful: you have to override so many methods :-(
I'll do it tomorrow and update the attachment in the JIRA issue.
Jérôme.
CamStringTokenizer(request.getPathInfo(), "/");
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jérôme BERNARD
Sent: Tuesday, 30 September 2003 1:30 AM
To: [EMAIL PROTECTED]
Subject: RE: [OS-webwork] Advanced URL mapping?
I have created a new issue in JIRA (http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-326
) and submitted a new servlet that extends ServletDispatcher
and provides such a functionality. I also provided a way to shorten even more the URL by assuming that if the first parameter name is not specified then it is supposed to be the name of the action.
This allows to replace the following URL http://myhost.com/article/article/123 with this URL http://myhost.com/article/123.
Any code review welcomed! :-p
Jérôme.
Robert Douglass <[EMAIL PROTECTED]>:
I think this is the relevant code, fromunderstand
org.apache.turbine.util.parser.DefaultParameterParser. As I
it, Turbine folks avoid URLs like foo/bar?id=1812 in favor ofright off
foo/bar/id/1812. I've never used this, and I can't remember
exactly how the servlet container knows which part is thepath info,
but essentially, they assume that the path info follows the patternapplications. This
name_1/value_1/...name_n/value_n. The advantage is supposed to be search-engine friendly URLs from completely dynamic
gets touted by the Turbine community as a great feature (and it maybelow, it is
be). I'd love to have this available, but as you can see
easy enough to implement that anyone can do it as soon as they wantsomeone else do
it. I don't really need it at the moment, so I'll let
it.
-Robert
// Also cache any pathinfo variables that are passed around as
// if they are query string data.
try
{
StringTokenizer st =
new
boolean isNameTok = true;java.net.URLDecoder.decode(st.nextToken());
String pathPart = null;
while (st.hasMoreTokens())
{
if (isNameTok)
{
tmp =
isNameTok = false;java.net.URLDecoder.decode(st.nextToken());
}
else
{
pathPart =
if (tmp.length() > 0)this add
{
add(convert(tmp), pathPart); //R.D.
must always bethe params to their internal param implementation, see below* } isNameTok = true; } } } catch (Exception e) { // If anything goes wrong above, don't worry about it. // Chances are that the path info was wrong anyways and // things that depend on it being right will fail later // and should be caught later. }
* from super-class BaseValueParser
/**
* Random access storage for parameter data. The keys
Behalf Of* Strings. The values will be arrays of Strings. */ private Map parameters = new HashMap();
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Jerome BERNARD Sent: Sunday, September 28, 2003 9:51 PM To: [EMAIL PROTECTED] Subject: Re: [OS-webwork] Advanced URL mapping?
Could you give some insights about the way Turbine handle URLs? Any pointers?
Jérôme.
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork