Html:link and javascript

Maybe I'm asking the wrong question, how do you execute JavaScript within a <html:link> tag in Struts. I simply want to execute a collapse / expand divs with an onclick attribute in the <html:link> tag.
Can this be done with some other tag?
TC

and why didnt u try putting the onlick tag ?
<html:link href=# onClick="myJSfunction()">Rohit</html:link>
-Rohit

Similar Messages

  • Hi, We have an application  built using HTMl 5 and Javascript running on IPad2, iOS5.1 Safari 5.1. When we try to download a file(.pvw file) in that application safari throws "Download failed" error. Please suggest what needs to be done.

    Hi,
    We have an application  built using HTMl 5 and Javascript running on IPad2, iOS5.1 Safari 5.1.
    When a file url is clicked instead of asking for Save or Open or Cancel options, the file gets opened on IPad by default.
    Is this default behaviour which cannot be changed or can it be configured to ask user preference?
    When we try to download a file(.pvw file -> a model file) in the above application, safari throws "Download failed" error.
    Please suggest what needs to be done.
    Regards,
    Pramod

    Safari on an iPad in general does not allow downloading of files. That's a safety precaution in the iOS SDK to keep unauthorized content off of iOS devices. Safari will open from the web site file types that it can handle, but direct downloading isn't normal behavior, and I don't believe the behavior can be changed, though you can try asking in the developer forum, either here or the one to which you have access as a member of Apple's iOS developer program.
    Regards.

  • Broken links and javascript on OMWB page

    Link to "mysql 5 bundle" (http://www.oracle.com/technology/software/tech/migration/workbench/index.html#MySQL5) goes no where (does not scroll down the page).
    Link to section "2.2" also broken. Text is "** For MySQL5 Beta Release see step 2.2" takes you to 404.html
    When i tried to download, page complained that i had not agreed to licence, despite the fact that the "Accept License Agreement" radio button was checked.

    I have updated the page and fixed the navigation links. Thanks for altering us to this.
    The radio license agreement has the "accept" checked by default, you need to click on the "Accept" radio button and will then get a "Thank you..." response. You can then select whatever you want to download.
    Do you know about the new Migration Workbench that currently in Preview release? This support migration from Microsoft SQL Server, Microsoft Access and MySQL. The new Migration Workbench will be an integral part of Oracle SQL Developer and is due for production release soon. For more information see the latest news under SQL Developer on OTN: http://www.oracle.com/technology/products/database/sql_developer/index.html
    Regards
    Sue Harper

  • Avoiding html codes and javascript codes in servlets

    Are there ways to avoid long html codes using out.println() and also javascript codes in servlets? Can I make a jsp and include that file somehow in the servlet and do the processing. Can I get reference to the fields or components declared in the jsp and also do conditional flow based on the buttons present in that jsp.
    Is it possible to include javascript files and instead call that javascript file and also the particular function in that file?
    Please also mention disadvantages if any.

    Javascript is for the client ONLY. Even if you could find a way to use it on the server side, DON'T.
    In my opinion, you should have ZERO logic (except for validation via JavaScript) in your JSP. Have a Servlet do all logic/business rules. The Servlet will create one or more Java Beans that hold ALL dynamic content for a page. Use the Servlets RequestDispatcher to forward the request to the JSP upon completion. The JSP should do nothing more than grab these beans (from the HttpSession object) and fill in the dynamic parts of the page.
    By doing it this way, you seperate the logic and presentation. You can add different 'flavors' (WML, XML) by simplying creating a new JSP page that looks for the same Java Beans, but has different template text.

  • html-el and javascript access

    Hi, I suppose this is a bit of a newbie question but I'm trying to fix a bug on code I've inherited. Basically the <html-el> tag defines the following and works fine
    <html-el:form action="saveConsumer" styleId="consumerForm" disabled="${consumerForm.formDisabled == 'true'}">
    However, there are a couple of fields on the form that call a javascript function to independently enable/disable the fields depending on which user is logged in, so I'm trying to access the value of the consumerForm.formDisabled boolean within javascript but can't seem to do so, I've tried whats below but it won't work - any help would be much appreciated!
    Thanks.
    Ray.
    <script type="text/javascript">
         function connectionPolicyToggle() {
              var element = document.getElementById('connectionPolicy');
              if (element.value == 'ALWAYS') {
                   document.getElementById('connectionThreshold').disabled='true';
                   document.getElementById('connectionFrequency').disabled='true';
              } else {
                   document.getElementById('connectionThreshold').disabled='document.consumerForm.formDisabled.value';
                   document.getElementById('connectionFrequency').disabled='document.consumerForm.formDisabled.value';
         }

    Thanks for that
    Just in case anyone else needs a simple version:
    var SlideNumber = 4;
    if(typeof window.cp === 'undefined'){
        if(SlideNumber != '') {
    document.getElementById('Captivate').cpEISetValue('m_VarHandle.cpCmndGotoSlideAndResume', SlideNumber  -1);
    }else
        if(SlideNumber != '') {
                window.cpCmndGotoSlideAndResume = SlideNumber-1;
    Thanks
    Luke

  • How to add dynamic name value pair to html link and retrieve them?

    *topic
    Someone, please help me with a code example. A simple example will do.

    And the setClientAttributes() takes Set object, so i added ClientAttributeTag and then set it in HashSet. Is this the way to do it ??
    and how can i set string value in ClientAttributeTag.setValue() ??
    Please help.
    Sudeep

  • Html:link submit and passing parameters

    I need to submit the form when the <html:link ..... > is clicked/pressed and also need to pass parameters.
    <jsp:useBean id="mapParams" class="java.util.HashMap"/>
    <c:set target="${mapParams}" property="theKey" value="${theValue}"/>
    <c:set target="${mapParams}" property="theKey1" value="${theValue1}"/>
    <html:link href="javascript:document.myform.submit()" name="mapParams" >
    <c:out value="${custItr.empName}"/>
    </html:link>
    When i click on the link getting javascript error which says "syntax error". when I remove the "name" attribute in <html:link> there is no error but I need to have the name attribute to pass the parameters.
    How to do both the submit and passing of parameters using <html:link>? Your help is appreciated.
    Thanks.

    Parameters can only be passed like that to an actual URL. eg http://localhost:8080/myApp/showEmployee?id=123&dept=Sales
    In this case, you are using the link tag to invoke javascript - not a url. URL Parameters don't apply to this string
    If you are indeed submitting a form, I would suggest that you instead go with putting hidden fields on the form to submit the value.
    Use <html:hidden>

  • Filting html tags, css, and javascript with regex

    hi everyone,
    im writing a small application where a user types in a url, and the text of the webpage is displayed in a text area.
    ive got it to work, however it takes some time, and also alot of content i dont want is displayed - tags, scripts and sometimes css.
    initally i filtered out the html tags with a regular expression, but i still get alot of unwanted content.
    im not a confident java programmer, and the idea of parsing html, css and javascript is the scariest idea ever to me, so my next idea is to keep only everything between the <body> tags - everything above and below it is deleted - hopefully that should leave me only with the visible content on the site.
    ive messed around with regular expressions but i cant get it to work, can anyone help out?
    thanks alot,
    Torre

    Darryl.Burke wrote:
    I tried out the regexes I posted on the source of a forum page, which is not valid html (contains two each opening and closing body tags). With a bit of trial and error I was able to remove everything upto the first, and not the second, opening tag by using a reluctant qualifier, ^.*?, but couldn't for the life of me achieve removal of only the last closing tag, leaving the other, invalid one intact. How would you do that?Regexes always try to match the first occurrence of whatever they're looking for (the sentinel), and there's no way to change that behavior (but it would be handy if you could). What you have to do instead is make sure the rest of the regex can't match the sentinel. For that you need lookahead, and the simplest way to use it is to scan the rest of the text looking for the sentinel and, if it doesn't find one, go ahead and gobble up the remaining text: "(?is)</body>(?!.*</body).*$" However, if there are many occurrences of the sentinel, you could take a serious performance hit. Here's a much more efficient way: "(?is)</body>(?:[^<]++|<(?!/body>))*+$" After matching the sentinel, this regex gobbles up anything that's not the first character of the sentinel, or the first character as long as it isn't followed by the remaining characters of the sentinel. The advantages of this regex are that it never has to backtrack, and the lookahead is only applied when it's necessary, where the first regex applies it every time.

  • html:link with lots of overlapping sinle an double quotes

    Hi,
    Take a look at the following code please, and let me know how can I figure out the problem?
    <html:link href='<%="javascript:gotoUrl(' "+
    myobject.getAstring()
    +" ')"%>' >

    My rules are to go into steps, from the outside in:
    1) Lets make a link.. Outermost quotes will be double.
    <html:link href="" >2) What do we want to put into the link? A javascript call. So lets add that. Don't forget the ; at the end
    <html:link href="javascript:gotoUrl();" >3) The javascript function takes a string parameter. Since it is an inner quotes, we will use single:
    <html:link href="javascript:gotoUrl('');" >4) The parameter passed to the javascript function comes from a scriptlet:
    <html:link href="javascript:gotoUrl('<%= myobject.getAstring() %>');" >This way, it should be more clear about which quote open and close each other, and you learn to limit what needs to come out of the scriptlet code, making it easier to read.

  • Send over HTML-Link an string to PDF with openparameters ?

    Hi,
    is it possible to open an 3D-PDF over an HTML-Link and commit the 3D-PDF any strings (I´m not mean a searchstring for the internal searchfunction)?
    Thanks for help !

    It's very difficult to explain by words.
    I need an help in this forum because I want to make my book(interactive pdf) opens an external application that is a sort of presentation with video and images created in director.
    If I try to create an hypertextual link between a button and this file  I don't have the chance to choose it. So I thought to write a script like - launch "start.app"- to make my presentation run ( it happens if I ask the script to run).
    But I wonder: - how can I make this event happen only  when I ask to my project to do it?-
    For example: I am reading my book on adobe digital edition and at the end of the third chapter, there is an image.  I mouse up and I understand it's a button. When I click on, it opens a new window with my presentation running and I watch it. At end I quit and I keep on reading my book on Adobe digital edition.
    Have you an idea?
    I hope I have explained it much better?!?!

  • Problem in html:link tag in struts

    hi every body i have a problem i have to pass two dynamic variable to next page using html:link tag how can i send it
    for example
    <a href = "editEmp.jsp?id=<%= empSno %>&&delete=no"> Edit </a>
    should be coverted into <html:link >and i want to pass 2 parameters to next page how can i do can anybody help

    i have used forward only but how to passs variable dynamically in forward for eaxmpleeee
    i am retreving records from database
    emdID name desig
    1 suresh PM edit
    2 ram PL edit
    when user clecks on link of edit of suresh then i should pass controll to edit page with his empID an parameter............
    i have done this prevoiusly by href tag like
    while (rst.next()) { %>
                        <tr>
                             <% empSno = rst.getInt ("ID");%>
                             <td align = "left"><%= empSno %></td>
                             <td align = "left"><%= rst.getString ("empno") %></td>
                             <td align = "left"><%= rst.getString ("empname") %></td>
                             <td align = "left"><%= rst.getString ("desig") %></td>
                             <td><a href = "strutsEx/ch05/editEmp.jsp?id=<%= empSno %>&&delete=no"> Edit </a>&nbsp&nbsp&nbsp&nbsp<a href = "editEmp.jsp?id=<%= empSno %>&&delete=yes"> Delete </a>
                             </td>
                        </tr>
    now i want to use html:link action in place of HREF can u help me plzzzzzzzzzz

  • How do I get Firefox to connect to HTML links?

    When I receive e-mail with an HTML link, and I click on the link, it attempts to download that page with Microsoft Internet Explorer. I hate MS Internet Explorer. When I am on a web page with Firefox, and there is a link, I click on it and it downloads the site with Firefox just fine.
    == This happened ==
    Every time Firefox opened
    == a month, or so, ago.

    I forgot to add that the MS Internet Explorer thing happens when I am using Mozilla Thunderbird.
    Thanks,
    DonaldS

  • Button and JavaScript link (help)

    I would like to know how to make a link to open in to a new
    window and..., I have been using javascript links to open images in
    small windows; <a href="images/samples/SampleSC.gif"
    onclick="return popitup('images/samples/SampleSC.gif')"> These
    links work in the html, and I would like to add this link to a
    button(or something) in flash 8
    The following is in my html to make the links work, but if I
    just get the above link somehow imbedded in to a button I think it
    will work from there
    <script language="javascript" type="text/javascript">
    function popitup(url) {
    newwindow=window.open(url,'name','height=490,width=720,scrollbars=yes');
    if (window.focus) {newwindow.focus()}
    return false;
    </script>
    I am so new to this. I have tried adding the following to the
    action script but it did not work;
    homepage_btn.onRelease = function () {
    getURL("
    http://www.macromedia.com",
    "_blank");
    I found the following ways to do this
    http://www.abcpchelp.com/temp/URL2.htm
    but either I did not know how to use them or they did not work
    The flash file I am working on is here:
    http://www.msresume.com.au/Default1Draft.aspx
    (the links will be in the sample thumbnails)
    Thank you, your time is appreciated!

    michael- wrote:
    > I would like to know how to make a link to open in to a
    new window and..., I
    > have been using javascript links to open images in small
    windows; <a
    > href="images/samples/SampleSC.gif" onclick="return
    > popitup('images/samples/SampleSC.gif')"> These links
    work in the html, and I
    > would like to add this link to a button(or something) in
    flash 8
    >
    > The following is in my html to make the links work, but
    if I just get the
    > above link somehow imbedded in to a button I think it
    will work from there
    >
    > <script language="javascript"
    type="text/javascript">
    > function popitup(url) {
    >
    newwindow=window.open(url,'name','height=490,width=720,scrollbars=yes');
    > if (window.focus) {newwindow.focus()}
    > return false;
    > }
    > </script>
    >
    All you need is one simple line in flash an none of the HTML
    stuff.
    getURL("javascript:n_name=window.open('page.htm','thewin','width=720,height=490,scrollbars =yes');void(0);");
    Take note tho, this might not work tested locally. You need
    to upload to server and
    test it online.
    Now, if you have multiple windows, change the "thewin" to
    something like "thewin1" "thewin2" etc...
    If you keep requesting window with same name, you end up
    loading other content into it.
    New name assure new object and new window made.
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Getting links and its names from a html file

    Hi everyone
    My problem about the a getting links with name from a html file. For example
    &#304;n a web page in this site ?SUN? when use click SUN the browser open http://java.sun.com
    &#304; want both of them, so the links and name. I can succeeded the get link but i don t know how to get the link name.
    For example :
    <B>setRightComponent(Component)</B>
    &#304;n this code segment i want to get B tag. But how i don t know. To get A tag i used this code
    List result = new ArrayList();
    try {
    // Create a reader on the HTML content
    URL url = new URI(uriStr).toURL();
    URLConnection conn = url.openConnection();
    Reader rd = new InputStreamReader(conn.getInputStream());
    // Parse the HTML
    EditorKit kit = new HTMLEditorKit();
    HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
    kit.read(rd, doc, 0);
    // Find all the A elements in the HTML document
    HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
    while (it.isValid()) {
    SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
    String link = (String)s.getAttribute(HTML.Attribute.HREF);
    if (link != null) {
    result.add(link);
    it.next();
    &#304; can use B tag but i don t know hot to get its value because it has no prefix such as HREF....
    i am sorry if i use a bad explanation style or incorrect word.

    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    class GetLinks
        public static void main(String[] args)
            throws Exception
            // Create a reader on the HTML content
            Reader reader = getReader( args[0] );
            // Parse the HTML
            EditorKit kit = new HTMLEditorKit();
            HTMLDocument doc = (HTMLDocument)kit.createDefaultDocument();
            doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
            kit.read(reader, doc, 0);
            // Find all the A elements in the HTML document
            HTMLDocument.Iterator it = doc.getIterator(HTML.Tag.A);
            while (it.isValid())
                SimpleAttributeSet s = (SimpleAttributeSet)it.getAttributes();
                String href = (String)s.getAttribute(HTML.Attribute.HREF);
                int start = it.getStartOffset();
                int end = it.getEndOffset();
                String text = doc.getText(start, end - start);
                System.out.println( href + " : " + text );
                it.next();
        // If 'uri' begins with "http:" treat as a URL,
        // otherwise, treat as a local file.
        static Reader getReader(String uri)
            throws IOException
            // Retrieve from Internet.
            if (uri.startsWith("http:"))
                URLConnection conn = new URL(uri).openConnection();
                return new InputStreamReader(conn.getInputStream());
            // Retrieve from file.
            else
                return new FileReader(uri);
    }

  • HTML links in Vibe Feed and digest e-mails do not work on GW 8.0.3client

    I have GroupWise 8.0.3hp1 on NetWare 6.5.8 and a Vibe 3.3 install on
    SUSE 11 (the downloadable Vibe demo virtual machine from Novell's site).
    I have recently started upgrading GroupWise clients on Windows 7 PCs
    (64bit), and have been testing Vibe. I have run into a problem with
    HTML links in GW clients not working on PCs where the GW client has been
    upgraded.
    This problem occurs using the GroupWise 8.0.3hp2 and 8.0.3hp3 clients,
    but does not occur on a 8.0.2hp2 client, so it appears to be GroupWise
    client related. I haven't tested any other client versions.
    1. When using the GW 8.0.3 client, if I select any of the "Novell Vibe
    OnPrem", "Favorites", or "My Teams" folders, I can see the Vibe Feed
    display showing entries for sites I'm following. But clicking on the
    links in these entries does nothing, so I cannot use the Vibe Feed to go
    directly to files, profiles, etc. The same Vibe Feed links from the
    Vibe web browser interface or from a GW8.0.2hp2 client works fine.
    2. If I have e-mail digest notifications setup to let me know when
    changes are made to a folder or file in Vibe, the e-mails are delivered
    to me just fine. But once again, none of the links in the e-mails work
    when using the GW8.0.3 client. Clicking on them does nothing. If I
    look at the e-mail message source, I can copy-and-paste the URLs
    directly into a browser and they work fine, so the URLs themselves are
    correct. Again, these links work fine if I use the GroupWise WebAccess
    or a GW8.0.2hp2 client.
    Is the GW 8.0.3 client is blocking these HTML links? I receive no
    notification from the client asking whether to "unblock" any
    links/scripts/images when viewing messages with these Vibe links.
    Any suggestions for getting these to work on GW 8.0.3 client?
    Thanks,
    -Greg
    former e-mail for posting:
    [email protected]

    Greg,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

Maybe you are looking for

  • Doubt in RSRT regarding generate query.

    Hi All, I have a doubt in transaction code RSRT (Query monitor). Under the tab environment, there are 2 options. 1) Generate queries. 2) Gen.Queries directly as shown below. i.e in RSRT> Environment> Generate Query and   RSRT> Environment> Gen. Query

  • To send output as a PDF attachment via email

    Hi experts I have the (smartform) output data in OTF format..and displaying it in PDF form with FM 'HR_EFI_SHOW_PDF_FORM' . Now the requirement is <b>to send this output as a PDF attachment via email</b>. Please help me with sample code to perform th

  • XMLTABLE() with XSQL and XSL

    HI Gentlemen, I have an XMLTYPE table with data loaded in it, which I would like to query with JDeveloper, formatted. For normal relational tables it works fine. However, for an XMLTYPE table, where--in addition--XMLTABLE() must be involved, I only g

  • Still error occurs!

    Hi all, I'm struggling for implementing some Applet using JFileChooser to let user to choose uploading file and process the file by the servlet. I have set the policy files to grant the access to the local machine directory, and the JFileChooser appl

  • My navigation bar issue

    I am trying to create a template page for a site with a roll-over button navigation bar. I can't seem to make each pg different, I'd like for a different  button to start down on each pg depending on which pg they are on. I have tried putting an edit