Where in the Spring-MVC / JSP application should you store things that should be accessible to both controllers and views, such as environment-specific base_url, application identifiers that will be used in javascript, etc.?
I tried to create a scoped bean application and then <jsp:useBean> at the top of my JSPs, but this does not seem to work.
<bean id="myEnv" class="com.myapp.MyAppEnvironment" scope="application"> <property name="baseUrl" value="http://localhost:8080/myapp/"/> <property name="videoPlayerId" value="234346565"/> </bean>
And using it as follows
<jsp:useBean id="myEnv" scope="application" type="com.myapp.MyAppEnvironment"/>
java spring spring-mvc jsp
walnutmon
source share