1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"><head> 4 <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" /> 5 <title>Manipulating Paths</title> 6 <link href="styles.css" rel="stylesheet" type="text/css" /></head> 7 <body> 8 <h1>Manipulating Paths</h1><p>Whilst path values are useful in telling 9 us something about where a particular resource resides or how far the 10 processing of a resource has progressed, it is sometimes useful to 11 apply some kind of transformation to the path in order to produce a 12 reference to another resource or application. Consider the simple case 13 of <a href="redirection.html">redirecting</a> a user to another resource:</p><p>First we must obtain a reference to the current resource:<br /></p><pre>this_resource = trans.get_path_without_query() # eg. "/app/resource/some-data"</pre><p>We may wish to redirect the user to the main application resource; this is done by removing <code>resource</code> from the end of the path:</p><pre>this_app = trans.update_path("..") # produces "/app/resource"</pre><p>A complete description of this method can be found in the <a href="../apidocs/public/WebStack.Generic.Transaction-class.html#update_path">API documentation</a>.</p></body></html>