Gerald,

although I cannot give you extensive answers, I hope I can help you in
some points:

> 
> 1) JSPs can persist variables at the page, request, session and application
> scopes. I believe PHP variables are implicitly page-scoped, and session
> management can be used for session-scoping. Are there equivalents to
> request and application scoping?

The PHP default scope is request scope rather than page scope, as all
processing that is done in connection with one request shares the same
scope. This includes auto_prepend and auto_append files, as well as any
that are included.

There is no concept of application scope variables. You would need to
implement these using the shared memory functions.

> 2) In JSPs, it is possible to do server-side page redirection, i.e.
> "forward" a request from page A to page B, as if the user actually
> requested page B. There is no browser involvement in the redirection; it is
> complete on the server. In this scenario, there are two "page scopes", and
> one "request scope". How is this server-side redirection done in PHP?

You cannot actually do page redirection, but you can simulate something
similar:

If you set up an auto_prepend file, this file is processed before the
requested page 
is. In this file, the originally requested resource is available in
$REQUEST_URI.
With this information, you can decide not to serve the requested file,
but include()
another page and then exit() instead.

I am using this to implement a 'sourceview' function on my homepage.
Have a look
at http://bpeter.org/ and hit 'view source'. Have a look at
'prepend.php' and 'sourceview.php' to get an idea.

> 
> 3) In doing the server-side page redirection, variables can be added to a
> "request" object, which embodies parameters related to a request. Page A
> can add variables to the request object (perhaps values from an SQL
> select), which page B can then retrieve and display. How is this done in PHP?
> 

If you take above approach, the scope will be shared between the prepend
file and any included files.

> 4) JSPs, being a part of J2EE, can use a security system that does
> authentication and authorization. What is the commonly accepted way to do
> security with PHP?

Varies. You can either use http level authentication or something within
application scope. You can access almost any backend you like for that
(MySQL Database, .htpasswd, EJB, whatever).

> 5) On a JSP site, I typically arrange things such that a particular JSP (or
> servlet) accepts requests, processes them and then forwards them to one of
> a number of different pages, depending on the outcome of the processing.
> This is in contrast to the alternative approach where one simply goes to a
> page, which does some processing and then displays the contents of the
> requested page. What is the typical way to achieving this "funnel all
> requests to a single point and have it forward the correct response to the
> user" paradigm?

In the above model, the auto_prepended file would be that point. If you
like, 
you can have a single page which then include()s read()s as necessary.

> 6) JSPs can be packaged up as an application (a WAR file), and that WAR
> file has descriptors that allow mapping of URLs to JSPs and servlets. This
> allows me to just drop in a WAR file to a JSP container, like Tomcat, and
> have it run. Are there equivalents to the "pack it up as an application"
> and URL mapping concepts in PHP?

There is no similar concept in PHP. One way would be to tune an
application so
that it reads all necessary information from a configuration file, but
you would
have to do this manually.

> 
> 7) JSPs can be mapping to multiple URLS, e.g. /alpha/mypage and
> /beta/mypage can both go to the same JSP. Is there an equivalent to this in
> PHP?

This would be best done on webserver configuration level. For apache,
add 'Alias /beta/mypage /alpha/mypage'.

> I have several more, but this is a sample. Answers to these questions are
> quite important to me because at the moment I'm trying to decide whether I
> should choose JSPs (J2EE actually), PHP or Zope for some projects.

I know that most likely my answers are not what you hoped for; others
might have much cleaner and better solutions for achieving your goals in
PHP.
PHP and JSP differ in concept rather far, so that there is no 1:1
mapping of many of the architectural aspects of JSP.

In your decision it might help to know that you can use Java objects
from PHP. This gives you the ability to access EJBs from a PHP frontend.
You can so pack you logic into Java, which offers more capabilities in
backend integration, and stick with PHP/MySQL for the frontend and
personalization.

Cheers,
Ben

> 
> Thanks.
> 
> Gerald.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to