| java.lang.Object net.jforum.UrlPattern
UrlPattern | public class UrlPattern (Code) | | URL Patterns keeper.
Represents a single URL pattern. Each pattern is composed
by a name, the pattern itself, the pattern's size and the
splited variables.
The pattern is expected in the form var1, var2, varN, in the
correct order. This means that if var1 comes first, it must
come first in the URL. The same is valid to others.
Please note that "first" here is "first" after regular URL, which is
composed by server and servlet name, in the most simple case.
Example:
URL: http://localhost:8080/webappName/someDir/myServlet/news/view/3.page.
In this case, http://localhost:8080/webappName/someDir/myServlet/ is the
regular URL, the part that we don't care about. We only want the part
news/view/3.page ( where .page is the servlet extension ).
For this URL, we could make the following pattern:
news.view.1 = news_id
Here, news.view.1 is the pattern's name, and news_id is
the patterns itself.
Another example:
news.view.2 = page, news_id
In this case we have a new var called page, that represents the page being seen.
Each entry is composed in the form:
<moduleName>.<actionName>.<numberOfParameters> = <var 1>,<var n>
Please note that module and action's name aren't pattern's composition, so
don't put them there. The system will consider that the pattern only contains
the variables diferent to each request ( e.g, id's ). If the pattern you're
constructing doesn't have any variable, just leave it blank, like
myModule.myAction.0 =
author: Rafael Steil version: $Id: UrlPattern.java,v 1.1 2006/08/23 02:13:49 rafaelsteil Exp $ |
Method Summary | |
public String | getName() | public int | getSize() | public String[] | getVars() Gets the vars.
The URL variables are in the correct order, which means
that the first position always will be "something1", the
second "something2" and so on. |
getName | public String getName()(Code) | | Gets the pattern name
String with the pattern name |
getSize | public int getSize()(Code) | | Get pattern's total vars
The total |
getVars | public String[] getVars()(Code) | | Gets the vars.
The URL variables are in the correct order, which means
that the first position always will be "something1", the
second "something2" and so on. The system expects this
order never changes from requisition to requisition.
The vars |
|
|