I have to make a web-service in Zend Framework for getting data from java applet.
Basically its a game built using Java Applet. I want to store result in my website's mysql database.
So I am trying to make a web service using Zend_Rest_server which will be accessed by Java applet code and I will get result data through web-service and will store them in MySql database.
Let me know if my concept is wrong. OR if I can do same task in another easier way.
I gone through some online tutorial for Zend_Rest_Sever but all are basic.
I made simple server for getting a variable value. But its not working in java application saying "Path not fond" Might be due to zend framework routing url.
Thanks in advance
Have you set the Zend_Rest_Route(s) needed?
You might want to check this out: http://mwop.net/blog/228-Building-RESTful-Services-with-Zend-Framework
Related
I have a program in Java using subethasmtp(a SMTP server library) to test if I can receive mails from another program correctly. I can get all the information that I want using this program.
Now I need to show all the information in a web page, what is the best way to do it?
I do not want a database to store the data, and I'm not so familiar with the front-end. Is there a way that I can push the information to my web? I want a light solution.
Thanks.
Try http://sparkjava.com/
It's a simple and lightweight Java web framework for rapid development. You can use it to generate a simple HTML page that display the data you have collected.
We're trying to make a mobile website that will be coded in JavaScript / PHP. We have a database that is queried and the results are retrieved using java code. How do I pass the results from my java code to the mobile website?
edit -
the java connects to the database, queries the results, forms lists and passes it to the php/javascript code, that will display it in the website. There's no actual processing required in the PHP code. It's more like a bunch of functions in java do the work, while calling PHP modules to display the result in a webpage.
When you say Java, you mean something like WebLogic or TomCat servers? I guess it's not the case. I guess you can host your Java code in one of those servers and create webservices, that will serve data to your frontend PHP servers.
See http://en.wikipedia.org/wiki/Service-oriented_architecture for the general idea.
Does anyone know of a good example with a Java web application that uses Scrutmydocs, or any other ElasticSearch Client. I have a sample web app running: www.TenantTalk.com that I need to add a search box to. The search will call Scrutmydocs or Elasticsearch. The Database will be much larger.
Right now it is a java jsp app using MySQL using JDBC and SQL on Tomcat. When a new record or change is made to the database it must make it into Scrutmydocs or Elasaticsearch.
You help will be greatly appreciated.
The login for www.TenantTalk.com is demo/demo
I have searched everywhere but cannot find an example that spells out where you call Scrutmydocs from a Java application when the user adds, edits, or deletes a record from the database and perform searches on that date.
scrutmydocs is not an elasticsearch client. It is a full web application.
It basically uses elasticsearch native client. So you can have a look at its source code.
That said, you probably want to look directly at elasticsearch java API documentation.
Also, this hands-on source code could help you. See answers branch.
I'm a student, and I'm trying to learn web development.
For practice, I plan to make a fictional school website and the only feature it has is register students to the school. Student provides his name and when he clicks the "register" button, his name is inserted into the database.
So I made index.html which only has a textbox and a button, and made an insert function in java that inserts student's name into the database.
But the problem is, how does the web part call the insert function written in java?
Is there a way to have java code on server side, and html/javascript/css for front-end for web UI?
I know that the practice question I put out can be done using php, but in the future, I would like to make the front-end using things like Metro UI, and server side code can get complex, so I plan to keep it in java.
You need a server capable of executing Servlets. For example, Apache Tomcat. You will need to install this on your web server to run Java servlets on the server side.
The easiest way to do this is Java Servlets. But if this Site grow up, you have to use , in my opinion, frameworks such as spring, jsf and so on.
I have a java program that runs on a couple different computers and I want to be able to be able to access them remotely. I don't need to do anything crazy, just some very basic input output (get and set type stuff). I could write a client type application and set each program to a server with RMI and do it that way but I will not always be on the same computer and do not want to have to carry the .java file around with me.
I'd prefer to write a simple php webpage that I can access from anywhere and have some very basic buttons that could send the commands to the different Applications and receive back some output.
Problems is that it would probably impossible to get my host to load anything other then php onto the server where I'd host my webpage.
Does anyone have any ideas? I've tried googling it and found a couple things out there that sort of sound like what I need but the more I look into them they seem to not be what I wanted after all.
If you really want to do this right I'd suggest looking at a Java web framework (I use Play! myself) to create a RESTful web service and then sending requests from your PHP code that will fetch JSON data.
A framework like Play will make it very easy to get a REST web service running. Just create some wrappers that invoke your existing java code and call renderJSON to output the result.
From the PHP code you'll issue the request using curl and then read the response using json_decode which will turn it into a handy php variable.
This also has the advantage that either end can be changed without the other noticing, as long as the json data format is kept the same.
Based on the way you described your setup you'll probably run into routing issues trying to reach your Java apps from your PHP host. I'd recommend you try something else: have your Java apps frequently check with your PHP app if there are any updates. You can simply use a Java URL connection and a timer:
http://download.oracle.com/javase/6/docs/api/java/util/Timer.html
http://download.oracle.com/javase/6/docs/api/java/net/URL.html