I assume you want to get the to the page URL params within Java code and you are overriding one of the executeImpl() methods in a sub-class?
You probably shouldn't cast the webscript request to LocalWebScriptRequest as that assumes a lot...
You have a couple of options though, the "clean" way is to "bind" in the url params into the component webscript url, then the params will be automatically made available to the "args" map in the model for your webscript. So in your webscript descriptor, you do something like this:
Code:
<webscript>
<shortname>Search Results List</shortname>
<description>Search: Results List Component</description>
<url>/components/search/search?myparam={foo}</url>
</webscript>
Note the {foo} token - this indicates to the Surf WebScript runtime that it should look for a page URL param called "foo" and if found, template the value into the URL for the webscript component. This means the component does not have to "know" it is running as a Surf local component and can use "args" map just as it would if it was called directly via a URL. This also means you can access those URL params in JavaScript via the "args" map, without having to walk the page.url.args structure.
If you *don't* know the name of the param and so can't bind it onto the WebScript component URL or you don't want to do it this way, then you can access the current RequestContext via the ThreadLocal accessor:
Code:
RequestContext context = ThreadLocalRequestContext.getRequestContext();
You can then call:
Code:
context.getParameter(key);
or
Code:
context.getParameters();
to retrieve any page URL params.
Hope this helps,
Kev