How to import constants on a JSP page

Are there any more efficient ways to use constants in JSP than:

<%@ page import="static package.Interface.NAME"%> 

Is there a drawback to using these (outside the mixing / content code)?

Thanks!

+7
java jsp jspinclude
source share
1 answer

Yes there is.

Create a bean using getters that set constants and set to HttpRequest in <filter> .

Then you can use JSTL to jump to these constants.

You have nailed the lack of an initial approach.

+2
source share

All Articles