You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel Blumenthal <br...@yahoo.com> on 2003/11/17 22:48:24 UTC

struts and PHP

i've been looking into adding blogging functionality to my website (which
uses struts), and one which was suggested was pmachine
(http://www.pmachine.com/index.php). however, this uses php, and this raised
the question of how/if it was possible to use php with struts. (obviously, i
can just specify a php page instead of a jsp, but how do i get dynamic data
without relying on the jsp tags?)

is this incredibly easy? impossible? is there some weird chaining process
that i have to go through? or is there another blogging tool which doesn't
use php which i should use instead?

daniel

Re: struts and PHP

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Quoting Christian Bollmeyer <ja...@christianbollmeyer.de>:

> Am Montag, 17. November 2003 22:48 schrieb Daniel Blumenthal:
> 
> Hi,
> 
> > i've been looking into adding blogging functionality to my website
> > (which uses struts), and one which was suggested was pmachine
> > (http://www.pmachine.com/index.php). however, this uses php, and this
> > raised the question of how/if it was possible to use php with struts.
> > (obviously, i can just specify a php page instead of a jsp, but how
> > do i get dynamic data without relying on the jsp tags?)
> 
> As soon as you leave the Java world, the only means of passing
> dynamic content is the 'traditional' way, i.e. parameters. You lose
> everything from page to application scopes and won't be able
> to use attributes (Objects) in particular, as those reside inside
> the VM's memory and thus are inaccessible from PHP.

Alas, this is pretty much the case today.  However, there is a JSR in progress
that is excplicitly designed to define a standard way that scripting languages
and Java can interact (and share access to Java objects, and the HttpSession
instance, along the way).  Keep an eye out for progress on:

  http://jcp.org/en/jsr/detail?id=223

Note that the Zend folks are actively involved in this effort, so we can expect
that support for PHP in particular should be pretty well planned.

Craig


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


Re: struts and PHP

Posted by Christian Bollmeyer <ja...@christianbollmeyer.de>.
Am Montag, 17. November 2003 22:48 schrieb Daniel Blumenthal:

Hi,

> i've been looking into adding blogging functionality to my website
> (which uses struts), and one which was suggested was pmachine
> (http://www.pmachine.com/index.php). however, this uses php, and this
> raised the question of how/if it was possible to use php with struts.
> (obviously, i can just specify a php page instead of a jsp, but how
> do i get dynamic data without relying on the jsp tags?)

As soon as you leave the Java world, the only means of passing
dynamic content is the 'traditional' way, i.e. parameters. You lose
everything from page to application scopes and won't be able
to use attributes (Objects) in particular, as those reside inside
the VM's memory and thus are inaccessible from PHP. If you
absolutely have to pass complex information between the PHP
app and the Java part, one possible suggestion might be to
use a database or other third-party serialization target both of
them can access (in lack of a database, an XML file, perhaps).
Generally, I won't recommend this, for there may be all kinds
of synchronization and security issues involved. Don't know
if PHP can handle this, but this also might be a situation where
Web Services may be helpful. Anyway, the overhead involved
in both cases is much too big for a private site. IMHO it's better
to look for a Java-based blog solution.

> is this incredibly easy? impossible? is there some weird chaining
> process that i have to go through? or is there another blogging tool
> which doesn't use php which i should use instead?

Admitting I kind of hate both blogs and PHP in general, I'm still
pretty sure there are Java-based blog solutions around.

The first thing I'd do is to check out Google and then
sourceforge.net, as always. Or java.net, lately. 

> daniel

HTH,
-- Chris.



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