Hello All,
I am trying to create a screen "CheckAccess" with the event. But, when I
fire the request I get blank screen. and if I remove <event> from the
controller.xml screen,it works. I have jar class-path in ofbiz-component.xml
My event is
------------------------------------------------------------------------------------------------------
public static String CheckAccess(HttpServletRequest
request,HttpServletResponse response){
Security security = (Security)request.getAttribute("security");
String key = "_EVENT_MESSAGE_";
if (security.hasPermission("LEARN_VIEW", request.getSession()))
{
request.setAttribute(key, "You have access!");
}
else {
request.setAttribute(key, "You DO NOT have access! You are
denied!");
}
return "success";
}
------------------------------------------------------------------------------------------------------
Controller.xml
------------------------------------------------------------------------------------------------------
<request-map uri="CheckAccess">
<security auth="true"/>
<event type="java"
path="org.ofbiz.learning.learning.LearningEvents" invoke="CheckAccess "/>
<response name="success" type="view" value="CheckAccess"/>
</request-map>
<view-map name="CheckAccess" type="screen"
page="component://learning/widget/learning/LearningScreens.xml#CheckAccess"/>
------------------------------------------------------------------------------------------------------
Screen is
------------------------------------------------------------------------------------------------------
<screen name="CheckAccess">
<section>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="title">
<label text="Checking Access via Event BeanShell"/>
</decorator-section>
<decorator-section name="body">
<label text="This is the good screen."/> <!-- text
for testing without event in controller.xml-->
<label text="${eventMessageList[0]}"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
------------------------------------------------------------------------------------------------------
I would really appreciate the help.
Thank you in advance.
--
View this message in context:
http://www.nabble.com/blank-screen-while-calling-event-tp25047243p25047243.html
Sent from the OFBiz - User mailing list archive at Nabble.com.