Re: Using PHP language in Java/JSP files.



AFAIK, you won't be able to plug the output of the JSP interpreter into the
PHP interpreter, and have "double" parsing if it's what you want.

Using a JSR 223 implementation or a ColdFusion-like product, you could
however code JSP and PHP in the same page, and have Java interpret JSP and
PHP, which would fit your need.

Now, if the enhancement you need to code is:
* list files in a directory
* let user select a file
* copy the selected file
* rename the copy

Then it's not that hard to write in Java / JSP, and using PHP just because
you know it may be counter-productive.

You need to use FileInputStream & FileOutputStream to read the file in
blocks of bytes and write the bytes into the new file.

Here is an example of writing a copy of a file:
http://www.rgagnon.com/javadetails/java-0064.html.

For tutorials, there are so many sources... Sun has one. Here is a start:
http://java.sun.com/products/jsp/docs.html.


.



Relevant Pages

  • Re: HTML "scrape" causes loss of query string in URL
    ... >> in PHP with several PHP scripts interacting with one Java servlet, ... >> which interacted with several Java classes. ... > process to go from PHP to JSP. ...
    (comp.lang.java.help)
  • Re: Ruby performance woes
    ... Now here's my take on all this: PHP and JSP and what I inquired ... S-expressions used as a directly alternate expression of SGML or XML. ... By the way, I've never had access to a Web server that can run ASP, ...
    (comp.lang.lisp)
  • Re: PHP5 a threat, or a complement to server-side java?
    ... and moving their scripts to PHP. ... What I currently DON'T see is Sun making a big push for JSP, ... In short: MINDSHARE, MINDSHARE, MINDSHARE. ...
    (comp.lang.java.programmer)
  • Re: my little comments on jsp and php
    ... Why do you talk about struts and hibernate when talking about JSP, ... I learned jsp for about 5 years, and learned php for about 4 ... When I do JAVA webapp project, I just use one IDE and can finish all ...
    (comp.lang.java.programmer)
  • Re: =?iso-8859-1?Q?Kompatibilit=E4t?= von Konzepten von PHP zu Java
    ... Reine Servlets sind nicht so prickelnd. ... JSP sagen mir wenig zu, genau wie bei PHP ein Gemisch ... aus PHP und HTML. ...
    (de.comp.lang.java)