Last active
February 15, 2020 16:16
-
-
Save mariodavid/e68fa2dd2bcd497cd0febc1076bfee72 to your computer and use it in GitHub Desktop.
CUBA platform portal: activate JSP support
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
<% | |
/* this file is located at %CUBA_APP_ROOT%/portal/web/WEB-INF/pages/index.jsp */ | |
%> | |
<html> | |
<head><title>First JSP</title></head> | |
<body> | |
<% | |
double num = Math.random(); | |
if (num > 0.95) { | |
%> | |
<h2>You'll have a luck day!</h2><p>(<%= num %>)</p> | |
<% | |
} else { | |
%> | |
<h2>Well, life goes on ... </h2><p>(<%= num %>)</p> | |
<% | |
} | |
%> | |
<a href="<%= request.getRequestURI() %>"><h3>Try Again</h3></a> | |
</body> | |
</html> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xmlns:mvc="http://www.springframework.org/schema/mvc" | |
xmlns:p="http://www.springframework.org/schema/p" | |
xsi:schemaLocation=" | |
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd | |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd | |
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd"> | |
<mvc:annotation-driven/> | |
<mvc:view-controller path="/error/404"/> | |
<mvc:view-controller path="/error/500"/> | |
<mvc:view-controller path="/maintain"/> | |
<context:component-scan base-package="uk.co.wealthclub.clover.portal.controllers"/> | |
<context:component-scan base-package="com.haulmont.cuba.restapi"/> | |
<!-- Static resources --> | |
<!--suppress SpringModelInspection --> | |
<mvc:resources mapping="/resources/**" location="/resources/" cache-period="0"/> | |
<!-- Default exception handlers from CUBA --> | |
<bean class="com.haulmont.cuba.portal.sys.exceptions.PortalExceptionResolver"> | |
<property name="noUserSessionUrl" value="/login"/> | |
<property name="noMiddlewareConnectionUrl" value="/maintain"/> | |
</bean> | |
<!-- change the view resolver to look for jsp files in /WEB-INF/pages/ --> | |
<!-- see http://www.mkyong.com/spring-mvc/spring-mvc-internalresourceviewresolver-example/ for more information --> | |
<bean id="viewResolver" | |
class="org.springframework.web.servlet.view.InternalResourceViewResolver" > | |
<property name="prefix"> | |
<value>/WEB-INF/pages/</value> | |
</property> | |
<property name="suffix"> | |
<value>.jsp</value> | |
</property> | |
</bean> | |
</beans> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, Do you think this will still work with platform version 7.1?