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/10 17:59:48 UTC

Uncomplete JSP taglibs? JetSpeed concepts (e.g. JSPPortlet based interaction)?

Hi there!

I spent some time looking for answers to questions I wanna ask (also in this mailing list archive) but I have not found sufficient answers. Please help me with short hints.

1) Is the JSP tag lib distributed with jetspeed complete, or is this in progress ? It looks too spartan, insufficient ( may be incomlete). I mostly found velocity based examples to things I was trying to achieve by JSP and I was not able to. They say that there are similar JSP tags to velocity stuff.. but where can I find them, not in TLD I see in my jetspeed. To me, it looks like "JSP templating support" lack, am I right or am I just too blind yet?

2) How can I find out (from my included JSPPortlet JSP) if there is somebody logged in ? I tried this, it worked out, but it looks terrible..
<%  RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
 if( data.getUser().hasLoggedIn()) { %>

3) What I want to achieve. I have JSP1 registered with JSPPortlet. I wanna have a link in this JSP1 to JSP2 stored in the same place as JSP1 (WEB-INF\templates\jsp\portlets\html) . How this link should look to get it work ? 
As I was unable to solve it, I put JSP2 in to root web app. dir (above Web-Inf), but in this JSP2 I was unable tu use jetspeed taglibs, and this solution looks like from a medicine man. Simply said, when using JSP and jetspeed I feel like with no hands.

4) Please tell me what is the concept about using JSPs based portlet in JetSpeed. I mean how the app (portlet) should be build with JSPPortlet to achieve easy JSP1 submits form and JSP2 handles that. And this is happening within the jetspeed, even within the portlet window.

5) Now for me as JSP user JetSpeed looks like this: I can write portlet and put HTML in to it, but this is clumsy, and I don't like this solution (hard to change the look). Then I can use JSP and include it with JSPPortlet, but then it's almost impossible to achieve some interaction with other JSPs (lack of docs and JSP useage examples). Then I can use JSP as I said just as *PORTAL* and have e.g. struts app. registered on another adress within the server and target the requests from portal there and forget about the jetspeed environment. Or LEARN and use Velocity templates and be happy ?? 

I started to build easy portlet that includes JSP page.. everything went fine till I tried to submit a form (from portlet) and manage it. From this time I spend hours by speculating and hacking.. 

Please help me to put the light on this topic.

Thanx in advance.
$kala. 

RE: Uncomplete JSP taglibs? JetSpeed concepts (e.g. JSPPortlet based interaction)?

Posted by Mark Orciuch <ma...@ngsltd.com>.
Marian,

See more comments below:

> * I mean "looks terrible" because I don't like scriptlets..
> mixing JSP with
> Java code :)) I can imagine something easy like
> <jetspeed:isLoggedIn >
>     Content available only to logged users..
> </jetspeed:isLoggedIn>
> .. however, I just thought that I'm *unable to find* tags like
> this one, but
>  these tags, as you say, *do not exist* :))
> I will write some tags on my own probably.. but it is at least wasteful,
> because many people develop own tags that may have similar behaviour...
> I'll look for allready presented *home made* tags in mail archive. Hope I
> find some I don't need to code.

Fair enough. I doubt you'll find these in mail archive but give it a try.

> * If I understand this tag right, this looks for JSP2.jsp in
> WEB-INF\templates\jsp\layouts\html directory ?

Not quite. Templates for JspPortlet are located in
WEB-INF/templates/jsp/portlets directory based on media type, language, and
country. Templates for screens are located in WEB-INF/templates/jsp/screens
directory based on media type, language, and country. Screens are invoked
via /template uri, for example /template/JSP2.jsp, so the link tag looks
there. If you don't care about the language and country and your users
always access the portal via browser (as opposed to wireless, etc), then put
your templates in html subdirectory.

> So, all my jsps I wanna use like this should reside there? And this tag
> displays the content of the JSP to the whole browser window.
> *Is it possible someway to let this JSP2 to be displayed *within
> the portlet
> window*?
>

Perhaps you can conditionally <%@ include file="JSP2.jsp" %> inside of
JSP1.jsp.

Best regards,

Mark C. Orciuch
Next Generation Solutions, Ltd.
e-Mail: mark_orciuch@ngsltd.com
web: http://www.ngsltd.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Uncomplete JSP taglibs? JetSpeed concepts (e.g. JSPPortlet based interaction)?

Posted by Marian Skalsky <ms...@euromove.sk>.
Mark

Thank you very much for your reply, I appreciate it!
I contiinue with comments.. please list below (stars).

> Marian,
>
> See comments below:
>
> > 1) Is the JSP tag lib distributed with jetspeed complete, or is
> > this in progress ? It looks too spartan, insufficient ( may be
> > incomlete). I mostly found velocity based examples to things I
> > was trying to achieve by JSP and I was not able to. They say that
> > there are similar JSP tags to velocity stuff.. but where can I
> > find them, not in TLD I see in my jetspeed. To me, it looks like
> > "JSP templating support" lack, am I right or am I just too blind yet?
>
> The features available via JSP tag library are a little behind the ones
> available in Velocity. You will find that Velocity support in Jetspeed is
> much stronger than JSP support. One of the TODO's is to bring JSP
templates
> in parity with Velocity
> (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5442). There are other
> issues however (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11264,
> for instance). So these problems have definitely been identfied. However,
I
> don't think that the demand for better JSP support has been voiced too
> strongly.
>
> I am a JSP user but, being aware of JSP limitations and shortcoming(within
> Jetspeed), I chose to use a combination of JSP and Velocity.I have a lot
> of
> JSP portlets but I stay away from invoking JSP templates as screens (i.e.
> /portal/template/mytemplate.jsp). I have been able to do pretty much do
> everything I need with JSP portlets.
>
> You can always add your own tags. And perhaps contribute them too :-)

* Thank you. This thing is clear now. JSP taglib supp. lack.

>
> >
> > 2) How can I find out (from my included JSPPortlet JSP) if there
> > is somebody logged in ? I tried this, it worked out, but it looks
> > terrible..
> > <%  RunData data =
> > (RunData)pageContext.getAttribute(JspService.RUNDATA,
> > PageContext.REQUEST_SCOPE);
> >  if( data.getUser().hasLoggedIn()) { %>
> >
>
> Why does it look terrible? Even in Velocity you would have to do it in
> similar manner (except that rundata is provided as an implicit object -
> $data).
>
> Is the retrieval of rundata what's bothering you? I don't know JSP well
> enough, but is there a way to create an implicit rundata object such as
> request or response.
>

* I mean "looks terrible" because I don't like scriptlets.. mixing JSP with
Java code :)) I can imagine something easy like
<jetspeed:isLoggedIn >
    Content available only to logged users..
</jetspeed:isLoggedIn>
.. however, I just thought that I'm *unable to find* tags like this one, but
 these tags, as you say, *do not exist* :))
I will write some tags on my own probably.. but it is at least wasteful,
because many people develop own tags that may have similar behaviour...
I'll look for allready presented *home made* tags in mail archive. Hope I
find some I don't need to code.

> > 3) What I want to achieve. I have JSP1 registered with
> > JSPPortlet. I wanna have a link in this JSP1 to JSP2 stored in
> > the same place as JSP1 (WEB-INF\templates\jsp\portlets\html) .
> > How this link should look to get it work ?
> > As I was unable to solve it, I put JSP2 in to root web app. dir
> > (above Web-Inf), but in this JSP2 I was unable tu use jetspeed
> > taglibs, and this solution looks like from a medicine man. Simply
> > said, when using JSP and jetspeed I feel like with no hands.
> >
>
> The href of your link would look like this:
>
> <jetspeed:link template="JSP2.jsp"/>

* If I understand this tag right, this looks for JSP2.jsp in
WEB-INF\templates\jsp\layouts\html directory ?
So, all my jsps I wanna use like this should reside there? And this tag
displays the content of the JSP to the whole browser window.
*Is it possible someway to let this JSP2 to be displayed *within the portlet
window*?

>
> > 4) Please tell me what is the concept about using JSPs based
> > portlet in JetSpeed. I mean how the app (portlet) should be build
> > with JSPPortlet to achieve easy JSP1 submits form and JSP2
> > handles that. And this is happening within the jetspeed, even
> > within the portlet window.
> >
>
> I'm not clear on what you want to achieve. Do you want to display JSP1 in
a
> portlet initially and when the user submits the form, to replace the
content
> of the same portlet with JSP2? Or do you want to display another portlet
> (JSP2)?
>

* I want to achieve the first choise "display JSP1 in a
portlet initially and when the user submits the form, to replace the content
of the same portlet with JSP2" .. now when I know how the jetspeed:link tag
works I'm able to achieve this behaviour if I don't rely on showing it
within the original portlet (JSP1).

> > 5) Now for me as JSP user JetSpeed looks like this: I can write
> > portlet and put HTML in to it, but this is clumsy, and I don't
> > like this solution (hard to change the look). Then I can use JSP
> > and include it with JSPPortlet, but then it's almost impossible
> > to achieve some interaction with other JSPs (lack of docs and JSP
> > useage examples). Then I can use JSP as I said just as *PORTAL*
> > and have e.g. struts app. registered on another adress within the
> > server and target the requests from portal there and forget about
> > the jetspeed environment. Or LEARN and use Velocity templates and
> > be happy ??
>
> Again, can you be more specific on the interaction that you want to
achieve?
>

Now I have achieved what I wanted by tag <jetspeed:link
template="JSP2.jsp"/>. I didn't know that it looks for JSP2 in
WEB-INF\templates\jsp\layouts\html directory. This solved my problem. *Thanx
a LOT!!*

The only problem I have not solved for now, is to show the JSP2 within the
same portlet window... any ideas ? :)

> >
> > I started to build easy portlet that includes JSP page..
> > everything went fine till I tried to submit a form (from portlet)
> > and manage it. From this time I spend hours by speculating and hacking..
>
> Best regards,
>

Best regards.
$kala (www.eea.sk)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Uncomplete JSP taglibs? JetSpeed concepts (e.g. JSPPortlet based interaction)?

Posted by Mark Orciuch <ma...@ngsltd.com>.
Marian,

See comments below:

> 1) Is the JSP tag lib distributed with jetspeed complete, or is
> this in progress ? It looks too spartan, insufficient ( may be
> incomlete). I mostly found velocity based examples to things I
> was trying to achieve by JSP and I was not able to. They say that
> there are similar JSP tags to velocity stuff.. but where can I
> find them, not in TLD I see in my jetspeed. To me, it looks like
> "JSP templating support" lack, am I right or am I just too blind yet?

The features available via JSP tag library are a little behind the ones
available in Velocity. You will find that Velocity support in Jetspeed is
much stronger than JSP support. One of the TODO's is to bring JSP templates
in parity with Velocity
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5442). There are other
issues however (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11264, for
instance). So these problems have definitely been identfied. However, I
don't think that the demand for better JSP support has been voiced too
strongly.

I am a JSP user but, being aware of JSP limitations and shortcoming (within
Jetspeed), I chose to use a combination of JSP and Velocity.I have a lot of
JSP portlets but I stay away from invoking JSP templates as screens (i.e.
/portal/template/mytemplate.jsp). I have been able to do pretty much do
everything I need with JSP portlets.

You can always add your own tags. And perhaps contribute them too :-)

>
> 2) How can I find out (from my included JSPPortlet JSP) if there
> is somebody logged in ? I tried this, it worked out, but it looks
> terrible..
> <%  RunData data =
> (RunData)pageContext.getAttribute(JspService.RUNDATA,
> PageContext.REQUEST_SCOPE);
>  if( data.getUser().hasLoggedIn()) { %>
>

Why does it look terrible? Even in Velocity you would have to do it in
similar manner (except that rundata is provided as an implicit object -
$data).

Is the retrieval of rundata what's bothering you? I don't know JSP well
enough, but is there a way to create an implicit rundata object such as
request or response.

> 3) What I want to achieve. I have JSP1 registered with
> JSPPortlet. I wanna have a link in this JSP1 to JSP2 stored in
> the same place as JSP1 (WEB-INF\templates\jsp\portlets\html) .
> How this link should look to get it work ?
> As I was unable to solve it, I put JSP2 in to root web app. dir
> (above Web-Inf), but in this JSP2 I was unable tu use jetspeed
> taglibs, and this solution looks like from a medicine man. Simply
> said, when using JSP and jetspeed I feel like with no hands.
>

The href of your link would look like this:

<jetspeed:link template="JSP2.jsp"/>

> 4) Please tell me what is the concept about using JSPs based
> portlet in JetSpeed. I mean how the app (portlet) should be build
> with JSPPortlet to achieve easy JSP1 submits form and JSP2
> handles that. And this is happening within the jetspeed, even
> within the portlet window.
>

I'm not clear on what you want to achieve. Do you want to display JSP1 in a
portlet initially and when the user submits the form, to replace the content
of the same portlet with JSP2? Or do you want to display another portlet
(JSP2)?

> 5) Now for me as JSP user JetSpeed looks like this: I can write
> portlet and put HTML in to it, but this is clumsy, and I don't
> like this solution (hard to change the look). Then I can use JSP
> and include it with JSPPortlet, but then it's almost impossible
> to achieve some interaction with other JSPs (lack of docs and JSP
> useage examples). Then I can use JSP as I said just as *PORTAL*
> and have e.g. struts app. registered on another adress within the
> server and target the requests from portal there and forget about
> the jetspeed environment. Or LEARN and use Velocity templates and
> be happy ??

Again, can you be more specific on the interaction that you want to achieve?

>
> I started to build easy portlet that includes JSP page..
> everything went fine till I tried to submit a form (from portlet)
> and manage it. From this time I spend hours by speculating and hacking..

Best regards,

Mark C. Orciuch
Next Generation Solutions, Ltd.
e-Mail: mark_orciuch@ngsltd.com
web: http://www.ngsltd.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>