How to create hyperlink in Html page using Java

Hello every one
I want to know that how can I create a hyperlink in Html page using java ?
Let for example
I have code like this and i want to give hyperlink to it using java.
rember that i am creating node using this id="name" which give me multiple value. and i want to assign diff link to each name..?
<tr>
<td ><span id="name"></span>
</tr>

but i m using this code to create node in html file
HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
Text txt = appHTML.createTextNode(name);
li.appendChild(txt);
appHTML.getElementById("name").appendChild(li);
this will display all name value which is coming from database,
and i want to assign a hyperlink to it,
I have id with name also so I thought that using id i will
create javascript like
function popup(id)
     if(id==1)
          var n1 = window.open("../list/name1.html");
     if(id==2)
          var n1 = window.open("../list/name2.html");
this way i want to popup particular file if i can pass id value in this function
so want hyperlink like
name

Similar Messages

  • How to create dom treeof html page with java

    hi, all
    i met with a problem how to create dom tree of html page wih jave, that is, given a html page, how to create a dom tree of this page with java?
    thanks in advance.
    regards
    richard

    but i m using this code to create node in html file
    HTMLLIElement li = (HTMLLIElement)appHTML.createElement("LI");
    Text txt = appHTML.createTextNode(name);
    li.appendChild(txt);
    appHTML.getElementById("name").appendChild(li);
    this will display all name value which is coming from database,
    and i want to assign a hyperlink to it,
    I have id with name also so I thought that using id i will
    create javascript like
    function popup(id)
         if(id==1)
              var n1 = window.open("../list/name1.html");
         if(id==2)
              var n1 = window.open("../list/name2.html");
    this way i want to popup particular file if i can pass id value in this function
    so want hyperlink like
    name

  • How to create autofilter in excel page using jxl api?

    Hi Friends,
    I am using jxl api for excel generation. Its no problem
    but i need to set auto filter options. I am search in this API package but i can't find it.
    Any one know how to create autofilter in excel page using jxl api?.
    Please ..... Its urgent.... ...
    Thanks

    Hi,
    Please mail me on [email protected] if u will find any solutions, i will do the same if i will find any...
    Thank u in advance,

  • How to do transactions in jsp pages using Java & MySQL ?

    Hi,
    I'm a newbie..
    I'd like to know "How to do transactions in jsp pages using Java & MySQL ?"
    Platform: Windows XP, Apache Tomcat 5.5, MySQL 5, Java bean without EJB
    what are the the different types of transactions? Differences between them?Pls provide examples?
    Which among them is the best method to implement a transaction?
    Pls help me...
    thnx in advance...

    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html

  • How to do hyperlink to html page?

    can i know how to do a hyperlink to html page once i click on a Jbutton? I need a help : )

    You can try something like this:
    String cmd = "c:/program files/ie.exe"; // WHat ever your explorer path is
    String url = "test.html"; // what ever your html path is
          try {
          Runtime.getRuntime().exec(cmd + " \"" + url + "\"");
          } catch (IOException ex) {
    ex.printStackTrace();
          }

  • How to create a directory or Folder  using java program?

    Hi all,
    Can any one know, how to create a directory(new folder) in java.
    can any give me some idea, on creating a directory using java program dynamically.
    thanx in advance

    hi thanks for your answer,
    sorry, actual i know this technique(its my fault i didnt mentioned it)
    i am looking for some what different technique.
    bye
    ram

  • How to create the groups in OID Using Java API.

    Hi,
    I need to create the group in OID Using Java API's only(i.e., javax.naming.* only).
    I need to achieve it without using any oracle specific jars.
    Is there any way to achieve it?.If there's a option to achieve it,do let me know.
    I also need to create the users in that group ,after creating it.
    If you share any useful link or ideas for the same would be great.
    Thanks
    Balaji

    bobws wrote:
    Hi,
    I want to find the installed JREs in windows using java. I couldn't fine any java API. So I am using the below code to fetch the JRE list from windows registries & parse the returned collection to know the installed JRE.Why? If you are running java you already have a JRE. So why not just use it?
    >
    String key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Runtime Environment";
    Runtime.getRuntime().exec(
    "reg query " + "\"" + key + "\"");
    Is it legal to retrieve the installed JREs in this way? Legal? It is OS specific, and to a certain extent dependent on vendor and what the vendor wants to do. Could also be impacted by permissions. Other than that it is ok.
    I am feeling like its a type of hacking. So I couldn't decide whether this is legal (recommended) way of using. Does anybody can answer me. I can see the similar posts in google. Somebody suggests this way & somebody suggests to use preference API which is similar to this. Appreciate your help.Preferences won't work. It doesn't allow access to the registry in general, only a part of it. There are discussions in the JNI forum about retrieving VM versions. Prior to actually using the VM though.

  • How do i send an html page in java mail

    hi everyone, i have an problem while sending html page in my java mail application.Actually it's sending the html page correctly but the thing is it doesn't display the gif files . why so ? can anyone help me. i think its b'coz of the path problem.
    My requirement is like this :
    I would like to send an html page to some [email protected] from my local system . for that i have written one mail application which will build an html page which is also having some gif files. And these gif files are located in my local system. when i sent to some xyz user it's not displaying the gif files . How should i give the path for that gif files. pls help me regarding this. This is Urgent.
    Thanx in advance.
    by
    jjjavac

    hi , here with i have attached my program which will work fine . What u have to do is u have to specify ur smtp host address. from address and to address. And if u want to embedd the gif file u have to specify the gif file name. It will work only in outlook and hotmail. if u have anyother doubt let me know.
    import java.io.*;
    import java.util.Properties;
    import java.util.Date;
    import javax.mail.*;
    import javax.activation.*;
    import javax.mail.internet.*;
    import java.sql.*;
    import java.text.*;
    * @author Jeevan
    public class EmbeddingGif {
         StringBuffer sb = new StringBuffer();
         String line;
    public static void main(String[] argv) {
              new EmbeddingGif (argv);
    public EmbeddingGif (String[] argv) {
              String to, subject = null, from = "[email protected]",
              cc = null, bcc = null, url = null;
    //     String mailhost = null;
              String mailhost = "10.1.0.106";                    // SMTP host address
              String mailer = "SendHtmlMail";
              String protocol = "imap", host = null, user = "jeevan", password = "jeevan";
              String record = "g:/rbs/web-inf/classes/emailstore";     // name of folder in which to record mail
              boolean debug = false;
              BufferedReader in = null;
              int optind;
         for (optind = 0; optind < argv.length; optind++) {
         if (argv[optind].equals("-T")) {
              protocol = argv[++optind];
         } else if (argv[optind].equals("-H")) {
              host = argv[++optind];
         } else if (argv[optind].equals("-U")) {
              user = argv[++optind];
         } else if (argv[optind].equals("-P")) {
              password = argv[++optind];
         } else if (argv[optind].equals("-M")) {
              mailhost = argv[++optind];
         } else if (argv[optind].equals("-f")) {
              record = argv[++optind];
         } else if (argv[optind].equals("-s")) {
              subject = argv[++optind];
         } else if (argv[optind].equals("-o")) { // originator
              from = argv[++optind];
         } else if (argv[optind].equals("-c")) {
              cc = argv[++optind];
         } else if (argv[optind].equals("-b")) {
              bcc = argv[++optind];
         } else if (argv[optind].equals("-L")) {
              url = argv[++optind];
         } else if (argv[optind].equals("-d")) {
              debug = true;
         } else if (argv[optind].equals("--")) {
              optind++;
              break;
         } else if (argv[optind].startsWith("-")) {
              System.out.println(
    "Usage: SendHtmlMail [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
              System.out.println(
    "\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
              System.out.println(
    "\t[-f record-mailbox] [-M transport-host] [-d] [address]");
              System.exit(1);
         } else {
              break;
         try {
         if (optind < argv.length) {
              // XXX - concatenate all remaining arguments
              to = argv[optind];
              System.out.println("To: " + to);
         } else {
              System.out.print("To: ");
              System.out.flush();
    //          to = in.readLine();
              to = "[email protected]";
         if (subject == null) {
              System.out.print("Subject: ");
              System.out.flush();
    //          subject = in.readLine();
              subject = "New Bill @ " + new Date ();
         } else {
              System.out.println("Subject: " + subject);
         Properties props = System.getProperties();
         // XXX - could use Session.getTransport() and Transport.connect()
         // XXX - assume we're using SMTP
              System.out.println("mailhost :"+mailhost);
              System.out.println("from :"+from);
              System.out.println("to :"+to);
              System.out.println("cc :"+cc);
              System.out.println("subject :"+subject);
              System.out.println("bcc :"+bcc);
              System.out.println("url :"+url);
         if (mailhost != null)
              props.put("mail.smtp.host", mailhost);
         // Get a Session object
         Session session = Session.getDefaultInstance (props, null);
         if (debug)
              session.setDebug (true);
         // construct the message
         Message msg = new MimeMessage(session);
         if (from != null)
              msg.setFrom(new InternetAddress(from));
         else
              msg.setFrom();
         msg.setRecipients(Message.RecipientType.TO,
                             InternetAddress.parse(to, false));
         if (cc != null)
              msg.setRecipients(Message.RecipientType.CC,
                             InternetAddress.parse(cc, false));
         if (bcc != null)
              msg.setRecipients(Message.RecipientType.BCC,
                             InternetAddress.parse(bcc, false));
         msg.setSubject(subject);
         collect(in, msg);
    //     msg.setHeader("X-Mailer", mailer);
    //     msg.setSentDate(new Date());
         // send the thing off
    //     Transport.send(msg);
    //     System.out.println("\nMail was sent successfully.");
         } catch (Exception e) {
         e.printStackTrace();
    public void collect(BufferedReader in, Message msg)     throws MessagingException, IOException {
                        BodyPart bp1=new MimeBodyPart();
                        String html="<H1>Hello from Jeevan</H1>";
                        html=html+"<img src=cid:mickey>";
                        bp1.setContent(html,"text/html");
                        MimeMultipart mp=new MimeMultipart("related");
                        mp.setSubType("related");
                        mp.addBodyPart(bp1);
                        BodyPart bp2=new MimeBodyPart();
                        DataSource source=new FileDataSource("fss.gif");
                        bp2.setDataHandler(new DataHandler(source));
                        bp2.setHeader("discrete-type","image");
                        bp2.setHeader("Content-ID","mickey");
                        mp.addBodyPart(bp2);
                        msg.setContent(mp);
                        Transport.send(msg);
         System.out.println("\nMail was sent successfully.");
    //                    msg.setDataHandler(new DataHandler(     new ByteArrayDataSource(sb.toString(), "text/html")));                                        

  • Print Html page Using Java

    I need to print Html Page into my printer, how can I do this. Any help will be appreciated.
    Wil

    File > Print.
    See: http://java.sun.com/javase/6/docs/technotes/guides/jps/spec/printing2d.fm.html
    And:
    http://java.sun.com/j2se/1.4.2/docs/guide/jps/index.html
    And google "Java JPS"

  • How to create  and hide a drive using java?

    I want to ask how to create a temporary drive/ or a drive by allocating some space of existing drives(eg allocating some space of C: Drive such as 5mb for storing files on the new drive that has been created) and then i want to hide that drive .So Please can anyone Explain me how to do that.

    Iam saying to all of you iam not blaming to anyone even java. And my harddisk is not currepted or damage by using that. My harddisk is working properly. But i don't know why all of you think that i am blamming to someone but iam asking some question which need to be answered.
    I am clearing all of you i am a student and iam creating an project in java for that i need this. I also want to add File/Folder lock on that project. This technique i have seen in folder lock 6 software that they use hidden drive to store files. Thats why iam asking that how to apply this technique using java.
    And plz plz read this carefully and answer me to solve my problem.

  • How to create hyperlink within HTML using PPTX for import .

    Hi ,
    I am using PPTX to publish HTML5 - using Captivate 8.0
    Hyper-linking is working in PPTX but not working in HTML .
    Please help.
    Regards,
    Amit

    Captivate is not a PPTX- converter to HTML5, that is a wrong perception. If you only want a presentation, why not use a plugin for PPT, there are a lot around:
    When a ppt is imported, each slide is converted to a 'movie' slide in Captivate, it will keep all animations but that is it. Objects do not have a separate timeline. If you want to use the real power of Captivate - an eLearning authoring tool, not a presentation tool like ppt - you'll have to use the ppt-assets, create Captivate-slides with them and then add interactivity like buttons, hyperlinks etc.

  • How to create hyperlink in a page with another website

    like we can link email links and hyperlinks (with other
    files) how do i make link with another website like
    in my home page i say www.indiatoday.com and i want that when
    one clicks on www.indiatoday.com this site opens
    how do i create a link using dreamweaver without having to
    code manually.

    "pandeya" <[email protected]> wrote in
    message
    news:f66jl8$72b$[email protected]..
    > like we can link email links and hyperlinks (with other
    files) how do i
    > make
    > link with another website like
    > in my home page i say www.indiatoday.com and i want that
    when one clicks
    > on
    > www.indiatoday.com this site opens
    > how do i create a link using dreamweaver without having
    to code manually.
    Select the text www.indiatoday.com. In the Property
    Inspector, in the Link
    field, type the full URL -
    http://www.indiatoday.com.
    Click OK.
    You might want to use the Help documentation for really basic
    questions like
    this..
    Patty Ayers | Adobe Community Expert
    www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet

  • How to create different login form pages using Extranetlook

    Hi,
    I would like to have different login pages in order to let users access to different sites created with Site Studio. The Extranetlook component comes with a default one, login_page.htm but if I change this file, then this login page is used for all users in the whole Content Server. Our requirement is to have different login pages, one per each site, and let the default one to let users access just the Content Server, not the sites.
    We created a custom login form page copying the login_page.htm file and then modified the redirecturl input field (<input value="/oursite/" type="hidden" name="redirecturl" />). This only works when the login is successful. When the login is incorrect the user is redirected to the default login_page.htm. In that case, we would like to redirect the user to custom login form instead of the default one.
    In fact, I'm afraid I don't understand well the relation between the login_page.htm within the component, the login_page.htm file that resides in <ucm-installation>/data/users and the extranetlook.idoc file.
    Thanks in advance.

    While not resolving issue with multisite login page, i can tell the relationship among component login_page, data user login_page and ExtranetLook.idoc.
    So according to component readme.txt ExtranetLook.idoc is used to construct user data login_page (i've checked it). So any customizations made to its dynamic html sections are reflected into that file - and it is the which being showed in browser. The component one is used as initial one.

  • How to make a simple login page using java creator studio and mysql

    Hi,
    I hav got java creator studio n my sql.Can u give me the code for login page authentication and navigation

    This is a forum about Java language questions, not about how to use a developers tool. I would say to go to the site where you got java creator studio from, and look for a forum there.

  • How to create a subreport link programmaticly using java RAS sdk

    Hi,
    I want to create subreport link for couple of main report parameters programmaticly using RAS sdk.
    Main report has Param1 and Param2. I need to link these parameters to sub-report which doesn't have any parameters, so I can pass the parameters value just once when running the report and consume it's value in the sub-report.
    Below is the code I tried but I get "Invalid field name"error when I try to save the main report.
    ISubreportClientDocument subReportDoc = subReportCntrl
                      .getSubreport(subReports.getString(i));
    SubreportLinks srLinks = subReportCntrl.getSubreportLinks(subReports.getString(i));
    SubreportLink subRptLink1 = new SubreportLink();
    Fields paramFields = reportClientDoc.getDataDefinition().getParameterFields();
    subRptLink1.setMainReportFieldName(paramFields.get(0).toString());
    subRptLink1.setSubreportFieldName(paramFields.get(0).toString());
    SubreportLink subRptLink2 = new SubreportLink();
    subRptLink2.setMainReportFieldName(paramFields.get(1).toString());
    subRptLink2.setSubreportFieldName(paramFields.get(1).toString());
    srLinks.add(subRptLink1);
    srLinks.add(subRptLink2);
    subReportCntrl.setSubreportLinks(subReports.getString(i), srLinks);
    Thanks,

    Hi,
    I want to create subreport link for couple of main report parameters programmaticly using RAS sdk.
    Main report has Param1 and Param2. I need to link these parameters to sub-report which doesn't have any parameters, so I can pass the parameters value just once when running the report and consume it's value in the sub-report.
    Below is the code I tried but I get "Invalid field name"error when I try to save the main report.
    ISubreportClientDocument subReportDoc = subReportCntrl
                      .getSubreport(subReports.getString(i));
    SubreportLinks srLinks = subReportCntrl.getSubreportLinks(subReports.getString(i));
    SubreportLink subRptLink1 = new SubreportLink();
    Fields paramFields = reportClientDoc.getDataDefinition().getParameterFields();
    subRptLink1.setMainReportFieldName(paramFields.get(0).toString());
    subRptLink1.setSubreportFieldName(paramFields.get(0).toString());
    SubreportLink subRptLink2 = new SubreportLink();
    subRptLink2.setMainReportFieldName(paramFields.get(1).toString());
    subRptLink2.setSubreportFieldName(paramFields.get(1).toString());
    srLinks.add(subRptLink1);
    srLinks.add(subRptLink2);
    subReportCntrl.setSubreportLinks(subReports.getString(i), srLinks);
    Thanks,

Maybe you are looking for