I need to use a .class file to encrypt data.What will be the php code for the following jsp line
jsp:useBean id="enc" class="Cryptn" scope="session"
or is there 开发者_如何转开发another way to do it?
Your options are:
- Expose the java functionality in a web-service and call the web-service from php.
- Reimplement the functionality in php.
I don't think you can create a new object from a Java class file in PHP. However, you can invoke arbitrary commands from PHP, such as commandline-stuff, i.e.: "java YourClass".
You might be able to use your class that way. Other options are the two @Klaus Byskov Hoffmann mentions.
You could take a look at the php/Java Bridge as a starting point.
精彩评论