Java and html again

i need a java code that is able to take an html file and return all the sentences which contain a word like for example finishing with *omics and then it saves the sentenses in a database                                                                                                                                                                                                                                                                                                                                                                                       

You can use a ParserCallback to get all the text in the Document.

Similar Messages

  • Java and HTML or PHP question

    I am not sure of my best course of action and would appreciate some input. My problem is this. I have written an application in java that communicates with a
    micro controller and passes information back and forth.I read info from sensors and relays and make changes to them. My current GUI is set up with tables to
    display this info. I am in the process of creating a graphics based interface to display the information in a web page but I am having trouble getting my
    java program to update the HTML page. I have considered using java to update a database with values and then reading the database with PHP and updating the
    HTML but I do not know how to get the java to run the PHP. I can use the java.awt.desktop API to display the html but I cant get it to display the .php files
    due to the server issues with PHP. I am not sure what I am looking for here. Javascript? AJAX? What I want is for the user to push a button that loads a
    web page and have java read that html file to determine which specific values to update, then update specific text boxes with those values from the
    micro controller. I already have the communication with my current java program. I know this is all a little confusing and convoluted and I apologize for
    that. I am just having a tough time formulating a plan of attack. Any ideas?
    Thanks in advance,
    Ray
    Any ideas are welcome and greatly appreciated.

    I am not sure of my best course of action and would appreciate some input. My problem is this. I have written an application in java that communicates with a microcontroller and passes information back and forth.I read info from sensors and relays and make changes to them. My current GUI is set up with tables to display this info. I am in the process of creating a graphics based interface to display the information in a web page but I am having trouble getting my java program to update the HTML page. I have considered using java to update a database with values and then reading the database with PHP and updating the HTML but I do not know how to get the java to run the PHP. I can use the java.awt.desktop API to display the html but I cant get it to display the .php files due to the server issues with PHP. I am not sure what I am looking for here. Javascript? AJAX? What I want is for the user to push a button that loads a webpage and have java read that html file to determine which specific values to update, then update specific text boxes with those values from the microcontroller. I already have the communication with my current java program. I know this is all a little confusing and convoluted and I apologize for that. I am just having a tough time formulating a plan of attack. Any ideas?
    Thanks in advance,
    Ray
    Any ideas are welcome and greatly appreciated.

  • Separation of Java and HTML in servlets

    I'm starting on my first Java project. It will be a basic table maintenance app using Java Servlets. My question is, what would be a good way to keep my servlet code separated from the HTML code that will be used to generate the pages I'll display to the users. Should I have separate classes that produce each type of HTML? Just looking for a place to start. Thanks.

    Yes it is good idea, essential even. There are three main ways to do this.
    1) Use a third party template system like TEA, FreeMarker or WebMarco.
         http://freemarker.sourceforge.net/
    http://opensource.go.com/Tea/index.html
    http://www.webmacro.org/
    2) Use the Model View Controller Pattern, the Servlet (the controller) processes the requests and dispatches it to a Jsp page (the view) containing beans that reference your data (the model). See this link ( http://java.sun.com/j2ee/blueprints/design_patterns/model_view_controller/index.html )
    3) Produce your own Template system; with page loader/Parser, replacing the relevant 'custom tags' with the correct data.
    My best solution depends on your circumstances,

  • Java and html

    Hi,
    Does anyone know how or where I can find information on how to create a html file with the use of Java.
    Thanks

    Hi,
    What I ment to say is: can I use
    createTempFile(prefix, suffix, File directory)
    to create a .html file. I suppose I can.
    Thanks for the reply

  • XML to Java and back again

    Okay, I've seen this question asked many times and I don't see a lot of great solutions. I've been searching for the last hour and looked at xBeans, XMLBeans, xStream, you name it. Anyway, what I want to do is model my XML and Java objects (if I can't auto-generate the classes) and then at runtime the XML should be loaded directly into the data model. I know that writing a custom parser is old school and there are tools to do this for me but I can't seem to find what I need. What do you recommend for doing this?

    Check out the Commons Digester.
    The Digester package lets you configure an XML -> Java object mapping module, which triggers certain actions called rules whenever a particular pattern of nested XML elements is recognized.
    You can't get any better than this....in my opinion.
    Good Luck!

  • Where can I find the Java SE 6 runtime download so I can get Adobe Photoshop CS5 up and running again.

    Where can I find the Java SE 6 runtime download so I can get Adobe Photoshop CS5 up and running again. I have to go this route. Currently on my Mac, I need to be running Java 7.65 for work-related stuff. I went to the Java site, but could not find anything that simply says "Java SE 6 runtime" ... Or, is there another way to get CS5 up and running with my recent Yosemite download?

    No, I can't go that route. I have to stick with my current Java 7.65 ... Our IT department said just to download SE6 Runtime separately ... If I was understanding that correctly. Or, can you have two different versions of Java running ... 6 ... and 7.65?

  • How do I mix text and Html format in a java mail?

    How do I mix text and Html format in a java mail? some part I want to keep the text format, the other part I want to use Html functions(like fond, color, etc)

    You don't mix them. Pick one or the other.
    However if you want to have a text version and an HTML version, so that mail readers that don't handle HTML can see regular text instead, then you could produce a "multipart/alternative" message. There's an explanation of how to do that in this article:
    http://www-128.ibm.com/developerworks/java/library/x-xmlist2/

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • Differences between Java Web Start and HTML-Applets???

    Hi,
    I'm trying to get information about the differences between JWS-Applets and 'normal' HTML-embedded Applets.
    Is it possible to develop both simultaneously in one project???
    Is there a Programming-documentation that describes the differences between JWS and HTML-Applets???
    Thanx!
    Rembrand

    Check out the link shown below:
    http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html
    All you need really is to create a JNLP file to launch your applet/application.
    ;o)
    V.V.

  • [Java and all else] How do you document DB design?

    Hello,
    Although most of the technical choices are explicit in SQL (UniqueKey & ForeignKey constraints, indexes,...), the semantics of the data columns and their constraints seem better served as plain human-readable comments ("ID column: identifies the plane copy; 6 figures are enough as we don't expect to sell more than 1 million planes in a foreseeable future...").
    In my current system, (EJB-based, but the DB schema is not created by the JPA-compliant ORM, but via SQL scripts), I see the following ways to write and maintain this documentation:
    - SQL comments in the schema creation and patch scripts
    - Javadoc comments in the Java source of the Entity classes.
    - UML notes in UML diagrams(1)
    - external "Architecture and design" document.
    All 4 of them are used, sometimes inconsistently, for various parts of the design choices; I mean, the docs do not contradict themselves (not yet, but it's a mere question of time), but some tables are commented in SQL scripts, others are in design docs, and the details for some columns are in entity javadocs. Although each developer may find it handier to "write" the doc via his preferred medium, it becomes increasingly difficult to "maintain" theoverall documentation.
    Our current situation is that most of the project team members are Java developers, so it would probably be better accepted and served if we standardized that we document DB tables and columns in Java source, but I am worried that:
    - someone else pouring over our DB (ex: DBA helping us to optimize things, or other team developping a data-mining tool to leverage the historical data in DB) may not be as comfortable with Java
    - this may not cover all design choices of the DB schema:
    - - - - first, although that is the case currently, in the future there might not be a 100% 1-1 mapping between e.g. each entity class and a DB table. Maybe some columns will not need to be mapped anymore,...
    - - - - second, I fear some DB constructs are not amenable to Java counterparts; no accurate idea there, I'm not an SQL nor JPA expert, but I presume Indexes, table partitioning, tablespaces, for example (yes, the DBMS is Oracle :o) are not taken into account in JPA mapping.
    And if we document those choices at the SQL level (my preferred idea so far), this will gradually make the javadocs in the entities obsolete, or removed altogether, and that will make future maintenance of the Java source risky.
    How do you document your DB design in general?
    Do you have specific advices for my case?
    Thanks in advance,
    J.
    (1) Just for the record, here are a few posts that refer to modelling the DB in UML:
    [A post on this forum highlighting that UML 1.4 standardizes a notation for RDB modelling|http://forums.sun.com/thread.jspa?messageID=1383724#1383724]
    [A DB modelling tutorial|http://www.tomjewett.com/dbdesign/dbdesign.php] (not sure whether it leverages the standard mentioned above :o)
    P.S.: "Java and all else" as in, damn, I'd love to use the familiar JDC forums and people to discuss not only Java-related issues, but also [all other things that surround Java|http://forums.sun.com/thread.jspa?threadID=5422264&tstart=0] (other technologies, processes, people) and enable to make workable systems out of Java code.

    jduprez wrote:
    Thank you again.
    A couple more questions:
    2. Table, and proc dictionary maintained as one or more text files. Those files and schema are all in source control.Do you mean, a proprietary text format (a la tabledesign.txt), or +.sql+ source files? Again, you seem to suggest the scehma info is present in two locations.I didn't say two locations unless you meant files. Then yes.Yes I meant two files. I trust the team to get the doc file lagging a few revisions behind the SQL file, and to correct that I would have to include one more step in the review process (e.g. "review CM actions to check that the doc file is updated consistently with the SQL source").
    The tool I wrote would throw errors if the comment file didn't match the schema. And if comments were not provided. That of course doesn't stop someone from documenting a table with "a table".
    You can of course keep the addtional info as special comments in the SQL, but when I did this, and even in retrospect, it seems better and perhaps easier to keep them seperate. I have done special comments in SQL before and it seems a bit of a kluge but you do have the single source. But in that case I was the only one maintaining it too.What do you mean by "special"?For code generation I have a schema file with the following (pseudo sql.)
        create mytable
           mytable_id int,
           column_foo varchar(10);
           column_fum varchar(20)
            -- Query: for_a_query (column_foo, column_fum)
        )The generator consumes the schema and generates the standard CRUD which would include a query based on the primary key.
    The above comment is used to provide an additional query where the proc is named 'for_a_query' (munged with table name) and takes two parameters (column_foo, column_fum) whose type/name matches those of the table.
    If we don't try to generate a browseable HTML out of the schema (although the idea is appealing, I don't have the resource to make such a tool), do you see anything kludgy in maintaining SQL comments interpersed within DDL code?
    Of course that is doable.

  • Java and SOAP

    I am trying to use Java and SOAP to call a Coldfusion CFC file. The problem is that I can not figure out how to call the coldfusion function by using a url to direct the SOAP request, within java. The cfc file does sql queries on a separate network so I need to send a string parameter to the function and be able to return one back to the java program.
    I have done a lot of internet research and I can not get it to work out right. My coldfusion is working correctly.

    But the Coldfusion server would still have to present a "service". This could be using web services or it could be something as simple as a small HTTP based page to take the parameters and pass back results. Somehow the Coldfusion server must present a service for this to work.
    Think of a standard HTML page with a form on it. What you're describing is similar to that - you take in parameters (the HTML form) and return results (the result from an HTTP POST). Coldfusion is acting as the web server and your Java client is acting as the browser. Until the Coldfusion server is ready to accept requests (in your case SOAP formatted requests) there is not point worrying about the client side (the Java client in your case).
    Is the Coldfusion server presenting something that can run the CFC file and return the results? Again, it could be a web service or even a REST-like service (like I described above) that your client could talk to.

  • Error using java and javascript

    I have a jsp page that links to a bean and is working fine (getting data from the database).
    On a html form I have a button with a picture that fires off javascript when clicked:
    <BUTTON TYPE=reset onclick=showinfo('<%=index%>')>
    <IMG SRC="http://localhost:8080/Portal/Images/q2.bmp" ALT="Info">
    </BUTTON>
    The javascript function just opens a new window and displays the text sent in:
    <Script Language=JavaScript>
    function showinfo(arrayindex)
    InfoWin=window.open("","InfoWin","width=345,height=220");
    InfoWin.document.write(arrayindex);
    return false;
    </Script>
    Well in the above example index is a number (pulled from the database using a java bean and javascript converts it into a string then the function displays it correctly. If I replace <%=index%> with regular text it works fine as well(because java isn't used to pull data)! The problem occurs when I retrieve text data from the database and send it to the function. The web page gives errors about a nonterminating string. But I can move the code to somewhere else on the form(as long as I don't send it to java script) and it will print the text to the screen. I can also view the source of the web page and the html shows the text from the data base as if I hard coded the text into the javascript!!!!!!!!!!!!!!!!!
    This must be a bug between java and javascript!
    -can pass numbers(from a database) between the two
    -can't pass text (from a database)between the two
    Any info would help!

    Found the problem myself!
    I am using an odbc connection to msaccess and the spaces in the text was messing things up!
    After taking out the spaces it worked again.

  • Java and Flash not working ONLY in Safari

    Ok, so Java and flash stopped working in Safari on my 10.6.8 system. It seems a recent update caused a problem and all of the normal items I have gone through have made it worse or not helped.
    Java is not working in Safari (My account or guest account)
         http://javatester.org/version.html    Error "attempted to load Java content, but Java is unavailable or not installed."
         http://www.java.com/en/download/testjava.jsp " attempted to load Java content, but Java is unavailable or not installed."
         http://www.adobe.com/shockwave/welcome/  Error "Missing plugin"
         Flash tests just say missing plugin
    Java DOES work in Chrome and Firefox
         http://www.java.com/en/download/testjava.jsp
              Java SE 6 Update 31
              Flash - 11,2,202,235 installed
    Able to use apps and other items online that are not working in Safari.
    Have downloaded and installed the following and done the following
         Ran software update
         Verified Java and Java Script are enabled via Safari > Preferences > Security
         Re-installed Java for Mac OS X 10.6 Update 8
         Reinstalled current version of flash
         Looked around and deleted all plist, and java folders in library locations (user and main system)
         Cleared out metadata folders
         Reset Safari several times
         Java Preferences
              Cleared all cache
              Made sure no old versions there (2 entereis)
              Reset all defaults
              Removed any blocked items
    Current Java version per terminal
    java -version
    java version "1.6.0_31"
    Java(TM) SE Runtime Environment (build 1.6.0_31-b04-415-10M3646)
    Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01-415, mixed mode)
    So - Java is up and working - works in Chrome and Firefox. Have reinstalled both from current versions. Reset all browser cache. Issue follows Safari. Normally installing these and trying again works. I do not know what other things to reset or clear out.

    baltwo wrote:
    I thought the OP already went through the preferences app.
    Yes, I got distracted for a moment with something, came back and I didn't finish reading the OP's original post, I have since edited mine.
    BTW, the Mozilla plug-in checker is basically useless for Safari users, since have of those I have have no status, but work in Safari:
    I don't know the causes for the "Research" one's, why there isn't a link or why it doesn't update the checker,
    But at least it's infomative, as vulnerable plug-ins are responsible for MacDefender and Flashback malware attacks.
    Someone with a lot of plug-ins should be running Firefox and NoScript, as your very exposed to multiple attack vectors from any of those plug-ins, which is the purpose of the web site, to get the word out about outdated plug-ins with potential security issues.

  • Is it possible to install JAVA and ABAP trial ??????

    Hi
    i have read some posts in this forum which say that it is possivel  to install a full stack ABAP + JAVA with EP. But some of this are from 2006, and the versions that they installed are not the same anymore.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/cfc19866-0401-0010-35b2-dc8158247fb6">sdn Downloads</a>
    my question is, Can I install ? :
    Java Full Edition trial - SAP NetWeaver 04 SP16
                           +++
    SAP NetWeaver 2004s ABAP Trial Version (incl. Web Dynpro ABAP) - SAP NetWeaver 04s SP11
                            = ???????
    by the way, thank very much for you support to the newbies in the forum

    Hi Pedro Vieira,
    At May/24/07 I finished the ABAP + JAVA installation with success (see versions below):
    From  "Downloads" / "SAP NetWeaver Trial and Preview Versions"
    1) SAP NetWeaver 2004s ABAP Trial Version (incl. Web Dynpro ABAP) - SAP NetWeaver 04s SP11
    2) SAP NetWeaver 2004s Java Trial Version - SAP NetWeaver 04s SP9
    As Mr. Heilman said, FIRST ABAP THEN JAVA, I tried JAVA + ABAP install (3 times) with no success, JAVA worked but ABAP not.
    My config: Windows XP PRO SP2 (last updates); Cpu Intel Dual Core 3.0GH; RAM *** 2GB ***; 2 HD's with Dual Boot (C: and D:).
    The installation was done on "D:" with a NEW AND CLEAN WinXP installation, only the basic (drivers, WinXPPRO updates). "D:" is my test "machine"/driver.
    Note1: To keep the previous successfull installation saved (WinPro, ABAP , JAVA), I used Mr. Petra Schmeil Tip (See link01 below) "...for instance with
    Norton Ghost or something like that. Just keep in mind!..." and allways keep a IMAGE COPY from my D: driver before and after a succesful installation. (See link 01)
    Install:
    1) ABAP stack installed with no problems, just follow the instructions.
    2) JAVA stack; that was hard to me. I tried at least 3 or 4 times. If I got a problem, I recovered previous IMAGE COPY (ABAP install succesfull) and started again.
    Some tips for JAVA stack:
    a) Use "j2sdk1.4.2_09" as recommended in documentation.
    b) Before start installation, set your clock to "GMT +1" (see Mr. Erin Richason Tip, see link02 below)
    c) If in step 2 you get the error:
    INFO[E] 2006-11-22 21:29:36
    FSL-02077  File system export (share) saploc does not exist.
    ERROR 2006-11-22 21:29:36
    FJS-00003  TypeError: this._name has no properties (in script NW_Java_OneHost|ind|ind|ind|ind, line 8987: ???)
    ERROR 2006-11-22 21:29:37
    FCO-00011  The step collect with step key |NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0|collect was executed with status ERROR .
    INFO 2006-11-22 21:31:23
    An error occured and the user decide to stop.\n Current step "|NW_Java_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_GetSidNoProfiles|ind|ind|ind|ind|1|0|collect".
    Folow Mr. Curd Abstoss  tip "In line 23234 stands this._name = name; . I changed it to this._name = "L013"; where L013 is the name of my laptop" (See link03 below)
    d) After ABAP and before JAVA install, stop all SAP* services
    e) If port 3601 or 3201 (don't remeber wich) is in use (by ABAP), exclude it from .../drivers/etc/services (see System Requirements at JAVA).
    e) After JAVA sucessfull install, if port 50100 dont work use 50200 (instead "http://localhost:50100/" use http://localhost:50200/).
    That was MY recently experience, I hope it is useful for you.
    PS. Sugestion, before start, read the topics (links below) and the documentation (***Trial\DOC\html\index.htm) for ABAP and JAVA.
    link01 - ABAP and JAVA version of NW2004s sneak on the same system - Posted: Jun 22, 2006 2:32 AM.
    link02 - NWDS can't install - Posted: Jun 7, 2006 5:23 PM.
    link03 - Inst. SAP NW 2004s Java SP9 - Error FJS-00003 this._name has no properties - Posted: Mar 7, 2007 11:18 AM
    Best regards,

  • Need Help w/ Java and Mozilla on SuSE 8.2

    I am completely and totally new to Linux. Until not very long ago the only computer I ever worked with was MS. I'm running SuSE 8.2 Professional.
    I used (after much trial and error) the rpm program to remove Mozilla 1.2 (which is installed by default). This is a machine at home so I have root access and regular access. I downloaded Mozilla 1.3 and installed that without a problem. I download j2sdk 1.4.1.02 (I'm pretty sure those are the numbers). I followed the instruction on how to install java and it appears to have worked correctly. I don't know how to test but there is now a directory called j2sdk1.4.1_02 which has several files and directories inside of it (including jre). I also followed the instructions and installed the java web start program.
    Anyway, I've searched the forum for information that would explain how to make mozilla work on website that use java. Most of what I read was greek to me. But there was one that said I should copy the libjavaplugin_osi.so file into the mozilla plugins directory. I did that and when I looked at the "about plugins" page (from Help in Mozilla), it showed a lot of java files. But when I go to any pages that are using java, the page starts to load and then closes. This happened on about 6 different pages (all different web sites). So I think something went wrong. A friend had told me I'm going to have to make a "symlink" (which I don't know how to do). But he's on vacation and won't be back for 2 weeks.
    Can anyone help?
    Here are the directories where everything is stored. Oh, by the way, when I installed mozilla, java and javaws, I did all of it from the root account. If that was wrong, tell me and I'll fix it.
    mozilla is in:
    /usr/local/mozilla/
    java is in:
    /usr/local/java/j2sdk1.4.1_02/
    javaws is in:
    /usr/local/java/javaws/
    Again, as I'm sure you can tell, I'm lost, totally new to linux, mozilla and java. So if you can help, please explain as clearly as possible.
    Thanks in advance.

    Your friend is correct, instead of copying the .so file you should have made a symbolic link. To do that, first remove "libjavaplugin_oji.so" from "/usr/local/mozilla/plugins"; it's on the way. Then create the symlink with the "ln -s <source> <destination>" command, with your configuration it should be something like:
    ln -s /usr/local/java/j2sdk1.4.1_02/jre/plugin/i386/ns610/libjavaplugin_oji.so
    /usr/local/mozilla/plugins/
    (you need to be root to do that)
    To set up web start in mozilla, it might be easiest to go to the demo page and try to launch one of the applications:
    http://java.sun.com/products/javawebstart/demos-nojavascript.html
    When the "what should mozilla do with this file" dialog pops up, click on the "Advanced" button and make Mozilla handle it with the javaws application. Optionally remove the cross in "Always ask before opening .."

Maybe you are looking for