You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Marian Skalsky <ms...@euromove.sk> on 2002/09/12 11:21:39 UTC
Pass parameters from JSPPortlet to the JSP
Hi there!
I use JSPPortlet to get my JSP in to the portal. But I wanna pass some
parameters from portlet config. to that JSP (call it like
JSP?par1=value1&par2=value2..).
I alterned JSPPortlet that it looks for parameters using
getPortletConfig().getInitParameterNames();
This works and I get my parameters list I defined in .xreg file. But as I
don't know the turbine at all, I'm unable to pass these argument to the JSP.
In the JSPPortlet code:
....
JspService service = (JspService)TurbineServices.getInstance()
.getService(JspService.SERVICE_NAME);
// this is only necessary if we ddon't run in a JSP page environment
// but better be safe than sorry...
service.addDefaultObjects(rundata);
// handle request
service.handleRequest(rundata, locatedTemplate);
....
I was trying to find some methods or way how to pass arguments, but I was
unable to achieve that.
I tried service.handleRequest(rundata, locatedTemplate + *myParameters*);
but this of course doesn't work.
Can you please tell me how to PASS arguments with JSPService or some other
way.
Thanx a lot.
$kala (www.eea.sk)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Pass parameters from JSPPortlet to the JSP
Posted by Marian Skalsky <ms...@euromove.sk>.
Mark,
It helped! Thx. a lot.
$kala.
----- Original Message -----
From: "Mark Orciuch" <ma...@ngsltd.com>
To: "Jetspeed Users List" <je...@jakarta.apache.org>
Sent: Thursday, September 12, 2002 5:15 PM
Subject: RE: Pass parameters from JSPPortlet to the JSP
> Marian,
>
> Registry parameters defined for JspPortlet can be accessed inside the .jsp
> template as follows:
>
> <%
> Portlet portlet = (Portlet) request.getAttribute("portlet");
> String myParm = portlet.getPortletConfig().getInitParameter("myParm");
> %>
>
> Hope this helps.
>
> Best regards,
>
> Mark C. Orciuch
> Next Generation Solutions, Ltd.
> e-Mail: mark_orciuch@ngsltd.com
> web: http://www.ngsltd.com
>
>
> > -----Original Message-----
> > From: Marian Skalsky [mailto:ms@euromove.sk]
> > Sent: Thursday, September 12, 2002 4:22 AM
> > To: Jetspeed Users List
> > Subject: Pass parameters from JSPPortlet to the JSP
> >
> >
> > Hi there!
> >
> > I use JSPPortlet to get my JSP in to the portal. But I wanna pass some
> > parameters from portlet config. to that JSP (call it like
> > JSP?par1=value1&par2=value2..).
> >
> > I alterned JSPPortlet that it looks for parameters using
> > getPortletConfig().getInitParameterNames();
> > This works and I get my parameters list I defined in .xreg file. But as
I
> > don't know the turbine at all, I'm unable to pass these argument
> > to the JSP.
> >
> > In the JSPPortlet code:
> >
> > ....
> > JspService service = (JspService)TurbineServices.getInstance()
> > .getService(JspService.SERVICE_NAME);
> > // this is only necessary if we ddon't run in a JSP page
environment
> > // but better be safe than sorry...
> > service.addDefaultObjects(rundata);
> > // handle request
> > service.handleRequest(rundata, locatedTemplate);
> > ....
> > I was trying to find some methods or way how to pass arguments, but I
was
> > unable to achieve that.
> > I tried service.handleRequest(rundata, locatedTemplate +
*myParameters*);
> > but this of course doesn't work.
> >
> > Can you please tell me how to PASS arguments with JSPService or some
other
> > way.
> >
> > Thanx a lot.
> > $kala (www.eea.sk)
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Pass parameters from JSPPortlet to the JSP
Posted by Mark Orciuch <ma...@ngsltd.com>.
Yes. Just don't forget this import in your JSP:
<%@ page import = "org.apache.jetspeed.portal.Portlet" %>
Best regards,
Mark C. Orciuch
Next Generation Solutions, Ltd.
e-Mail: mark_orciuch@ngsltd.com
web: http://www.ngsltd.com
> -----Original Message-----
> From: Mike Zhou [mailto:erzhuanzhou@yahoo.com]
> Sent: Thursday, September 12, 2002 3:49 PM
> To: Jetspeed Users List; mark_orciuch@ngsltd.com
> Subject: RE: Pass parameters from JSPPortlet to the JSP
>
>
> Mark,
>
> So, I can define myParm in the following was?
>
> <portlet-entry name="MyJSP" hidden="false" type="ref"
> parent="JSP" application="false">
> <meta-info>
> <title>MyJSP</title>
> </meta-info>
> <parameter name="template"
> value="myjsp.jsp" hidden="false"/>
> <parameter name="myParm"
> value="something" />
> <media-type ref="html"/>
> </portlet-entry>
>
> Thanks, Erzhuan
>
> --- Mark Orciuch <ma...@ngsltd.com> wrote:
> > Marian,
> >
> > Registry parameters defined for JspPortlet can be
> > accessed inside the .jsp
> > template as follows:
> >
> > <%
> > Portlet portlet = (Portlet)
> > request.getAttribute("portlet");
> > String myParm =
> >
> portlet.getPortletConfig().getInitParameter("myParm");
> > %>
> >
> > Hope this helps.
> >
> > Best regards,
> >
> > Mark C. Orciuch
> > Next Generation Solutions, Ltd.
> > e-Mail: mark_orciuch@ngsltd.com
> > web: http://www.ngsltd.com
> >
> >
> > > -----Original Message-----
> > > From: Marian Skalsky [mailto:ms@euromove.sk]
> > > Sent: Thursday, September 12, 2002 4:22 AM
> > > To: Jetspeed Users List
> > > Subject: Pass parameters from JSPPortlet to the
> > JSP
> > >
> > >
> > > Hi there!
> > >
> > > I use JSPPortlet to get my JSP in to the portal.
> > But I wanna pass some
> > > parameters from portlet config. to that JSP (call
> > it like
> > > JSP?par1=value1&par2=value2..).
> > >
> > > I alterned JSPPortlet that it looks for parameters
> > using
> > > getPortletConfig().getInitParameterNames();
> > > This works and I get my parameters list I defined
> > in .xreg file. But as I
> > > don't know the turbine at all, I'm unable to pass
> > these argument
> > > to the JSP.
> > >
> > > In the JSPPortlet code:
> > >
> > > ....
> > > JspService service =
> > (JspService)TurbineServices.getInstance()
> > >
> > .getService(JspService.SERVICE_NAME);
> > > // this is only necessary if we ddon't run
> > in a JSP page environment
> > > // but better be safe than sorry...
> > > service.addDefaultObjects(rundata);
> > > // handle request
> > > service.handleRequest(rundata,
> > locatedTemplate);
> > > ....
> > > I was trying to find some methods or way how to
> > pass arguments, but I was
> > > unable to achieve that.
> > > I tried service.handleRequest(rundata,
> > locatedTemplate + *myParameters*);
> > > but this of course doesn't work.
> > >
> > > Can you please tell me how to PASS arguments with
> > JSPService or some other
> > > way.
> > >
> > > Thanx a lot.
> > > $kala (www.eea.sk)
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Pass parameters from JSPPortlet to the JSP
Posted by Mike Zhou <er...@yahoo.com>.
Mark,
So, I can define myParm in the following was?
<portlet-entry name="MyJSP" hidden="false" type="ref"
parent="JSP" application="false">
<meta-info>
<title>MyJSP</title>
</meta-info>
<parameter name="template"
value="myjsp.jsp" hidden="false"/>
<parameter name="myParm"
value="something" />
<media-type ref="html"/>
</portlet-entry>
Thanks, Erzhuan
--- Mark Orciuch <ma...@ngsltd.com> wrote:
> Marian,
>
> Registry parameters defined for JspPortlet can be
> accessed inside the .jsp
> template as follows:
>
> <%
> Portlet portlet = (Portlet)
> request.getAttribute("portlet");
> String myParm =
>
portlet.getPortletConfig().getInitParameter("myParm");
> %>
>
> Hope this helps.
>
> Best regards,
>
> Mark C. Orciuch
> Next Generation Solutions, Ltd.
> e-Mail: mark_orciuch@ngsltd.com
> web: http://www.ngsltd.com
>
>
> > -----Original Message-----
> > From: Marian Skalsky [mailto:ms@euromove.sk]
> > Sent: Thursday, September 12, 2002 4:22 AM
> > To: Jetspeed Users List
> > Subject: Pass parameters from JSPPortlet to the
> JSP
> >
> >
> > Hi there!
> >
> > I use JSPPortlet to get my JSP in to the portal.
> But I wanna pass some
> > parameters from portlet config. to that JSP (call
> it like
> > JSP?par1=value1&par2=value2..).
> >
> > I alterned JSPPortlet that it looks for parameters
> using
> > getPortletConfig().getInitParameterNames();
> > This works and I get my parameters list I defined
> in .xreg file. But as I
> > don't know the turbine at all, I'm unable to pass
> these argument
> > to the JSP.
> >
> > In the JSPPortlet code:
> >
> > ....
> > JspService service =
> (JspService)TurbineServices.getInstance()
> >
> .getService(JspService.SERVICE_NAME);
> > // this is only necessary if we ddon't run
> in a JSP page environment
> > // but better be safe than sorry...
> > service.addDefaultObjects(rundata);
> > // handle request
> > service.handleRequest(rundata,
> locatedTemplate);
> > ....
> > I was trying to find some methods or way how to
> pass arguments, but I was
> > unable to achieve that.
> > I tried service.handleRequest(rundata,
> locatedTemplate + *myParameters*);
> > but this of course doesn't work.
> >
> > Can you please tell me how to PASS arguments with
> JSPService or some other
> > way.
> >
> > Thanx a lot.
> > $kala (www.eea.sk)
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
>
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
>
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Pass parameters from JSPPortlet to the JSP
Posted by Mark Orciuch <ma...@ngsltd.com>.
Marian,
Registry parameters defined for JspPortlet can be accessed inside the .jsp
template as follows:
<%
Portlet portlet = (Portlet) request.getAttribute("portlet");
String myParm = portlet.getPortletConfig().getInitParameter("myParm");
%>
Hope this helps.
Best regards,
Mark C. Orciuch
Next Generation Solutions, Ltd.
e-Mail: mark_orciuch@ngsltd.com
web: http://www.ngsltd.com
> -----Original Message-----
> From: Marian Skalsky [mailto:ms@euromove.sk]
> Sent: Thursday, September 12, 2002 4:22 AM
> To: Jetspeed Users List
> Subject: Pass parameters from JSPPortlet to the JSP
>
>
> Hi there!
>
> I use JSPPortlet to get my JSP in to the portal. But I wanna pass some
> parameters from portlet config. to that JSP (call it like
> JSP?par1=value1&par2=value2..).
>
> I alterned JSPPortlet that it looks for parameters using
> getPortletConfig().getInitParameterNames();
> This works and I get my parameters list I defined in .xreg file. But as I
> don't know the turbine at all, I'm unable to pass these argument
> to the JSP.
>
> In the JSPPortlet code:
>
> ....
> JspService service = (JspService)TurbineServices.getInstance()
> .getService(JspService.SERVICE_NAME);
> // this is only necessary if we ddon't run in a JSP page environment
> // but better be safe than sorry...
> service.addDefaultObjects(rundata);
> // handle request
> service.handleRequest(rundata, locatedTemplate);
> ....
> I was trying to find some methods or way how to pass arguments, but I was
> unable to achieve that.
> I tried service.handleRequest(rundata, locatedTemplate + *myParameters*);
> but this of course doesn't work.
>
> Can you please tell me how to PASS arguments with JSPService or some other
> way.
>
> Thanx a lot.
> $kala (www.eea.sk)
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>