Writing a java webcrawler

hi all. I am looking to write a webcrawler in java, that will need to crawl the barclaycards official fantasy football website (fantasy.premierleague.com) and store specific player statistics in some form of database (maybe SQL). I would really appreciate it if somebody could give me a few hints on getting started. Will i need to write an html parser to collect the data? If so, where should I look to assist me with this? Also, how do I collect the specific data rather than website links that most webcrawlers store.
regards,
Jon

do not need all the "hyperlinks" in the page but only the hyperlinks which
match my text.. For ex:only the hyperlink with the word "Login" in my example..
How do i do that?It took you a grand total of 7 minutes from the time I posted the suggestion until you posted your reply. You obviously didn't take any time to think about a possible solution on your own.
If you can parse the link out of an HTML page do you think there might be a way to parse out the text related to that link? I'll let you read the API and try to figure out a solution. You learn by trying and making mistakes.
You don't learn anything by asking people

Similar Messages

  • Need help writing a Java rule in PDF Forms

    I have created an invoice for my contractors via "forms", and in turn made each cell either a drop down list or "read only" field so they cannot change the rate of pay, etc.  Here is my issue...My first drop down cell is titled "Job Description".  When the contractor selects one of the 8 dropdown options within the Job Description field, I would like it to automatically fill in the hourly rate that is associated with that particular job description (or skill).  I currently have my "rate" cell as a drop down, and I want to make that a read only, and when you select the A1 position from Job Description, it will populate the "rate" field with the appropriate amount for that A1 rate.  I believe this can be done with writing some Java script, but I have never played with Java and I don't really have the time to teach myself.  If anyone can help with me a quick tutorial, or even the formula I should use, so that I can just plug and play, that would be super helpful.  If this is a time consuming issue, I would be interested in paying someone to do it for me. Thank you!

    Hi George,
    I was able to copy my data over to a fresh document, and now it works just fine....thank you so much for your insight and help!
    I have another question if you have a moment. 
    I am trying to do a simple calculation of start time and end time for my employees.  Do I need to do this via a javascript, and if so, what area in properties of the result field should I copy it to?  for the purpose of the script, the fields are as follows:
    DataField1 = start time
    DataField2 = end time
    DataField3 = total time
    I would like to use the h:MM tt format for my time fields if possible.
    I've attached a link to the file through my dropbox account, and you'll notice that I created three new fields at the top of the invoice just to test the time calculations before i mock up the whole document.
    Dropbox - Contractor Invoice Template (1).pdf
    Any help you can give me would awesome! 
    Thank you!!

  • Java.io.WriteAbortedException: writing aborted; java.io.NotSerializableEx

    <b>anyone can explain this
    i want to modify a value and hits this problem
    </b>
    [20070828 10:58:27:125] E [AppLog/MI/API/Services   ] java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
    java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
         at com.sap.ip.me.api.services.IOUtils.readSerializedObjectFromFile(IOUtils.java:934)
         at com.sap.ip.me.api.services.IOUtils.readHashtableFromDirectory(IOUtils.java:835)
         at com.sap.ip.me.sync.InboundProcessorRegistryImpl.<init>(InboundProcessorRegistryImpl.java:66)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at java.lang.Class.newInstance0(Class.java:308)
         at java.lang.Class.newInstance(Class.java:261)
         at com.sap.ip.me.api.conf.Configuration.createInstanceForType(Configuration.java:512)
         at com.sap.ip.me.api.conf.Configuration.getSingletonInstanceForType(Configuration.java:457)
         at com.sap.ip.me.api.sync.InboundProcessorRegistry.<clinit>(InboundProcessorRegistry.java:78)
         at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.initializeSmartSyncFramework(SmartSyncRuntimeManager.java:132)
         at com.sap.ip.me.core.FrameworkInitializer.initSmartSync(FrameworkInitializer.java:883)
         at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:367)
         at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:126)
         at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:139)
         at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:46)
    Caused by: java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.ip.me.api.services.IOUtils.serializeObjectToFile(IOUtils.java:875)
         at com.sap.ip.me.api.services.IOUtils.saveHashtableToDirectory(IOUtils.java:801)
         at com.sap.ip.me.sync.InboundProcessorRegistryImpl.register(InboundProcessorRegistryImpl.java:285)
         at com.sap.ip.mi.systemnews.NewsImpl.create(NewsImpl.java:313)
         at com.sap.ip.mi.systemnews.StartListener.userLoggedOn(StartListener.java:24)
         at com.sap.ip.me.core.UserManagerImpl.fireLogon(UserManagerImpl.java:2283)
         at com.sap.ip.me.core.UserManagerImpl.logOnUser(UserManagerImpl.java:766)
         at com.sap.ip.me.core.UserManagerImpl.logOnUser(UserManagerImpl.java:744)
         at com.sap.ip.me.apps.jsp.LoginServlet.doHandleEvent(LoginServlet.java:274)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doPost(AbstractMEHttpServlet.java:706)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:534)
    [20070828 10:58:27:968] E [AppLog/MI/API/Services   ] Problems while saving C:\Program Files\SAP Mobile Infrastructure\sync\inboundProcessors\1.value
    java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.ip.me.api.services.IOUtils.serializeObjectToFile(IOUtils.java:875)
         at com.sap.ip.me.api.services.IOUtils.saveHashtableToDirectory(IOUtils.java:801)
         at com.sap.ip.me.sync.InboundProcessorRegistryImpl.register(InboundProcessorRegistryImpl.java:285)
         at com.sap.ip.me.core.ApplicationManager.registerInboundProcessors(ApplicationManager.java:198)
         at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:379)
         at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:126)
         at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:139)
         at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:46)
    [20070828 10:58:28:078] E [AppLog/MI/API/Services   ] Problems while saving C:\Program Files\SAP Mobile Infrastructure\sync\inboundProcessors\1.value
    java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.ip.me.api.services.IOUtils.serializeObjectToFile(IOUtils.java:875)
         at com.sap.ip.me.api.services.IOUtils.saveHashtableToDirectory(IOUtils.java:801)
         at com.sap.ip.me.sync.InboundProcessorRegistryImpl.register(InboundProcessorRegistryImpl.java:285)
         at com.sap.ip.me.core.ApplicationManager.registerInboundProcessors(ApplicationManager.java:200)
         at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:379)
         at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:126)
         at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:139)
         at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:46)
    [20070828 10:58:28:140] E [AppLog/MI/API/Services   ] Problems while saving C:\Program Files\SAP Mobile Infrastructure\sync\inboundProcessors\1.value
    java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.ip.me.api.services.IOUtils.serializeObjectToFile(IOUtils.java:875)
         at com.sap.ip.me.api.services.IOUtils.saveHashtableToDirectory(IOUtils.java:801)
         at com.sap.ip.me.sync.InboundProcessorRegistryImpl.register(InboundProcessorRegistryImpl.java:285)
         at com.sap.ip.me.core.FrameworkInitializer.initializeFramework(FrameworkInitializer.java:382)
         at com.sap.ip.me.core.FrameworkInitializer.main(FrameworkInitializer.java:126)
         at com.sap.ip.me.mdk.api.runtime.Start.startME(Start.java:139)
         at com.sap.ip.me.mdk.api.runtime.Start.main(Start.java:46)
    [20070828 10:58:36:781] D [MI/API/Sync              ] SyncEventListener com.sap.ip.me.core.StatusUpdater@b1cc87 was registered for key com.sap.ip.me.core.StatusUpdater/MI574f4e32
    [20070828 10:58:36:781] D [MI/Sync                  ] Register inbound processor com.sap.ip.mi.systemnews.InboundListener for method SYSTEMNEWS
    [20070828 10:58:36:812] E [AppLog/MI/API/Services   ] Problems while saving C:\Program Files\SAP Mobile Infrastructure\sync\inboundProcessors\1.value
    java.io.NotSerializableException: com.sap.ip.me.api.services.MEResourceBundle
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
         at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
         at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
         at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
         at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
         at com.sap.ip.me.api.services.IOUtils.serializeObjectToFile(IOUtils.java:875)
         at com.sap.ip.me.api.services.IOUtils.saveHashtableToDirectory(IOUtils.java:801)
         at com.sap.ip.me.sync.InboundProcessorRegistryImpl.register(InboundProcessorRegistryImpl.java:285)
         at com.sap.ip.mi.systemnews.NewsImpl.create(NewsImpl.java:313)
         at com.sap.ip.mi.systemnews.StartListener.userLoggedOn(StartListener.java:24)
         at com.sap.ip.me.core.UserManagerImpl.fireLogon(UserManagerImpl.java:2283)
         at com.sap.ip.me.core.UserManagerImpl.logOnUser(UserManagerImpl.java:766)
         at com.sap.ip.me.core.UserManagerImpl.logOnUser(UserManagerImpl.java:744)
         at com.sap.ip.me.apps.jsp.LoginServlet.doHandleEvent(LoginServlet.java:274)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doPost(AbstractMEHttpServlet.java:706)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

    MI framework tries to serialize all inbound listeners during the registration.
    However,  com.sap.ip.mi.systemnews.InboundListener seems to have a member
    of type com.sap.ip.me.api.services.MEResourceBundle which is not Serializable.
    basically this doesn't do any harm and you can just ignore this. In the previous MI
    SP level, I think we have this observer serialization exception ignored in the code;
    but it seems that implementation been changed...
    regards
    jo

  • Writing a java program for generating .pdf file with the data of MS-Excel .

    Hi all,
    My object is write a java program so tht...it'll generate the .pdf file after retriving the data from MS-Excel file.
    I used POI HSSF to read the data from MS-Excel and used iText to generate .pdf file:
    My Program is:
    * Created on Apr 13, 2005
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    package forums;
    import java.io.*;
    import java.awt.Color;
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    import com.lowagie.text.Font.*;
    import com.lowagie.text.pdf.MultiColumnText;
    import com.lowagie.text.Phrase.*;
    import net.sf.hibernate.mapping.Array;
    import org.apache.poi.hssf.*;
    import org.apache.poi.poifs.filesystem.*;
    import org.apache.poi.hssf.usermodel.*;
    import com.lowagie.text.Phrase.*;
    import java.util.Iterator;
    * Generates a simple 'Hello World' PDF file.
    * @author blowagie
    public class pdfgenerator {
         * Generates a PDF file with the text 'Hello World'
         * @param args no arguments needed here
         public static void main(String[] args) {
              System.out.println("Hello World");
              Rectangle pageSize = new Rectangle(916, 1592);
                        pageSize.setBackgroundColor(new java.awt.Color(0xFF, 0xFF, 0xDE));
              // step 1: creation of a document-object
              //Document document = new Document(pageSize);
              Document document = new Document(pageSize, 132, 164, 108, 108);
              try {
                   // step 2:
                   // we create a writer that listens to the document
                   // and directs a PDF-stream to a file
                   PdfWriter writer =PdfWriter.getInstance(document,new FileOutputStream("c:\\weeklystatus.pdf"));
                   writer.setEncryption(PdfWriter.STRENGTH128BITS, "Hello", "World", PdfWriter.AllowCopy | PdfWriter.AllowPrinting);
    //               step 3: we open the document
                             document.open();
                   Paragraph paragraph = new Paragraph("",new Font(Font.TIMES_ROMAN, 13, Font.BOLDITALIC, new Color(0, 0, 255)));
                   POIFSFileSystem pofilesystem=new POIFSFileSystem(new FileInputStream("D:\\ESM\\plans\\weekly report(31-01..04-02).xls"));
                   HSSFWorkbook hbook=new HSSFWorkbook(pofilesystem);
                   HSSFSheet hsheet=hbook.getSheetAt(0);//.createSheet();
                   Iterator rows = hsheet.rowIterator();
                                  while( rows.hasNext() ) {
                                       Phrase phrase=new Phrase();
                                       HSSFRow row = (HSSFRow) rows.next();
                                       //System.out.println( "Row #" + row.getRowNum());
                                       // Iterate over each cell in the row and print out the cell's content
                                       Iterator cells = row.cellIterator();
                                       while( cells.hasNext() ) {
                                            HSSFCell cell = (HSSFCell) cells.next();
                                            //System.out.println( "Cell #" + cell.getCellNum() );
                                            switch ( cell.getCellType() ) {
                                                 case HSSFCell.CELL_TYPE_STRING:
                                                 String stringcell=cell.getStringCellValue ()+" ";
                                                 writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                 phrase.add(stringcell);
                                            // document.add(new Phrase(string));
                                                      System.out.print( cell.getStringCellValue () );
                                                      break;
                                                 case HSSFCell.CELL_TYPE_FORMULA:
                                                           String stringdate=cell.getCellFormula()+" ";
                                                           writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                           phrase.add(stringdate);
                                                 System.out.print( cell.getCellFormula() );
                                                           break;
                                                 case HSSFCell.CELL_TYPE_NUMERIC:
                                                 String string=String.valueOf(cell.getNumericCellValue())+" ";
                                                      writer.setSpaceCharRatio(PdfWriter.NO_SPACE_CHAR_RATIO);
                                                      phrase.add(string);
                                                      System.out.print( cell.getNumericCellValue() );
                                                      break;
                                                 default:
                                                      //System.out.println( "unsuported sell type" );
                                                      break;
                                       document.add(new Paragraph(phrase));
                                       document.add(new Paragraph("\n \n \n"));
                   // step 4: we add a paragraph to the document
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              // step 5: we close the document
              document.close();
    My Input from MS-Excel file is:
         Planning and Tracking Template for Interns                                                                 
         Name of the Intern     N.Kesavulu Reddy                                                            
         Project Name     Enterprise Sales and Marketing                                                            
         Description     Estimated Effort in Hrs     Planned/Replanned          Actual          Actual Effort in Hrs     Complexity     Priority     LOC written new & modified     % work completion     Status     Rework     Remarks
    S.No               Start Date     End Date     Start Date     End Date                                        
    1     setup the configuration          31/01/2005     1/2/2005     31/01/2005     1/2/2005                                        
    2     Deploying an application through Tapestry, Spring, Hibernate          2/2/2005     2/2/2005     2/2/2005     2/2/2005                                        
    3     Gone through Componentization and Cxprice application          3/2/2005     3/2/2005     3/2/2005     3/2/2005                                        
    4     Attend the sessions(tapestry,spring, hibernate), QBA          4/2/2005     4/2/2005     4/2/2005     4/2/2005                                        
         The o/p I'm gettint in .pdf file is:
    Planning and Tracking Template for Interns
    N.Kesavulu Reddy Name of the Intern
    Enterprise Sales and Marketing Project Name
    Remarks Rework Status % work completion LOC written new & modified Priority
    Complexity Actual Effort in Hrs Actual Planned/Replanned Estimated Effort in Hrs Description
    End Date Start Date End Date Start Date S.No
    38354.0 31/01/2005 38354.0 31/01/2005 setup the configuration 1.0
    38385.0 38385.0 38385.0 38385.0 Deploying an application through Tapestry, Spring, Hibernate
    2.0
    38413.0 38413.0 38413.0 38413.0 Gone through Componentization and Cxprice application
    3.0
    38444.0 38444.0 38444.0 38444.0 Attend the sessions(tapestry,spring, hibernate), QBA 4.0
                                       The issues i'm facing are:
    When it is reading a row from MS-Excel it is writing to the .pdf file from last cell to first cell.( 2 cell in 1 place, 1 cell in 2 place like if the row has two cells with data as : Name of the Intern: Kesavulu Reddy then it is writing to the .pdf file as Kesavulu Reddy Name of Intern)
    and the second issue is:
    It is not recognizing the date format..it is recognizing the date in first row only......
    Plz Tell me wht is the solution for this...
    Regards
    [email protected]

    Don't double post your question:
    http://forum.java.sun.com/thread.jspa?threadID=617605&messageID=3450899#3450899
    /Kaj

  • Help writing first Java Script

    HELP!! I am writing my first Java Script for a class but cannot figure out what I am doing wrong. I have created a from and need to write a script to verify that all form entries are filled before allowing the data to submit. Can some one please look at my code below and tell me what I am doing wrong!! Thank you
    <HTML>
    <HEAD>
    <TITLE>Project 8 IT 117 Section 01 6/13/2003</TITLE>
    </HEAD>
    <BODY BGCOLOR="#007FFF">
    <FONT FACE="Arial">
    <STRONG><UL>
    <LI>Search our stock
    </UL>
    <UL>
    <LI>Place an order
    </UL>
    <UL>
    <LI>Out-of-print searches
    </UL>
    <UL>
    <LI>Events calendar
    </UL></STRONG>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function submit() {
         alert("Information submitted!")
    function verify() {
         if document.info.elements[0].value=="" ||
         document.info.elements[1].value=="" ||
         document.info.elements[2].value=="" ||
         document.info.elements[3].value=="" ||
         document.info.elements[4].value=="" ||
         document.info.elements[5].value=="" ||
         document.info.elements[6].value=="" {
              alert("Please complete each field")
         }     else {
              submit()
    //-->
    </SCRIPT>
    <H2>Sign up for our mailing list.</H2>
    <FORM NAME="info">
    <STRONG>First Name:<INPUT TYPE="TEXT" SIZE="20" NAME="FIRSTNAME">
    Last Name:<INPUT TYPE="TEXT" SIZE="20" NAME="LASTNAME"><BR>
    Street Address:<INPUT TYPE="TEXT" SIZE="50" NAME="ADDRESS"><BR>
    City:<INPUT TYPE="TEXT" SIZE="20" NAME="CITY">
    State:<INPUT TYPE="TEXT" SIZE="6" NAME="STATE">
    Zip Code:<INPUT TYPE="TEXT" SIZE="15" NAME="ZIPCODE"><BR>
    E-Mail:<INPUT TYPE="TEXT" SIZE="50" NAME="E-MAIL">
    <BR>Click here to submit this information. <INPUT TYPE="BUTTON" VALUE="Send now!" onClick="SUBMITTED()"></STRONG>
    </FORM>
    </FONT>
    </BODY>
    </HTML>

    Just a thought, but shouldn't you be calling "verify()" instead of "SUBMITTED()" in your onClick handler? And warnerja is right, javascript is not really java.

  • Urgent ! writing a java card applet -APDU problem

    hi
    i'm fairly new to the java programming language. i'm trying to write an RSA java card applet to run on a java card simulator.
    I am not sure at all what code i need to write for the CLA byte in the command APDU and what code i need to write for the INS byte in the command APDU, and where exactly to put it in my program.
    if anybody knows please could you help me out.
    So far i have written the code below.
    thanx
    louise
    import javacard.framework.*;
    import java.math.*;
    import java.util.*;
    /*the public key is the public part of the key. Anyone
    can have it. It can only encrypt data, not decrypt.*/
    public class publickey extends Applet{
    //code of the CLA byte in the command APDU header
    final static byte publickey_CLA = (byte)0x00;
    //max number of characters for text message is 60
    final static char MAX_TXT_MSG = 0x3c;
    //MAX number of tries (3) before PIN is blocked
    final static byte PIN_TRY_LIMIT = (byte)0x03;
    //size of PIN must be 4 digits long
    final static byte PIN_SIZE = (byte)0x04;
    //below status word(SW) values are returned by applet
    //in certain circumstances:
    //signal that the PIN verification failed
    final static short SW_PIN_VERIFICATION_FAIL = 0x6300;
    //signal that PIN validation required for txt msging
    final static short SW_PIN_VERIFICATION_REQUIRED = 0x630;
    //instance variables declaration
    OwnerPIN pin; //variable for holding owners pin
    BigInteger n,e;
    String owner;//variable for holding owners name
    /*make a public key. Do not do it yourself, but
    make a public key from a private key.*/
    publickey(String iowner,BigInteger in,BigInteger ie){
    owner=iowner;
    n=in;
    e=ie;
    public void process (APDU apdu) {
    byte[] buffer = apdu.getBuffer();
    //check Select APDU command
    if((buffer[ISO7816.OFFSET_CLA] ==0) &&
    (buffer[ISO7816.OFFSET_INS] ==(byte) (0xA4)) )
    return;
    if(buffer[ISO7816.OFFSET_CLA] !=publickey_CLA)
    ISOException.throwIt
    (ISO7816.SW_CLA_NOT_SUPPORTED);
    /*read the key back from a string.*/
    publickey(String from){
    StringTokenizer st=new StringTokenizer(from," ");
    owner=st.nextToken();
    n=readBI(st.nextToken());
    e=readBI(st.nextToken());
    /*use the key to encrypt a 'message' m. m should be a
    number from 1 to n (n not included).
    use makemessage to convert your message to a BigInteger.
    BigInteger encrypt(BigInteger m){
    return m.modPow(e,n);
    /*make a string from this key.*/
    public String toString(){
    return owner+" "+printBI(n)+" "+printBI(e);
    /*help methods for reading and writing:*/
    final static int radix=36;
    static String printBI(BigInteger b){
    return b.toString(radix);
    static BigInteger readBI(String s){
    return new BigInteger(s,radix);
    /* these methods convert an arbitrary message,
    in the form of an array of bytes, to a message
    suitable for encryption. To do this random bits
    are added (this is needed to make cracking of the
    system harder), and it is converted to a BigInteger.*/
    BigInteger makemessage(byte[] input){
    /*to understand this part of the program,
    read the description of the BigInteger constructor
    (in the standard java help). */
    if(input.length>128 ||
    input.length*8+24>=n.bitLength())
    return new BigInteger("0"); //error! message to long.
    byte[] paddedinput=new byte[n.bitLength()/8-1];
    for(int i=0;i<input.length;i++)
    paddedinput[i+1]=input;
    paddedinput[0]=(byte)input.length;
    for(int i=input.length+1;i<paddedinput.length;i++)
    paddedinput[i]=(byte)(Math.random()*256);
    return new BigInteger(paddedinput);
    /*the inverse of makemessage.*/
    static byte[] getmessage(BigInteger b){
    byte[] paddedoutput=b.toByteArray();
    byte[] output=new byte[paddedoutput[0]];
    for(int i=0;i<output.length;i++)
    output[i]=paddedoutput[i+1];
    return output;
    class privatekey{
    /*the data of a key*/
    BigInteger n,e,d;
    String owner;
    int bits;
    Random ran;
    /*unimportant things, needed for calculations:*/
    static int certainty=32;
    static BigInteger one=new BigInteger("1"),
    three=new BigInteger("3"),
    seventeen=new BigInteger("17"),
    k65=new BigInteger("65537");
    /*make a new key. supply the name of the owner of the
    key, and the number of bits.
    owner: all spaces will be replaced with underscores.
    bits: the more bits the better the security. Every
    value above 500 is 'safe'. If you are a really paranoid
    person, you should use 2000.*/
    privatekey(String iowner,int ibits){
    BigInteger p,q;
    bits=ibits;
    owner=iowner.replace(' ','_');//remove spaces from owner name.
    ran=new Random();
    p=new BigInteger(bits/2,certainty,ran);
    q=new BigInteger((bits+1)/2,certainty,ran);
    n=p.multiply(q);
    BigInteger fi_n=fi(p,q);
    e=chooseprimeto(fi_n);
    d=e.modInverse(fi_n);
    /*read the key back from a string*/
    privatekey(String from){
    StringTokenizer st=new StringTokenizer(from," ");
    st.nextToken();
    n=readBI(st.nextToken());
    e=readBI(st.nextToken());
    d=readBI(st.nextToken());
    /*some help methods:*/
    static BigInteger fi(BigInteger prime1,BigInteger prime2){
    return prime1.subtract(one).multiply(prime2.subtract(one));
    static BigInteger BI(String s)
    {return new BigInteger(s);}
    BigInteger chooseprimeto(BigInteger f){
    /*returns a number relatively prime to f.
    this number is not chosen at random, it first
    tries a few primes with few 1's in it. This
    doesn't matter for security, but speeds up computations.*/
    if(f.gcd(three).equals(one))
    return three;
    if(f.gcd(seventeen).equals(one))
    return seventeen;
    if(f.gcd(k65).equals(one))
    return k65;
    BigInteger num;
    do{
    num=new BigInteger(16,ran);
    }while(!f.gcd(num).equals(one));
    return num;
    final static int radix=36;
    static String printBI(BigInteger b){
    return b.toString(radix);
    static BigInteger readBI(String s){
    return new BigInteger(s,radix);
    /*returns the public key of this private key.*/
    publickey getpublickey(){
    return new publickey(owner,n,e);
    /*the same encryption that the public key does.*/
    BigInteger encrypt(BigInteger m){
    return m.modPow(e,n);
    /*decryption is the opposite of encryption: it
    brings the original message back.*/
    BigInteger decrypt(BigInteger m){
    return m.modPow(d,n);
    public String toString(){
    return owner+" "+printBI(n)+" "+printBI(e)+" "+printBI(d);
    /*this main demonstrates the use of this program.*/
    public static void main(String[] ps){
    say("************ make key:");
    privatekey priv=new privatekey("sieuwert",92);
    publickey pub=priv.getpublickey();
    say("the public key:"+priv);
    say("************ encrypt message:");
    byte[] P="RUOK?".getBytes();
    BigInteger Pc=pub.makemessage(P);
    say("converted:\t"+printBI(Pc));
    BigInteger C=pub.encrypt(Pc);
    say("coded message: "+printBI(C));
    say("************ decrypt message:");
    BigInteger Pc2=priv.decrypt(C);
    say("decoded:\t"+printBI(Pc2));
    byte[] P2=publickey.getmessage(Pc2);
    say("deconverted: "+new String(P2));
    static void say(String s){
    System.out.println(s);

    Command APDU is not written in your source code, rather it is sent from PC or programmed Card Acceptance Device/ Card Reader/ Terminal.
    The code installed in the Java Card should be able to handle the Command APDU received and process it accordingly, and finally your code should be able to send out response APDU.
    You may think your code as a decoder, to retrieve each byte (CLA, INS, P1, P2, DATA, LC) using the Java Card API, you should be able to do it.
    Also, I notice in your code that you want to work out with strings, but Java Card does not support strings, chars, long, float, double ...
    to send out reponse APDU, there are certain steps that you can use, not just simply print like ordinary J2SE may use.
    hope this will help u

  • Writing a Java Database

    My boss wants me to investigate the feasibility of writing
    our own database using Java (despite the fact that there
    are many fine third-party ones already out there).
    He claims that there is an API within Java designed to
    facilitate writing such a database. If this is true, what
    is it? The only db-related API I am aware of is JDBC,
    and it is my understanding that JDBC is only for accessing
    and manipulating an existing database. Therefore I do
    not think this is what he is talking about.
    Can anyone advise?
    Tx

    Those are all fine databases, but his concern is,
    because they all use the GNU General Public License
    (or similar license), that for our product to rely
    upon them
    would somehow force our product to be goverened by
    that license (and hance make it open-source, free,
    etc).No, I think your boss's concern is a valid one, but his solution is incorrect. The answer is not to write a database from scratch.
    He may be mistaken in this. But it would be
    necessary
    to distribute the database along with the product,
    and
    so it is unclear to me whether this makes the
    database
    part of our product.
    Can anyone shed some light on this.
    TxI'd recommend that you find candidate databases, get their licenses, and have a lawyer examine them in great detail and explain what each of them means from a legal point of view. If you can find a lawyer who specializes in this kind of thing, so much the better. (You don't say if your company is large or small.)
    This is a problem that everyone faces today, but using open source s'ware doesn't obligate anyone to give away the systems they write with it. WebLogic ships with Struts, JSTL, and other Commons software from Apache. Does that mean that everyone who uses it has to give away the stuff they develop with it? Not by a long shot. You need to know what your obligations are. Have a real lawyer explain them to you.
    %

  • Writing a Java-enabled Media Player

    Hello out there,
    it's me, I was the one to put so much effort in writing a full-fletched Java Media Player that was hopefully gonna be able to compete with Winamp or Windows Media Player one day. Some of you might remember, it was Polytox Jazz, certainly a beautiful piece of software that was meant to take User Interface to a new level even Apple hasn't come up with yet. It would still be state of the art even today. But the Sun staff let me down back then. I kept on writing and writing and filing bugs, but the JMF staff weren't able to sort things out, not even the most simple things. Did I write: Listen, with plain uncompressed wave files, all is well, but as soon as I use MP3 files, I am not even able to get a peak level in sync. So, how the heck should I ever implement an equalizer? (DSP programming is known here, have read all the important books.) No answer from Sun. I was really disappointed then and dropped all the stuff forever. I'm not gonna try it again, but this is my question: Is there any cool Java Media Player around? Has anybody had any more success than me? When I started to work with JMF, around 2001, it wasn't more than a preliminary hack of freaks that didn't really know what they were doing.
    Best
    Philip

    Hi Philip, Please I want to run/actuate my cell/mobile phone front view camera (that is real life only run/actuates on video calls) through Java media/player control function and developing and importing an API. Please help me to find an appropriate trick to do so.
    Please I wrote a Java Program that is successfully working for its back view camera (main camera). I tried my best to modify this program to run/actuate my front view camera, despite lots of efforts, still not successful. Please if U email me at '[email protected]' I can send U this code and successfully working jar file or can bring the source code at the forum for modification. Please help me.

  • Cd writing through java

    hiiiii
    i am doing tthis project where i need to write a cd with the help of java. is there any way that through java interface cd writing is posssible. i know that this is platform dependent but then also is there a code in java which works for even one computer only.
    thnxxxxxxxxxx in advace.

    hiiiii
    helloooooooooo
    i am doing tthis project where i need to write a cd
    with the help of java.
    *klunk*
    Why?
    is there any way that through
    java interface cd writing is posssible. Not really no.
    i know that
    this is platform dependent and hardware dependent as well but let's not worry about such trivialities
    but then also is there a
    code in java which works for even one computer
    only.
    JNI you mean.
    thnxxxxxxxxxx in advace.plllllllllllllllllllllllllzzzzzzzzzzzzz stop with the multiple letttttttttttttters thanxxxxxx
    Honestly... give this up. This is not a suitable Java project. Choose something else for your thesis or whatever it is you are doing.

  • Writing a Java Web Browser

    I'm trying to write a simple Java based browser. Can anyone please help me with this code. I can't get it to load the URL
    please help
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.lang.*;
    import javax.swing.text.*;
    public class Browser extends JPanel implements ActionListener {
         Browser() {
              JPanel p = new JPanel();
              p.setLayout(new BorderLayout(5,5));
              final JEditorPane jt = new JEditorPane();
              final JTextField input = new JTextField("http://java.sun.com");
              //make read only
              jt.setEditable(false);
              //follow links
              jt.addHyperlinkListener(new HyperlinkListener () {
                   public void hyperlinkUpdate(
                        final HyperlinkEvent e) {
                             if (e.getEventType() ==
                                  HyperlinkEvent.EventType.ACTIVATED) {
                                       SwingUtilities.invokeLater(new Runnable() {
                                            public void run() {
                                                 //Save original
                                                 Document doc = jt.getDocument();
                                                 try {
                                                      URL url = e.getURL();
                                                      jt.setPage(url);
                                                      input.setText(url.toString());
                                                 } catch (IOException io) {
                                                      JOptionPane.showMessageDialog(
                                                           Browser.this, "Can't follow link",
                                                           "Invalid Input",JOptionPane.ERROR_MESSAGE);
                                                      jt.setDocument(doc);
                             JScrollPane pane = new JScrollPane();
                             pane.setBorder(
                                  BorderFactory.createLoweredBevelBorder());
                             pane.getViewport().add(jt);
                             p.add(pane, BorderLayout.CENTER);
                             input.addActionListener(new ActionListener() {
                                  public void actionPerformed(ActionEvent e) {
                                       try {
                                            jt.setPage(input.getText());
                                       } catch (IOException ex) {
                                            JOptionPane.showMessageDialog(
                                                 Browser.this,"Invalid URL","Invalid Input",JOptionPane.ERROR_MESSAGE);
                                  p.add(input, BorderLayout.SOUTH);
                                  JFrame f = new JFrame();
                                  f.getContentPane().add(p);
                                  //f.getContentPane().setSize(400,400);
                                  f.setVisible(true);
                             public void actionPerformed(ActionEvent e) {}
                             public static void main(String[] args) {
                                  Browser b = new Browser();
                                  b.setSize(500,500);
                        }

    i made a few changes and it works.
    i have marked the changes.
    import java.awt.event.*;
    import java.awt.*;
    import java.io.*;
    import java.net.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.lang.*;
    import javax.swing.text.*;
    public class Browser extends JFrame implements ActionListener {     Browser() {
              JPanel p = new JPanel();
              p.setLayout(new BorderLayout(5,5));
              final JEditorPane jt = new JEditorPane();
              final JTextField input = new JTextField("http://java.sun.com");
              //make read only
              jt.setEditable(false);
              //follow links
              jt.addHyperlinkListener(new HyperlinkListener () {
                        public void hyperlinkUpdate(final HyperlinkEvent e) {
                             if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                                  SwingUtilities.invokeLater(new Runnable() {
                                            public void run() {
                                                 //Save original
                                                 Document doc = jt.getDocument();
                                                 try {
                                                      URL url = e.getURL();
                                                      jt.setPage(url);
                                                      input.setText(url.toString());
                                                 catch (IOException io) {
                                                      JOptionPane.showMessageDialog
                                                           ( Browser.this, "Can't follow link",
                                                             "Invalid Input",JOptionPane.ERROR_MESSAGE);
                                                      jt.setDocument(doc);
              JScrollPane pane = new JScrollPane();
              pane.setBorder(BorderFactory.createLoweredBevelBorder());
              pane.getViewport().add(jt);
              p.add(pane, BorderLayout.CENTER);
              input.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                             try {
                                  jt.setPage(input.getText());
                             } catch (IOException ex) {
                                  JOptionPane.showMessageDialog
                                       ( Browser.this,"Invalid URL","Invalid Input",JOptionPane.ERROR_MESSAGE);
              p.add(input, BorderLayout.SOUTH);
              //JFrame f = new JFrame();          getContentPane().add(p);
              //f.getContentPane().setSize(400,400);
              setVisible(true);
              this.addWindowListener(new java.awt.event.WindowAdapter() {                    public void windowClosing(java.awt.event.WindowEvent e) {
                             System.exit(0);
         public void actionPerformed(ActionEvent e) {}
         public static void main(String[] args) {
              Browser b = new Browser();
              b.setSize(500,500);
    }

  • Question on "Writing a Java Card applet" by Ed Ort

    Hi,
    in the wallet apple i defined the variable
    short balance
    that is the wallet in the Sim, but i don't understand where the value of this variable is initialized the first time.
    Could someone help me?
    Thank you
    Luigi

    It's initialized to 0(zero) per the Java/JavaCard specification(either by the VM or at compile time).
    For myself, I prefer to explicitly initialize values.
    It terms of the application, it would be "initialized" with an initial deposit as mentioned by DurangoVA.
    Steve

  • XI class that can be impleented for writing a java code

    Hi ,
    I have tried to write a simple java map in Netweaver Developer Studio that will create a soap header and a few tags - there is a certain XI class you have to implement . Can some one help me out with what this class is?
    Thanks in Advance,
    Hemanthika

    hi
    chk these
    /people/venkataramanan.parameswaran/blog/2006/12/12/java-mapping-to-handle-flat-files-in-sap-xi
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    rgds
    Chemmanz

  • Errors while writing JNI (Java-C++) Classes

    Hi,
    I am trying to write some JNI applications and meeting weird errors. I am using MS VC++ editor to write and compile C++ programs on Windows NT.
    Here is the list of errors I am receiving.
    error C2146: syntax error : missing ';' before identifier 'jstring'
    error C2501: 'JNIEXPORT' : missing storage-class or type specifiers
    fatal error C1004: unexpected end of file found
    Any help would be greatly appreciated.
    Thanks,
    -Sunkara

    Hi,
    here is the code of what I am trying to do. Let me know if you need more info.
    Code for JNIMethods.cpp:
    #include "JNIMethods.h"
    using namespace std;
    JNIEXPORT jstring JNICALL Java_TestingClass_callJNIMethod(JNIEnv* env, jstring userName)
         string CppCustomerStr = "Testing JNI Method";
         jint len = CppCustomerStr.length()+1;
         jchar *custChar = new jchar[len];
         for(int i=0;i<len;i++)
              custChar[i] = (char)(CppCustomerStr);
         return CPPStringToJavaString(env,custChar,len);
    jstring CPPStringToJavaString(JNIEnv env, jchar chars, jint len)
    jclass stringClass;
    jcharArray elemArr;
    static jmethodID cid = NULL;
    jstring result;
    stringClass = (jclass) env->FindClass("java/lang/String");
    if (stringClass == NULL)
    return NULL; // exception thrown
    // Note that cid is a static variable
    if (cid == NULL)
    // Get the method ID for the String constructor
    cid = env->GetMethodID(stringClass,
    "<init>", "([C)V");
    if (cid == NULL)
    return NULL; // exception thrown
    // Create a char[] that holds the string characters
    elemArr = env->NewCharArray(len);
    if (elemArr == NULL)
    return NULL; // exception thrown
    env->SetCharArrayRegion(elemArr, 0, len, chars);
    // Construct a java.lang.String object
    result = (jstring) env->NewObject(stringClass, cid, elemArr);
    //* Allow local ref to intermediate char[] to be freed
    env->DeleteLocalRef(elemArr);
    return result;
    }//end of CPPStringToJavaString()
    Code for JNIMethods.h:
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include "jni.h"
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: TestingClass
    * Method: callJNIMethod
    * Signature: jstring
    JNIEXPORT jstring JNICALL Java_TestingClass_callJNIMethod(JNIEnv *, jstring userName);
    jstring CPPStringToJavaString(JNIEnv *env, jchar *chars, jint len);
    #ifdef __cplusplus
    #endif
    Also, could any one tell me how to set the classpath in MS VC++ 6.0
    Thanks,
    -Sunkara

  • Writing a java installer

    I would like to write an installer for my employer's java application and I would like to make the installater create a desktop shortcut with an icon. Does anyone know how to do this?
    Alternatively, maybe suggest an installation package for java applications that is relatively inexpensive yet easy to use. The ones I've looked at seem like a foreign language!

    Installers for operating systems like Windows are
    complicated beasts because Windows is complicated.
    The other thing about installers you should know is,
    to write an installer to work on Windows the main
    thing you have to know is -- how to install software
    on Windows. You don't have to know much at all about
    Java, even if you are installing Java software. So,
    you're really looking in the wrong place here.I had downloaded a software which creates windows installer for .exe's one writes . I can;t find it in my pc now . I am not sure about how to use t as i tried using it once and failed miserably . Just check out on the net for something of that sort .

  • Writing a java Object?

    I am first time to write a java object,and i found it is difficult to understand some syntax, can anyone give me some suggestion?

    My steps as a beginning Java programmer involves the following:
    1. Get a simple beginner book on Object Oriented concepts.
    The SUN site has a Tutorial.
    2. Get a good Java Language book. The Sun Site Tutorial has
    similar. Read as much of it as you can take. Then stop.
    3. Install Java standard edition compiler. Free from SUN site.
    Be able to do "javac xxxx.class" <--- compiling, and
    "java xxxx " <-- running xxxx.
    4. Compile and run a few of the examples in the books, and
    Tutorial.
    5. Give yourself a few simple "Program or project" to write,
    ex. "Hello World". Right now I am giving myself a simple
    problem. Finding word from a string. Or a simple word
    parser. Try to write that.
    6. Post your questions in the Beginner Forum (Here). Try
    out the responses from the more experienced repliers.
    7. Got back to the book, and check the section relating
    to the response, and your errors. This 2nd round of
    checking and reading, helps the Concept and understanding
    JAVA.
    8. Keep doing this day after day. You'll see that, as it turns out,
    JAVA does make sense.
    -- gte99te

Maybe you are looking for