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 Ming Fai <mi...@hongkong.com> on 2001/09/26 12:21:14 UTC

How to change from vm to jsp template

Hi, I'm new to jetspeed and want to ask simple questions. I use the latest
jetspeed 1.3a2-dev.

1. What're the steps to switch from vm to jsp?
So far as I know, i need to modify TurbineResources.properties, the
'Framework Settings' part. By default, the following properties are there:
	template.homepage=Home
	screen.homepage=Home
	template.login=Login
	template.error=Error
	screen.error=Error
	screen.invalidstate=error.InvalidState
	default.doctype=Html40Transitional
	action.login=JLoginUser
	action.logout=LogoutUser
	action.sessionvalidator=JetspeedSessionValidator
	action.accesscontroller=AccessController

My question is, which of the above need to be changed? And all I need to do
is to change the value to xxx.jsp, right? (e.g. Home -> Home.jsp, as long as
Home.jsp exists in the template/jsp directory)

2. What is the difference between default template and default screen? If I
specify both in the property file, which one will be used?

3. I personally think it's better to use jsp rather than vm because jsp use
Java which is a 'industrial standard' programming language while vm is not
so common. I read from achieve that some discussion of 'jsp vs vm' is not
yet available in achieve, could anybody summarize the difference between to
two?

Thx a lot in advance.

Regards,
mingfai


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: How to change from vm to jsp template

Posted by Ming Fai <mi...@hongkong.com>.
Thx for your information. At the begining, I wonder why Jetspeed
documentation does not cover some things, such as those vm file, templates
directory structure, TRP etc. Now, I understand it is actually in Turbine's
domain.

After reading the "jsp vs vm" threads as well as the suggested Turbine
articles, I got more understanding on the benefit of using vm. However, I
still think Jetspeed should supporting jsp templates and I personally will
keep using it. I'm not going challenge nor repeat the points mentioned in
the article 'The Problem with JSP', just to supplement it with some pro-JSP
pts as follows:

1. The learning curve for Java programmer to write VM is longer
	So, at least for Java programmer, it's better for them to choose Jsp than
VM. (and I am more comfort to work with Java code than the 'more clear' vm
code)

2. Using jsp, the portability and reusability of application are better
	If in the future I want to migrate my portal to another platform, the cost
in migration is much lower if I use jsp in the beginning. As a developer, I
prefer my skills to be more 'portable' and 'reuseable' as well, so, it's
better for me to vote for jsp rather than vm.

3. Using jsp, the development can be done rapidly
	This actually defeat the purpose of MVC. But in some (exception?) cases, we
may want to develop sth rapidly. Jsp could support better functionality by
putting more application logic in it. (which is not a good idea in general,
but it may be good if the web application is done ah hoc and will not be
re-used.)

4. With careful planning and coding standard, model-view-controller can
still be achieved with Jsp
	This pt is mentioned indirectly in Jason's article already. I want to point
out, sometimes it is good to pick a flexible solution and implement strict
human control. (e.g. in coding standard, system design etc.) Simply
speaking, you could write jsp without putting more application logic inside.

To summerize, I think it's better for Java programmer to use Jsp templates
and for those who are new to programming or with no prior Java programming
experience to use vm. There are more problems in using jsp than vm, that why
there are many vm supporters. I can't say I won't find out vm is better
finally but I do want to face the challenge of solving jsp problems! :-)

Regards,
mingfai


-----Original Message-----
From: David Sean Taylor [mailto:david@bluesunrise.com]
Sent: Thursday, September 27, 2001 3:06 AM
To: jetspeed-user@jakarta.apache.org
Subject: Re: How to change from vm to jsp template



----- Original Message -----
From: "Ming Fai" <mi...@hongkong.com>
To: <je...@jakarta.apache.org>
Sent: Wednesday, September 26, 2001 3:21 AM
Subject: How to change from vm to jsp template


> Hi, I'm new to jetspeed and want to ask simple questions. I use the latest
> jetspeed 1.3a2-dev.
>
> 1. What're the steps to switch from vm to jsp?

in the TRP change:

services.TemplateService.default.extension=vm

to:

services.TemplateService.default.extension=jsp

> So far as I know, i need to modify TurbineResources.properties, the
> 'Framework Settings' part. By default, the following properties are there:
> template.homepage=Home
> screen.homepage=Home
> template.login=Login
> template.error=Error
> screen.error=Error
> screen.invalidstate=error.InvalidState
> default.doctype=Html40Transitional
> action.login=JLoginUser
> action.logout=LogoutUser
> action.sessionvalidator=JetspeedSessionValidator
> action.accesscontroller=AccessController
>
> My question is, which of the above need to be changed? And all I need to
do
> is to change the value to xxx.jsp, right? (e.g. Home -> Home.jsp, as long
as
> Home.jsp exists in the template/jsp directory)
>
> 2. What is the difference between default template and default screen? If
I
> specify both in the property file, which one will be used?

Could you be more specific, what line in the TRP are you talking about?
In general, templates are your jsp or vm templates.
A template can implement a screen, or a screen can be implemented in Java.
To learn more about Turbine modules, see:
http://jakarta.apache.org/turbine/turbine-2/fsd.html
>
> 3. I personally think it's better to use jsp rather than vm because jsp
use
> Java which is a 'industrial standard' programming language while vm is not
> so common. I read from achieve that some discussion of 'jsp vs vm' is not
> yet available in achieve, could anybody summarize the difference between
to
> two?

There are a lot of good arguments contrary to the point you are making.
That is, you shouldn't put Java code in the presentation (template)

http://jakarta.apache.org/velocity/ymtd/ymtd.html
http://www.servlets.com/soapbox/problems-jsp.html


>
> Thx a lot in advance.
>
> Regards,
> mingfai
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: How to change from vm to jsp template

Posted by David Sean Taylor <da...@bluesunrise.com>.
----- Original Message -----
From: "Ming Fai" <mi...@hongkong.com>
To: <je...@jakarta.apache.org>
Sent: Wednesday, September 26, 2001 3:21 AM
Subject: How to change from vm to jsp template


> Hi, I'm new to jetspeed and want to ask simple questions. I use the latest
> jetspeed 1.3a2-dev.
>
> 1. What're the steps to switch from vm to jsp?

in the TRP change:

services.TemplateService.default.extension=vm

to:

services.TemplateService.default.extension=jsp

> So far as I know, i need to modify TurbineResources.properties, the
> 'Framework Settings' part. By default, the following properties are there:
> template.homepage=Home
> screen.homepage=Home
> template.login=Login
> template.error=Error
> screen.error=Error
> screen.invalidstate=error.InvalidState
> default.doctype=Html40Transitional
> action.login=JLoginUser
> action.logout=LogoutUser
> action.sessionvalidator=JetspeedSessionValidator
> action.accesscontroller=AccessController
>
> My question is, which of the above need to be changed? And all I need to
do
> is to change the value to xxx.jsp, right? (e.g. Home -> Home.jsp, as long
as
> Home.jsp exists in the template/jsp directory)
>
> 2. What is the difference between default template and default screen? If
I
> specify both in the property file, which one will be used?

Could you be more specific, what line in the TRP are you talking about?
In general, templates are your jsp or vm templates.
A template can implement a screen, or a screen can be implemented in Java.
To learn more about Turbine modules, see:
http://jakarta.apache.org/turbine/turbine-2/fsd.html
>
> 3. I personally think it's better to use jsp rather than vm because jsp
use
> Java which is a 'industrial standard' programming language while vm is not
> so common. I read from achieve that some discussion of 'jsp vs vm' is not
> yet available in achieve, could anybody summarize the difference between
to
> two?

There are a lot of good arguments contrary to the point you are making.
That is, you shouldn't put Java code in the presentation (template)

http://jakarta.apache.org/velocity/ymtd/ymtd.html
http://www.servlets.com/soapbox/problems-jsp.html


>
> Thx a lot in advance.
>
> Regards,
> mingfai
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: Logging out in Jetspeed

Posted by Paul Spencer <pa...@mikon.com>.
Anthony,
The session timeout can be set in many places. One place is in
<jetspeed-home>/WEB-INF/web.xml.  In this file add the following before
the <welcome-list>
  <!-- You can set the session timeout (in minutes) for all
newly           -->
  <!-- created sessions by modifying the value
below.                       -->
  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>

Paul Spencer

Anthony Smith wrote:
> 
> What about some type of feature where after a user has timed out, they are
> taken to a page where it says they have timed out?
> 
> -----Original Message-----
> From: Paul Spencer [mailto:paul@mikon.com]
> Sent: Friday, September 28, 2001 11:20 AM
> To: jetspeed-user@jakarta.apache.org
> Subject: Re: Logging out in Jetspeed
> 
> Anthony,
> I added the following to WEB-INF/templates/vm/layouts/html/default.vm to
> disable cache on the page.  Although the Netscape displayed a message
> stating the page had expired, a refresh displayed the page.  IE 4 and
> 5.0 displayed the displayed the page.
> 
>     <meta http-equiv="Cache-Control" content="no-cache" />
>     <meta http-equiv="Expires" content="0" />
> 
> It appears Jetspeed does not check if the user is logged in before
> displaying his portal page.
> 
> Paul Spencer
> 
> Anthony Smith wrote:
> >
> > Curently when I log off of Jetspeed, it takes me to my Login page. This is
> > fine. I want some way where if I hit back it does not show the previos
> > information. I dont care if it shows WebPage expired or can be setup where
> I
> > can forward it to an access denied page.
> >
> > Anyone have any suggestions
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


RE: Logging out in Jetspeed

Posted by Anthony Smith <an...@fedex.com>.
What about some type of feature where after a user has timed out, they are
taken to a page where it says they have timed out?

-----Original Message-----
From: Paul Spencer [mailto:paul@mikon.com]
Sent: Friday, September 28, 2001 11:20 AM
To: jetspeed-user@jakarta.apache.org
Subject: Re: Logging out in Jetspeed


Anthony,
I added the following to WEB-INF/templates/vm/layouts/html/default.vm to
disable cache on the page.  Although the Netscape displayed a message
stating the page had expired, a refresh displayed the page.  IE 4 and
5.0 displayed the displayed the page.

    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

It appears Jetspeed does not check if the user is logged in before
displaying his portal page.

Paul Spencer

Anthony Smith wrote:
>
> Curently when I log off of Jetspeed, it takes me to my Login page. This is
> fine. I want some way where if I hit back it does not show the previos
> information. I dont care if it shows WebPage expired or can be setup where
I
> can forward it to an access denied page.
>
> Anyone have any suggestions
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: Logging out in Jetspeed

Posted by Paul Spencer <pa...@mikon.com>.
Anthony,
I added the following to WEB-INF/templates/vm/layouts/html/default.vm to
disable cache on the page.  Although the Netscape displayed a message
stating the page had expired, a refresh displayed the page.  IE 4 and
5.0 displayed the displayed the page.

    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />

It appears Jetspeed does not check if the user is logged in before
displaying his portal page.

Paul Spencer

Anthony Smith wrote:
> 
> Curently when I log off of Jetspeed, it takes me to my Login page. This is
> fine. I want some way where if I hit back it does not show the previos
> information. I dont care if it shows WebPage expired or can be setup where I
> can forward it to an access denied page.
> 
> Anyone have any suggestions
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Logging out in Jetspeed

Posted by Anthony Smith <an...@fedex.com>.
Curently when I log off of Jetspeed, it takes me to my Login page. This is
fine. I want some way where if I hit back it does not show the previos
information. I dont care if it shows WebPage expired or can be setup where I
can forward it to an access denied page.

Anyone have any suggestions


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org