Skrivit dokumentation
git-svn-id: svn://svn.dsv.su.se/scipro/scipro/trunk@541 73ecded7-942e-4092-bab0-0e58ef0ee984
This commit is contained in:
parent
e1ae365d77
commit
61c5e89840
src/main
java/se/su/dsv/scipro/exceptions
webapp/WEB-INF
@ -3,13 +3,19 @@ package se.su.dsv.scipro.exceptions;
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.authorization.UnauthorizedInstantiationException;
|
||||
|
||||
/**
|
||||
* Throwing this exception somewhere will result in a redirect to the
|
||||
* AccessDeniedPage
|
||||
*
|
||||
* @author Dan Kjellman <dan-kjel@dsv.su.se>
|
||||
*
|
||||
*/
|
||||
public class AccessDeniedException extends UnauthorizedInstantiationException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public AccessDeniedException(final Component comp){
|
||||
super(comp.getClass());
|
||||
System.out.println("Access denied to page "+ comp.getClass().getCanonicalName());
|
||||
//TODO: Possibly log exception...
|
||||
super(comp.getClass());
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,25 @@
|
||||
package se.su.dsv.scipro.exceptions;
|
||||
|
||||
import org.apache.wicket.Page;
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.RestartResponseAtInterceptPageException;
|
||||
import org.apache.wicket.WicketRuntimeException;
|
||||
|
||||
import se.su.dsv.scipro.basepages.errorpages.NotFoundPage;
|
||||
|
||||
/**
|
||||
* By throwing this exception in a wicket component the request will be aborted
|
||||
* and a redirect to NotFoundPage will occur immediately.
|
||||
*
|
||||
* @author Dan Kjellman <dan-kjel@dsv.su.se>
|
||||
*
|
||||
*/
|
||||
public class PageNotFoundException extends WicketRuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public PageNotFoundException(final Page page){
|
||||
throw new RestartResponseAtInterceptPageException(NotFoundPage.class);
|
||||
public PageNotFoundException(final Component comp){
|
||||
//TODO: Possibly log something...
|
||||
throw new RestartResponseAtInterceptPageException(NotFoundPage.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,10 +28,13 @@
|
||||
<filter-mapping>
|
||||
<filter-name>wicket.WicketWarp</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
|
||||
<!-- These to be able to enable a non-standard not found page -->
|
||||
<dispatcher>REQUEST</dispatcher>
|
||||
<dispatcher>ERROR</dispatcher>
|
||||
</filter-mapping>
|
||||
|
||||
<!-- Map 404 errors to a mounted location -->
|
||||
<error-page>
|
||||
<error-code>404</error-code>
|
||||
<location>/404</location>
|
||||
|
Loading…
x
Reference in New Issue
Block a user