This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/appserver/pom.xml b/appserver/pom.xml | |
index 1e49f3a9d..75a4d3914 100644 | |
--- a/appserver/pom.xml | |
+++ b/appserver/pom.xml | |
@@ -161,6 +161,10 @@ | |
<weld.version>4.0.1.SP1</weld.version> | |
<jboss.classfilewriter.version>1.2.4.Final</jboss.classfilewriter.version> | |
+ <!-- Jakarta MVC --> | |
+ <mvc-api.version>2.0.0</mvc-api.version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebFilter(urlPatterns = "/*") | |
public class RelativeRedirectsFilter implements Filter { | |
@Override | |
public void doFilter( ServletRequest request, ServletResponse response, FilterChain chain ) | |
throws IOException, ServletException { | |
chain.doFilter( request, new RelativeRedirectResponse( (HttpServletResponse) response ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebFilter("/*") | |
public class NoopServletFilter implements Filter { | |
@Override | |
public void init(FilterConfig filterConfig) throws ServletException { | |
// empty | |
} | |
@Override | |
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@Path("/simple") | |
public class SimpleController { | |
@GET | |
public String get() { | |
return "simple.jsp"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserClientIpActivationStrategy implements ActivationStrategy { | |
private final ActivationStrategy userStrategy = new UsernameActivationStrategy(); | |
private final ActivationStrategy ipStrategy = new ClientIpActivationStrategy(); | |
@Override | |
public String getId() { | |
return "user-ip"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// some interface | |
public interface Plugin { | |
// ... | |
} | |
// standard bean | |
public class FirstPlugin implements Plugin { | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@WebServlet(urlPatterns = "/FeatureServlet") | |
public class FeatureServlet extends HttpServlet { | |
private static final long serialVersionUID = 1L; | |
@Override | |
protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { | |
Feature feature = new NamedFeature( req.getParameter( "feature" ) ); | |
boolean enabled = "on".equals( req.getParameter( "state" ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MultiEnumFeatureProvider implements FeatureProvider { | |
private final Set<Feature> features = new LinkedHashSet<>(); | |
public MultiEnumFeatureProvider( Class<? extends Feature>... enumTypes ) { | |
for( Class<? extends Feature> clazz : enumTypes ) { | |
for( Feature feature : clazz.getEnumConstants() ) { | |
features.add( feature ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Message implements Serializable { | |
private static final long serialVersionUID = 2518143831776562527L; | |
public enum Severity { | |
INFO, | |
WARN, | |
ERROR | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implementation of the Management interface | |
*/ | |
public class TogglzManagement implements TogglzManagementMBean { | |
@Override | |
public void toggle(String featureName, boolean enabled) { | |
// as we only know the name, wrap it into an UntypedFature | |
UntypedFeature feature = new UntypedFeature(featureName); |
NewerOlder