open HTML page in java Midlet using NetBeans 7.2.1 - java

As school project I need to develop a java Mid let that will ask for a URI. Then the
application will make an HTTP connection using the given URI and retrieve a HTML
page, and display it to the user.
I am able to give the HTML link but it displays the HTML code when I run the application.
i am using java net beans
Thanks, any help is really appreciated

What you actually need is to open native browser and show HTML page in it. This can be done using platform call:
getInstance().platformRequest("http://bombusqd.hdd1.ru/m/")
getInstance() is a method of MidLet.

Related

(Java) Is it possible to read Internet Explorer form data?

I'm just getting started with this process, but figured I'd ask if it is possible with only Java.
At work, we use an intranet for much of our work. I am developing an application that uses some of the information from those websites. However, we currently need to copy from IE and paste into my JavaFX application.
I was wondering if Java provides any sort of integration with the Windows API that would allow me to automatically pull that data from IE to my app.
For example, there is a web-based form with several textfields; I want to be able to capture the text that is written in them, programatically.
EDIT: I do not have access to the website code directly.
mmm i dont think it work that way,
you can make a java scraper , who is a program to get the code html of a certain page, but you cant get data from a form, because the clients are diferents.
maybe you can send from web client form the user/password to an app, but you cant make an intrusion from app to a form who is in a web page with content in the value of form fields
So you need to get form data from IE but you can't put code into the website. It sounds like a task for a plugin. Consider developing your own plugin or extension (probably in javascript) in IE.

adding a parser to a java applet that works as a web browser

I am trying to make a web browser that works entirely on voice commands (i.e speech-to-text and vice versa using sphinx.)
I have a Java applet, but I don't know how to add a parser to it so that different parts of different websites go to a particular segment in my browser.
What are the necessary steps to add a parser to a web browser applet?
You don't need java applet, it creates too many issues. You need something like pocketsphinx.js:
https://github.com/syl22-00/pocketsphinx.js
This technology can give you access to content of the browser with javascript, a way easier way to manage things.
Now i am able to make a fully speech based web browser. I used Jsoup for extracting various elements of any web page. Then with the help of sphinx and freetts i allowed users to interact with browser by using speech commands only.

How to create a desktop application to mimic what I've already written in PHP?

just looking for a point in the correct direction..
So I've developed a little application on the back end of our websites that allows the girls in our office to send out letter-headed PDF quotations to our potential clients via email.
I've done this using a simple HTML form, the FPDF class, and the php function mail()
It works a treat, but I'd like to take it a step further and create a desktop application so that the girls don't have to go through the login section of the website to access this functionality.
I'm thinking Java?
Would this be a difficult mission someone who has only had web-developing experience?
It would only be the smallest/simplest of applications.
Thanks for any input :)
This is just an advice.
Since you have already developed something that works over web, reuse it.
Convert the PDF converter into a service to upload and retrieve file. This service should return a token_id that can be used later to download the converted files.
Write a Java app using Swing that merely uses this web service. The logic in this application should be (a) browse file from computer, (b) Use web-service upload URL to upload the file and rec/eive appropriate response like upload_token_id and status uploaded/converted/failed, (c) the Java app, should be able to use this token to download the converted file.
You may need to look into this for help related to uploading the file
No it wouldn't be difficult job to mimic your app to java desktop app that can be Java Swing APP. you just need some practice on swing. As you are doing in php that is creating PDF and mailing it. This task can easily be done in java swing by using Java Mail API for emailing and IText for pdf generation.
For reference you can read following links:
http://www.javabeginner.com/java-swing/java-swing-tutorial
http://zetcode.com/tutorials/javaswingtutorial/
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/
http://www.oracle.com/technetwork/java/javamail/index.html
http://java.sun.com/products/javamail/javadocs/index.html
http://www.javacommerce.com/displaypage.jsp?name=javamail.sql&id=18274
http://viralpatel.net/blogs/2009/04/generate-pdf-file-in-java-using-itext-jar.html
Hope this helps.

How can I get html content from a browser that can do the html correction and js scripting?

I need a solution for getting HTML content from a browser. As rendering in a browser, js will be ran, and if not, js won't be ran. So any html libraries like lxml, beautifulsoup and others are all not gonna work.
I've searched a project named pywebkitgtk, but it's purpose is to create a browser with a front end.
Is there any way to put a url into a "fake browser" and render it and run its all javascript and save it into a html file? I don't need any front-end, just back-end is ok.
I need to use Python or java to do that.
selenium-rc lets you drive an actual browser for your purpose, under control of any of several languages at your choice, which include both Python and Java. Check it out!
For a detailed example of use with Python, see here.

include a cpp file in jsp

i am very new to jsp... i am currently doing a project where i have to interface a card reader with my html page.
i got the card-reader code in a cpp and .h file. is there any way i can use these file with my jsp.. or do i have to recode it in java and include a .js file.
specifically, i have a text input for ID on my page. i need it to be populated with the input from card. i got the code to interact with card and extract that number in cpp program. so can i like call that function from my html page?
Why on earth you need to interface your card-reader to your JSP page. It doesn't make any sense to me, I am sorry. First understand that JSP is a Java web technology for presentation, which runs on server and spit HTML to the browser. Hence, what you get on the client is HTML.
Now, could you please elaborate what you are trying to achieve?
There are several way to do this:
You could do a system call from your jsp if your C++-code can run standalone.
You could use a Java-C++-bridge.
You could use the Java Native Interface.
You will have to look into the Java Native Interface if you want to reference C++ code from java.
For more information see the following:
Wikipedia
API Guide
Nice Guide in PDF format
A jsp renders HTML, in the part you will see in your browser you are no longer in your jsp, you are not even in your code anymore.
If you want to read a card from an HTML page you will need to ignore the fact you have jsp technology and realise its HTML technology you are using.
SO you will need an applet, some flash, some activeX or other browser technonlogy first before even trying to interface with the cpp
if you need to read from card JSP cannot help you. If you read card number otherwise and send it to JSP with POST, then you do not need any reading. What you might need is signed applet on user's side which will try to read card from card reader. Then I will advise you to use javax.card - java 1.6 has a support for reading smart cards ...
http://java.sun.com/javacard/

Categories