* $
*/
public class SelectAction extends AbstractSelectAction {
// ------------------------------------------------------- Protected Methods
protected String getPath(ActionContext context) {
ServletActionContext saContext = (ServletActionContext) context;
HttpServletRequest request = saContext.getRequest();
String path = null;
boolean extension = false;
// For prefix matching, match on the path info
path = (String) request.getAttribute(Constants.INCLUDE_PATH_INFO);
if ((path == null) || (path.length() == 0)) {
path = request.getPathInfo();
}
// For extension matching, match on the servlet path
if ((path == null) || (path.length() == 0)) {
path =
(String) request.getAttribute(Constants.INCLUDE_SERVLET_PATH);
if ((path == null) || (path.length() == 0)) {
path = request.getServletPath();
}
if ((path == null) || (path.length() == 0)) {
throw new IllegalArgumentException(
"No path information in request");
}
extension = true;
}
// Strip the module prefix and extension (if any)
ModuleConfig moduleConfig = saContext.getModuleConfig();
String prefix = moduleConfig.getPrefix();
if (!path.startsWith(prefix)) {
throw new IllegalArgumentException("Path does not start with '"
+ prefix + "'");