Webservice to show Java frame [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need some suggestions if the below idea for my web-service is feasible and if so, some pointers on how to implement the same.
Web-service Request: Request number
Web-service response: Java Jframe popup on users desktop with details of the request queried from the database.
This web-service would get triggered by clicking on an hyper-link in email notification sent to the user.
I cannot write any code on the client side to read the web-service response and then populate the Java frame.
So is it possible for my web-service to pop-up the JFrame on the users desktop when they query the web-service?
If so, how would I configure my response in the WSDL?

The web service runs on the server, the JFrame would run inside a different JVM on the client. So no, the web service can't trigger a JFrame to be shown on the client.
In fact, the web service can't force the client to do anything whatsoever. What the client does with whatever information the web service provides it is totally up to the client, which can be anything, from a Java Swing application (which could use it to display something in a JFrame) to another web service written in Perl (which would likely use it as input for another call or response to something) to an ASP web application (which might display it on a website as a graphic or table of data), to an Oracle SQL query (which may use the result to enter data into a database table which might in turn trigger something else to send an email for example).
That's the very nature of web services, they're utterly agnostic of what and who calls them.

Related

Broadcast a popup message to all online users Java,Jsp [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i wish to add a functionality to my website that is to send a pop up message which i've typed, to all online users . i am able to get user id's of all online users. how could i send message in a jquery pop up to all users. Any one please give me an idea..
The solution to this requires 3 components:
First you need to make sure that whatever is typed is sent to the server. The easiest way is just via an Ajax call whenever you're done typing (or hit a button)
Secondly, you'll have to store the message(s) on the server including what users you've already distributed the message to. This can be just in memory on the server or in a database or file.
Lastly, each of the participating users will have to have a mechanism for retrieving the messages. The easiest way is just to have an Ajax call every 10 seconds for instance which asks the server if there are new messages. If there are they are returned and displayed in a popup.
The server can then mark the message as being sent to that user as well as keep a list of users that are active.
Note both the Ajax communications could be replaced with websocket connections if you want ultimate performance, but they are somewhat harder to set up, so I'd only recommend that if you have many users or many messages.
You can simply write an asynchronous script, that runs in the background, requesting from an API, and if it gets some valid response from API, you can popover a message via jQuery!

How to add java code into a Static web page? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to create a static web page (same content to all clients).
In the meantime, I want to run the site as follows:
- Double click on the html file. (So if I'm not wrong, I don't need server side, i.e apache tomcat).
(I want this for now, in order to make progress in logic)
The static web page will contains:
browse button
OK button
(by 1&2) when the user choose a file and click OK I want to open a tcp connection to a remote appliation and exchange some data.
Several Q's:
How can I use java code (to send/recive messages) in HTML files (after the user click on "OK") ?
Do I need to use JSP & TOMCAT ?
(I want somthing that will be use for my interest only, and will not be as a internet web page)
If you reliably want to run code on a web page without interacting with the web server to do so, you need to use a language native to the browser.
As of 2015 that would be Javascript (which is a very different language than Java).
Interacting with the web server is then typically done with AJAX calls, where the part of your code running inside the browser exchange data with the part of your code running inside the web server. The front end code is again typically written in Javascript and the backend code in whatever the web server supports.
Note that after you have done some initial experiments, most likely will need a framework to make this easier to do for non-trivial behaviour.
#1: I am not sure what you are heading for, but Google Web Toolkit could help. Basically it splits your application in a client and server part, all written in java, but the client part gets compiled to javascript. This way you can develop all in java and bootstrap it within ANY html page.
#2: Easiest way would be to write the server in java and host its war-file with a jenkins. But there are much more possibilities including a non java server.

Connecting and fetching data from mysql using angularjs [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to angularjs , can anybody guide me in performing CRUD operations in MYSQL and display in html form using angularjs... to be more precise... I want to store information to customer details such has name,consumer number,contact,address and update the same whenever necessary using java..
Hello and welcome to SO,
I created this diagram in order to make you feel more comfortable with the subject.
As you may see I didn't mention any language: Client, Server nor Database, because the language itself has nothing to do with REST APIs.
Instructions - begginer:
(If you are using PHP, I'd recommend SlimFramework, which is the light, scale, easy to start with, PHP Framework).
1) Pick a server-side language.
2) Create a Database Resource.
3) Pick a Server Side Language.
4) Create 4 Scripts that each does one of each:
Create,Read,Update,Delete.
5) Connect endpoints with each of the scripts, URL -
GET,POST,DELETE,UPDATE.
6) Verify that you can access each of them from the web (authenticated
or not).
7) After you verified that endpoints are working, time to connect
Angular:
7a) First try to create buttons for each action, and link it with
$http.get, $http.post, $http.delete, $http.put actions.
7b) Once it's working you might wanna step up and use ng-resource or
restangular.
P.S: I didn't supply much code information since once you understand what I stated on top, you'd realize that writing code for that isn't really hard.
After you complete these ,
You might wanna start with: Server side and Client side authentication, Performance, Multiple resources and collections, CORS and preflighted requests, and so on.
Good Luck.

Difference between Applet and Servlet and their usages [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What is the difference between an Applet and a Servlet and what are a few examples on how each of them are used? I am new to networking am I am wondering how these things are different.
From Wikipedia: A Java applet is a small application which is written in Java and delivered to users in the form of bytecode. The user launches the Java applet from a web page, and the applet is then executed within a Java Virtual Machine (JVM) in a process separate from the web browser itself. Applets are used to provide interactive features to web applications that cannot be provided by HTML alone. They can capture mouse input and also have controls like buttons or check boxes. In response to user actions, an applet can change the provided graphic content. This makes applets well-suited for demonstration, visualization, and teaching.
A servlet is a Java programming language class used to extend the capabilities of a server. Although servlets can respond to any types of requests, they are commonly used to extend the applications hosted by web servers. Servlets are the Java counterpart to other dynamic Web content technologies such as PHP and ASP.NET. In other words, a Servlet is an object that receives a request and generates a response based on that request.
An Applet is for client side execution, generally graphical components.
Servlet is for server side execution, with no graphical components, but can return HTML or any kind of data (generally called a service).

Send Request to server side [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm developing a Java Desktop application with MySQL Database, I have searched the internet for days, i need to do the following:
(Client) Desktop application for client will have the GUI.
(Server) Tomcat Server With Servlet.
(Database) MySQL Database server.
Client send request for query in servlet, then servlet response to the client with result which will be filled in database.
No SQL Queries, Updates, Inserts, Delete ... etc will be exist on the client side, all will be in the servlets.
Is this the best way to make 3tier application?
Can I use Another idea or technology to achieve this?
I don't want to go for web application.
I need client send request to middle server, which will connect to database & getting the result then send them back to the client without letting the client connect directly to the database.
Note: The client will be used by Multiple users in same LAN.
A web application which is hosted on a server typically uses HTTP as the communication protocol. So if you want to build your GUI using Java then you will be sending http request on user actions and receiving http response which would be translated to updates on the GUI. You should perhaps use a library such as Apache HttpComponents to send/recieve http response. For creating/deploying a servlet web application you can find lots of tutorials. However these days people use MVC frameworks like Spring MVC ,Struts, JSF etc., as a web application framework which helps immensely in developing web applications.
As your requirement is that there should not be any SQL data access related code on your Client side, all the data access will need to be done on server side and your server side should send an accepted data format (xml/json) to your GUI in the http response which you will need to parse (there are many libraries to parse xml/json) and extract information from.
So your GUI will not be doing any resultset handling. It would be done by the server (inside web application) and the web application would send the xml/json response to your GUI request.
The architecture you are trying to develop in typical thin client architecture. You can imagine your Java GUI as a replacement for web browser.

Categories

Resources