Dear Sir
I want to develop an application that will get the current market price of the stock using jsp.
The original question from asked only for “getting the current market price using JSP.” That left key decisions undefined (which exchange, real‑time vs delayed, license, rate limits). was right that a market‑data provider is needed, and correctly pointed out that JSP should be presentation-only. asked for clarification; the short, practical plan below fills that gap.
Use a server-side fetcher plus JSP display. Pick a provider (free/delayed or paid/real-time), register for an API key, and implement a scheduled task or servlet that polls the provider and writes the latest price to a cache or small database. JSP pages then read the cached value. This avoids long page waits, hides API keys, and respects provider rate limits. Note ’s point: many free feeds are delayed by ~15–20 minutes and are fine for display but not for trading.
Example sketch (Java 11+ HTTP client + Gson — adapt parsing to the provider’s JSON schema and store API keys in env/config):
import java.net.http.*;
import java.net.URI;
import com.google.gson.*;
HttpClient client = HttpClient.newHttpClient();
String apiUrl = "https://api.example.com/quote?symbol=IBM&apikey=API_KEY"; // replace
HttpRequest req = HttpRequest.newBuilder(URI.create(apiUrl)).GET().build();
HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandlers.ofString());
JsonObject root = JsonParser.parseString(resp.body()).getAsJsonObject();
// adjust path below based on provider response
double price = root.getAsJsonObject("data").get("price").getAsDouble(); Troubleshooting and cautions: watch for HTTP 429 (rate limits) and implement exponential backoff; verify symbol formats (some APIs require exchange suffixes); respect market hours; cache for a sensible interval to avoid hitting limits; read provider licensing if public or commercial display is intended. For example providers with documentation and free tiers to evaluate: Alpha Vantage and Finnhub.
Jump to Post— stephen84s 550Ehh. . . . . Ok Thanks for informing us about it ;)
Jump to Post— peter_budo 2,532Dear Sir
I want to develop an application that will get the current market price of the stock using jsp.
Please can you be more specific on topic. More explanation would be nice
- if you …
Ehh. . . . . Ok Thanks for informing us about it ;)
Dear Sir
I want to develop an application that will get the current market price of the stock using jsp.
Please can you be more specific on topic. More explanation would be nice
- if you not ready to help please do not leave such comments any more
Ok, For your problem
First you need a service who provide a directory/service/database for current stock market price.
Then you have to query it. You may need to register with the service provider. Search first for such directory service or web-service.
I will check if I find anything for u or not.
Not sure yet, I got your question
and of course you should not do anything except displaying the results from a JSP.
Or what you can do, if you know a RSS feed that provides, current stock price...you can parse that feed and collect your information.
You need to understand RSS feed format..and examine how that feed changes over the time.
Just parse it and collect the right information.
I just love the fact that not a single one of the replies actually provide anything resembling an answer. Try QuoteRSS. Its a simple HTML/Text/CSV generator that provided time-delay quotes (about 20 minutes) for one or more stock symbols
So you come in here months later, create an account, and start flaming people?
If you'd looked carefully you'd have seen there was no question asked at all, fool.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.