Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code sitting along with php.. assisting

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you already have a PHP application, why use Java?

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Fred Hamilton
Ranch Hand
Posts: 684
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21510
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Richard Robbins
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Fred Hamilton
Ranch Hand
Posts: 684
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic