|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.zentense.step2.util.Location
public class Location
This class manipulates URL locations: you can forward to a new location,
or just go back, save a URL and restore it afterwards, or cypher URLs.
The global variable url is initialized when a new session begins
with a new instance of Location.
This class also stores a stack of visited URL locations in this session.
Each request is saved except if the request parameter 'forward' is present.
| Nested Class Summary | |
|---|---|
class |
Location.URL
|
| Constructor Summary | |
|---|---|
Location()
Empty constructor |
|
Location(RequestRuntime vm)
Constructs the location and saves current page |
|
| Method Summary | |
|---|---|
void |
back()
Goes to previous URL (goes back!) |
void |
back(int seq)
Goes to previous URL (goes back!) |
java.lang.String |
cypher(RequestRuntime vm,
java.lang.String url)
Cyphers a URL |
java.lang.String |
decypher(java.lang.String url)
Decyphers a URL |
static void |
forward(java.lang.String url)
Forwards to another page in this session |
static void |
forwardExternal(RequestRuntime vm,
java.lang.String url)
Forwards to a URL outside this session. |
java.lang.String |
getBackURL()
Gets previous URL (the one you would go if you would click on back button). |
java.lang.String |
getCheckpointURL()
Gets checkpoint URL (URL that was saved with save method) |
java.lang.String |
getCurrentURL()
Gets the 'current' URL. |
java.lang.String |
getHREF(java.lang.String name)
|
int |
getSequence()
Gets current sequence number |
Location.URL |
getURL(HttpServletRequest req)
|
void |
initCypher(HttpServletRequest req)
Creates private key for cyphering URLs |
java.lang.String |
popRequest()
Removes last request from the location stack |
void |
pushRequest(HttpServletRequest req)
Used internayly by 2step: pushes a request into the location stack |
void |
refresh()
Refreshes current URL |
void |
refresh(int seq)
Reloads a URL |
void |
restore()
Restores a previously saved location |
void |
save(HttpServletRequest req)
Saves current url, so it could be restored with restore in the future |
void |
save(HttpServletRequest req,
java.lang.String params)
Saves current url, so it could be restored with restore. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Location()
public Location(RequestRuntime vm)
req - Servlet request whose parameters will be saved| Method Detail |
|---|
public final java.lang.String getCurrentURL()
public final java.lang.String getBackURL()
public final java.lang.String getCheckpointURL()
public final void save(HttpServletRequest req,
java.lang.String params)
req - Servlet request whose parameters will be savedparams - Extra params to be appended to the URLpublic final void save(HttpServletRequest req)
req - Servlet request whose parameters will be savedpublic final Location.URL getURL(HttpServletRequest req)
public final void pushRequest(HttpServletRequest req)
req - Request to be pushedpublic final java.lang.String popRequest()
public final void restore()
throws java.lang.Exception
vm - A RequestRuntime instance
java.lang.Exception - If forward fails
public final void refresh()
throws java.lang.Exception
vm - A RequestRuntime instance
java.lang.Exception - If forward fails
public final void refresh(int seq)
throws java.lang.Exception
vm - A RequestRuntime instanceseq - Sequence number of URL to be refreshed
java.lang.Exception - If forward fails
public final void back()
throws java.lang.Exception
vm - A RequestRuntime instance
java.lang.Exception - If forward fails
public final void back(int seq)
throws java.lang.Exception
vm - A RequestRuntime instanceseq - Sequence number of URL from where go back
java.lang.Exception - If forward fails
public static final void forward(java.lang.String url)
throws java.lang.Exception
vm - A RequestRuntime instanceurl - URL where to go to
java.lang.Exception - If forward fails
public static final void forwardExternal(RequestRuntime vm,
java.lang.String url)
throws java.lang.Exception
vm - A RequestRuntime instanceurl - URL where to go to
java.lang.Exception - If forward failspublic final int getSequence()
public final void initCypher(HttpServletRequest req)
req - servlet request
public final java.lang.String cypher(RequestRuntime vm,
java.lang.String url)
vm - A RequestRuntime instanceurl - URL to cypher
public final java.lang.String decypher(java.lang.String url)
url - Cyphered URL
public final java.lang.String getHREF(java.lang.String name)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||