aspose file tools*
The moose likes Java in General and the fly likes Java code sitting along with php.. assisting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java code sitting along with php.. assisting" Watch "Java code sitting along with php.. assisting" New topic
Author

Java code sitting along with php.. assisting

ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

I want to develop a Java based module that can be easily integrated with the php or asp
based web applicarions by just copy pasting in their respective webapp areas.

I want to know if it is possible?
What should I keepin mind doing this?

Those webapps may be running on either window or linux servers.

I appreciate any suggestions..

Please divert this post to the right section if not ..

Thank you!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
I want to develop a Java based module that can be easily integrated with the php or asp
based web applicarions by just copy pasting in their respective webapp areas.

Can you elaborate what "integrated" means? Also, what is the "webapp area", and what do you want to copy/paste from where to where?


Ping & DNS - updated with new look and Ping home screen widget
ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

To manage php based site content we use some file structure.
If in that file structure I want to create a new folder to store my java based component,
which when downloaded, activates and creates whatever is needed to register a new user, like
1) creates a new user table
2) does all query stuff to enter the user records

I have a standard .php login page to integrate with... means the attributes are all decided by me on backndd side and at front end side.

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

If you already have a PHP application, why use Java?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

I want to develop CMS(content management system).

My client will come and decide one template.
Then he/she will choose what functions are required.. like: login, career, contact us & so on..

I have php programmer in my team work on the web development..

I know Java and want to create those modules in Java. apart from that all things will be done using php.
Only few things I want to modularize.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
Many open source CMSes are available that are written in PHP (like Joomla). It would probably be easier to modify and integrate one of those than it would be to write one in Java that doesn't integrate well with PHP code.
ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

It would probably be easier to modify and integrate one of those than it would be to write one in Java that doesn't integrate well with PHP code.


It means we can integrate the java with php but there are some restrictions.
Please guide me or suggest me the ways we can integrate those.

I want to learn how to integrate both of them...
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

There are a variety of bridges between the two technologies. PHP's own integration route comes with a big experimental warning on it. Others work round issues by serializing to and from a transport mechanism (such as xml).

Far easier to just write it in PHP.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
It means we can integrate the java with php but there are some restrictions.

As I said in my first post, it depends on what you mean by "integrate". If both are web apps, then you can pass parameters from one to the other through URLs, or using cookies. You can also use a DB as a shared common data store. As Paul said, integration on the language level is more complex and more brittle.
pradeep jaladi
Ranch Hand

Joined: Nov 21, 2004
Posts: 65
If i understand correctly, you want the feature like PHP talks to Java back and fort, if so then there is Bridge called javaBridge which is a open source and provides few examples how to integrate.


Pradeep.Jaladi
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
I'm not sure I understand the requirements either, but you may find the following document useful. It deals with sending HTTP POST requests from java. I haven't had time to try this yet, but it seems to me that this should provide a means for java to talk to php.

http://www.javaworld.com/javatips/jw-javatip34.html?page=1
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18139
    
  39

I know Java and want to create those modules in Java. apart from that all things will be done using php.
Only few things I want to modularize.


Regardless... to require a bridge, or any type of integration, because you happen to have one programmer that likes Java and another that likes PHP, is just silly. Integration of anything is a task that slows stuff down (and may even have incompatiblity issues), it should only be done where there is no choice -- such as the need to use a legacy system, or having a needed library that is not compatible.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Richard Robbins
Ranch Hand

Joined: Mar 07, 2001
Posts: 66
Hi Ramnna, Depending upon what level of integration you need, you could use Joomla! for your content management system. There is a Wrapper module available in Joomla! that would allow you to encapsulate Java functionality in the Joomla! CMS framework. I don't believe there can be any real interaction between the Java code and the php-based Joomla! code, but if you simply want to display a web functionality that was developed in Java on a php-based CMS, you might want to give this option a try. Good luck.


Richard Robbins is one of the founders of WebsiteTemplateDatabase.com, a resource for free website templates and Photoshop tutorials. He also consults for an online boutique selling baptism dresses and christening gowns.
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
I have recently given this sort of question a lot of thought for my own project. I have a (client side) java applet that I want to be able get data from and save data to mySQL on a remote server, using php as an intermediary. HTML plays a key role here. It should be noted that I am using a free web-hosting service that does not include proper tools like server side java or java-php bridge, so for that reason I'm not sure my research will help you.

It is relatively easy to use the HTML <param> tags to pass data from php script to java when the applet is first started, but that is not a true back and forth dynamic interaction, but it meets my needs.

you may find the following article helpful. It deals with sending POST requests from Java to a server side script.

http://www.javaworld.com/javatips/jw-javatip34.html I haven't actually tried this yet myself, but it seems to deal with what it is I want to accomplish.

Here is my thread on another forum where all this is discussed in more detail.

http://forums.x10hosting.com/programming-help/98082-using-java-mysql-x10.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java code sitting along with php.. assisting
 
Similar Threads
Trying to get JSP over PHP
Server side examples in book.
How to call PHP methods from Java
is there any E-commerce open source project in java?
Struts 2 and PHP Integeration