You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by su2 <sh...@pexsupply.com> on 2009/08/19 18:13:00 UTC
blank screen while calling event
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.
RE: blank screen while calling event
Posted by su2 <sh...@pexsupply.com>.
Hi Charles,
Yeah, thats typo in my post, but in my actual code there is no such blank
space in the <event>
Thanks.
Shuchi-
Charles TJ wrote:
>
>
> Hi Shuchi,
>
> Sorry, it is not in the request-map, but in your <event>
> ....invoke="CheckAccess "/>
> "CheckAccess_" (_ a blank space)
>
> Did you see that?
>
>
> - Charles TJ
>
>
> =============
>
>
> -----Original Message-----
> From: su2 [mailto:shuchi@pexsupply.com]
> Sent: 19 Agustus 2009 23:46
> To: user@ofbiz.apache.org
> Subject: RE: blank screen while calling event
>
>
>
> Sorry Thats the typo at my end but in my code there is no such blank.
>
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>
>
--
View this message in context: http://www.nabble.com/blank-screen-while-calling-event-tp25047243p25048460.html
Sent from the OFBiz - User mailing list archive at Nabble.com.
RE: blank screen while calling event
Posted by SELC Sales Div <se...@bdg.centrin.net.id>.
Hi Shuchi,
Sorry, it is not in the request-map, but in your <event>
....invoke="CheckAccess "/>
"CheckAccess_" (_ a blank space)
Did you see that?
- Charles TJ
=============
-----Original Message-----
From: su2 [mailto:shuchi@pexsupply.com]
Sent: 19 Agustus 2009 23:46
To: user@ofbiz.apache.org
Subject: RE: blank screen while calling event
Sorry Thats the typo at my end but in my code there is no such blank.
Sent from the OFBiz - User mailing list archive at Nabble.com.
RE: blank screen while calling event
Posted by su2 <sh...@pexsupply.com>.
Sorry Thats the typo at my end but in my code there is no such blank.
Charles TJ wrote:
>
>
> Hi Shuchi,
>
> I saw there is a blank space at your - request-map when it was 'invoke' to
> your Event.
>
> see below
> <event type="java"path="org.ofbiz.learning.learning.LearningEvents"
> invoke="CheckAccess "/>
>
> "CheckAccess_" (_ a blank space)
>
> I think it is the problem you're facing. Check it out.
>
> - Charles TJ
>
> ==================
>
>
> -----Original Message-----
> From: su2 [mailto:shuchi@pexsupply.com]
> Sent: 19 Agustus 2009 23:13
> To: user@ofbiz.apache.org
> Subject: blank screen while calling event
>
>
>
> 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.h
> tml
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>
>
--
View this message in context: http://www.nabble.com/blank-screen-while-calling-event-tp25047243p25047845.html
Sent from the OFBiz - User mailing list archive at Nabble.com.
RE: blank screen while calling event
Posted by SELC Sales Div <se...@bdg.centrin.net.id>.
Hi Shuchi,
I saw there is a blank space at your - request-map when it was 'invoke' to
your Event.
see below
<event type="java"path="org.ofbiz.learning.learning.LearningEvents"
invoke="CheckAccess "/>
"CheckAccess_" (_ a blank space)
I think it is the problem you're facing. Check it out.
- Charles TJ
==================
-----Original Message-----
From: su2 [mailto:shuchi@pexsupply.com]
Sent: 19 Agustus 2009 23:13
To: user@ofbiz.apache.org
Subject: blank screen while calling event
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.h
tml
Sent from the OFBiz - User mailing list archive at Nabble.com.