Problem in executing a javascript link on a jsp page

I am having a problem in executing a javascript function from a link. For example if i click some link let say Discover and behind the scene some applet method is supposed to be called, but it is not called? However the the function name comes in the url area (address bar of internet explorer) like javascript:document.switchApplet.discover()
Can anybody help me solving this problem?
Moreover, just for a hint, i think i have deleted some registery value of such time so that's why it is not working. But i am not sure.

what is d error u r getting ???
Is it java script error? yes then u can find the line no.
view the source code or ur page and find whether ur .js is including properly or not? means whether the path is correct ?

Similar Messages

  • Executing a shell script from a jsp page

    Hi,
    I'm facing a problem while executing a shell script from a jsp page.
    I'm using Runtime.exec() function.
    It's working fine for single statement scripts.But if the script consists of any database processing and some other processing statements,it's not returning the correct exit status of the process.
    Will u please help me in this.
    If there is any other ways to execute a shell script from a jsp page other than Runtime.exec() like RMI etc,.If so let me know.
    Thanks in advance.

    Hello,
    It's hard to help you but what you can do is listening to the outputs of your script, you should read the output stream and error stream and send them to the default console.
    Check this excellent article : http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
    Best regards,
    Olivier.

  • Using hyper-links in a jsp pages that are in a Session

    Hi i am trying to include a hyper-links in my jsp pages that are in a Session, however when i use the links to navigate throughout the pages i get a java.lang.NullPointerException. The Session begins after the user has been validated i.e
    String cid= request.getParameter("counsellorID")
    session.setAttribute("counsellorID",cid);
    All the pages included within the session have a session scope=session
    ; and they call the attributes that have been set when the session first begins i.e
    String counsID= (String) (session.getAttribute("counsellorID"));
    Any advice on this problem would be most appreciated!
    Many Thanks
    Stephen

    check if you borwser have cookies enabled

  • How to include custom taglib in javascript on a given jsp page

    Hi,
    How to include custom taglib in javascript on a given jsp page?
    i have a jsp page on which i am adding selectboxes using javascript.
    But now i have created my own custom select box and want to add it on a given jsp page.
    is the code to create the box box.
    <sample:pickListOptions employeeId="abcs123"/>
    but how should i embed it in javascript, so that i will be able to add it on the give jsp page.
    Thanks,
    Javaqueue

    when the jsp page is loaded for the first time it contains a select box containg names created by a taglib.but there is a feature i want to add wherein though javascript the name selectebox will keep on coming on each row i want to add. and this is row addition and deletion is being handled by the javascript. there i encounter the bug how to interact the javascript with taglib so tha with each row addition i will have populated taglib created select box on each row.
    Thanks,
    Javaqueue

  • How can I access JSP variables from a JavaScript function in a JSP page?

    Respected sir
    How can I access JSP variables from a JavaScript function in a JSP page?
    Thanx

    You may be get some help from the code below.
    <%
        String str="str";
    %>
    <script>
        function accessVar(){
           var varStr='<%=str%>';
           alert(varStr);// here will diplay 'str'
    </script>

  • Executing sudo linux commands through a JSP page.

    Hi,
    I need to execute some superuser commands through a JSP page under Linux.
    I added users apache and tomcat to the /etc/sudoers file with no password prompting.
    My JSP page works fine with any usual linux command, but when I call a “sudo cmd” I have a message (when reading the ErrorStream instead of the InputStream) that “sudo can’t be executed because it needs a tty” even when I call the shell before the sudo command.
    Here is a piece of my code (very basic):
    String cmd="linux_cmd";
    Process proc = Runtime.getRuntime().exec(cmd);
    InputStream stdin = proc.getInputStream();
    InputStreamReader isr = new InputStreamReader(stdin);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ( (line = br.readLine()) != null)
    out.println(line);
    Is there any way I can make sudo calls from a JSP page ?
    I know that making root calls from a web application is a bad thing, but for now security is not my concern.
    Thank you for any tips.

    JavaFan2 wrote:
    In fact, I help supervising a student project who is supposed to write an admin application to offert graphical interfaces for some security and system tools under Linux (like fdisk, iptables etc) using J2EE, ... something like Webmin.
    As I said, I know that is has a huge security risk but this app has the only purpose of learning J2EE, no security issues are treated.If you want to say "I will leave my office door open because there's no security risk in doing that" then that's a valid statement. But what you are trying to do here isn't the equivalent of leaving your office door open. It's the equivalent of finding a master key for all the offices in the world. And as such it is in fact a serious security risk which should not be circumvented.
    And no, it's no good saying "But I'm only going to use this all-powerful master key to open my own office door". If you get the key then anybody else can get the key too.

  • Problem in opening pdf  or fdf  File in JSP page through firefox in Linux

    Hi,
    In my Webapplication , i have given link to FDF document available in server in a JSP page on click of which the corresponding FDF document should open in a new browser.
    Consider the location of FDF file in my server is
    ServerIP/MS/RDTEST/RDTEST-D-08-10245.fdf
    In my JSP link to FDF file is provided as follows.
    newpath="smb://"+username+":"+password+"@"+serverip+"/MS/RDTEST/RDTEST-D-08-10245.fdf" ;
    <a class ="one1" href="<%=newpath%>" target="dynamic" > RDTEST-D-08-10245 </a>My Requirement is When i click on the link it should open the corresponding fdf file in the browser by following the link provided.
    But it is not working if i try in this way.
    Can anybody suggest how to proceed with this issue.
    Any other ways are there to open fdf file exisitng in server in Firefox in A Linux machine.
    What settings to be made in firefox to support FDF or PDF features.
    What prerequisites needed in Linux to enable FDF or PDF features.
    I have Adobe Acrobat professional 5.0 installed in my Linux machine.
    Thanks in advance.

    Is your problem
    -. That a new browser window doesn't open?
    Solution: [Lookup the 'target' attribute|http://www.w3schools.com/HTML/html_links.asp]
    - That your file content isn't streaming to the browser?
    Solution: Your code assumes the browser understands and supports samba. This isn't always the case (IE for example). And you're providing a direct link to your file with the username and password - security concerns as well as possible portability issues. You'd be better off writing a [file servlet to download your files|http://www.google.com/search?q=file+download+servlet]

  • How to put Download Links on a Jsp Page?

    Hi,
    I am a student and I am working as an intern. This is my question:
    My boss wants me to put some download links(pdf and flash files) on to a jsp page. when a user clicks on the link, all the user info (i.e. name, filename, download time etc) should be stored in a database and then a pop up should appear asking user where you want to download the file.
    I have done most of the part but there is a problem. when a user "left click" on the link then it opens the PDF file in the browser. but if the user "right click and select save target as" then it brings up the box. My boss dont need the user to VIEW the file by left clicking it. I mean on both clicks a pop-up box should appear.
    one more thing to note is that, the PDF are not on the same server. I mean they do not have the same context path.
    Here is what I am doing:
    on the link page:
    sample
    on the other page (which stores information):
    // ... this is downloadfile.jsp
    response.setContentType("application/force-download");               
    String filename = request.getParameter("file");          
    String path = "http://www.domain.com/pdf/" + filename;
    bean.addDownloadDetails(session.getAttribute("email").toString(), filename, request.getRemoteAddr());  // save info in database
    response.sendRedirect(path);
    // ...any ideas or help is appreciated.
    Thanks.

    Straight to the question in the topic title: just use <a> links. But you already found that out. In the future please invent clear topic title covering the actual problem :)
    I have done most of the part but there is a problem. when a user "left click" on the link then it opens the PDF file in the browser. but if the user "right click and select save target as" then it brings up the box. My boss dont need the user to VIEW the file by left clicking it. I mean on both clicks a pop-up box should appear.Change the content disposition to "attachment" instead of "inline".
    one more thing to note is that, the PDF are not on the same server. I mean they do not have the same context path.
    Here is what I am doing:
    // ... this is downloadfile.jsp
    response.setContentType("application/force-download");               
    String filename = request.getParameter("file");          
    String path = "http://www.domain.com/pdf/" + filename;
    bean.addDownloadDetails(session.getAttribute("email").toString(), filename, request.getRemoteAddr());  // save info in database
    response.sendRedirect(path);
    // ...any ideas or help is appreciated.
    Thanks.Better obtain its InputStream by java.net.URLConnection and write it to the OutputStream of the HttpServletResponse. A redirect would create a brand new request, hereby dropping the current request and the response (so setting the content type makes really no sense).
    You can find some pointers in this FileServlet example: [http://balusc.blogspot.com/2007/07/fileservlet.html].

  • How can I link to a jsp page from another jsp page within websphere portal?

    Afternoon all,
    I have a websphere portlet which displays a jsp page. I want to put a hyperlink on the jsp page which when clicked will open another jsp page.
    Does anyone know how to do this?
    Thanks,
    Alex

    The anchor tag is the correct one for generating clickable links.
    <jsp:forward> is for transferring control at the server end. Its when you decide to change which page you want to show the user. ie check user is logged in. If not then forward them to login page, else display current page.
    I tried that. It does open the jsp page
    but the place and page links in the portal theme get screwed up.Whats mucked up about them? Do they point where they shouldn't?
    You might try using a <base> tag to set where relative links are resolved from.
    Cheers,
    evnafets

  • Get Javascript Value in a JSP page

    Let's say this is my javascript function in a html page
    .<head>
    <!-- Function getFields -->
    function getFields(){
    if (row >= 0){
    for(var i=0; i<costForm.elements.length; i++){
    if(costForm.elements.type == "text" || costForm.elements[i].type == "hidden"){
    dynTableFields[i] = (costForm.elements[i].value)? costForm.elements[i].value : "";
    if(costForm.elements[i].type == "select-one"){
    dynTableFields[i] = costForm.elements[i].selectedIndex;
    </head>
    How do i get the costForm.elements.length value in another jsp page. Coz the html page has dynamic rows by the users. and i need the values in the jsp page to know how many rows the user created.
    using normal request.getParameter("costForm.elements.length") doesn't work

    request.getParameter() will only get data that's been submitted thru a form or the query string of a URL. You'd have to record the length in a hidden field to read it on the back end, and then you can't just loop thru the fields like that in JSP on the server anyway, unless you have all fields named with a prefix and number, like: field1, field2, field3, etc.

  • Problem in sending drop down list value to jsp page showing  null value

    i am trying to send a drop down list value from client side to a jsp page but getting null value
    this is first page where i have accessed data from database and putted it in a drop down list
    <select name="sub">
         <%
         while(rs2.next())
         cat=rs2.getString(1);
         %><option value="<%=cat%>"><%=cat%></option><%
         }%></select>
    <input type="submit" value="Go"></input>
    now on submit i am going to another page
    where i want the selected value from drop down list to be printed
    i have used there
    <%
    String subject= request.getParameter( "sub.value" );
    out.println(subject);
    %>
    but it is printing null here what is the problem that i m facing
    thanx & reagrds
    sweety

    how to generate dynamically names for text boxes
    i am generating text boxes in while loop when selecting data from database
    while(rs1.next())
    name=rs1.getString(1);%>
    <tr>
    <td>1</td>
    <td><%out.println(name);
    //i am printing here stud_id a unique key and want to update records from following text boxes to particular stud_id
    %></td>
    <td><input type="text" name="????"></input></td>
    <td><input type="text" name="????"></input></td>
    <td><input type="text" name="????"></input></td>
    <td><input type="text" name="????"></input></td>
    </tr><%
    the structure is like
    stud_id | attended theory | conducted theory | ateended practical | conducted practical
    where attended theory, conducted theory............. are to be inputed manually for all students and then update in database
    so i am facing problem in generating names for textboxes how to do that
    so that those can be updated in database for particular student
    Thanx & Regards
    sweety

  • How to return javascript function value to jsp page

    Hi i want to retrieve values from javascript function to jsp page, how can i do that ? i am trying this but its not working
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <td>
    <jsp:param id="description" value= "<%=request.initRTE('', '')%>"/>
    </td>
    here this initRTE function is used for displaying rich text editor .....i want to retrieve back the contetnt written in this editor and save it to DB.
    Please help.
    Edited by: xtech on Apr 4, 2008 12:00 PM

    surely i will do that but my app is still not working.....
    here is my code
    </td>
    <td align="left">
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
    <script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
    <h:inputHidden id="introtext" value= "<%=request.getParameterValues(description)%>">
    <script>
    initRTE('','');
    </script>
    </td>
    in java script function i am geeting the text content
    function initRTE(rtePreloadContent, rteCSS) {
    rtePreloadContent=document.getElementById('surveyinfo:introtext').value;
    startRTE(rtePreloadContent);
    menuBuilder();
    var description= document.getElementById(rteFormName).value;
    return description;
    basically i want to get the text written in text editor in jsp and want to send it to DB.(Here initRTE() function is calling rich text editor)
    i have downloaded this editor from this url
    http://freerichtexteditor.com/page/4.htm
    and trying to embed it in my app.

  • How to use javascript functions in struts jsp page

    hi
    iam using struts jsp pages. here iam calling one javascript function. but iam not able to access the form in javascript.
    wat i have to give as form name to get the elements of the form.
    please reply me soon
    it is urgent
    vamsi

    your form has no name liek this one:
    <html:form action="/userRegistration.do" >so you cannot access the elements inside your form?
    accessing the elements inside the form will be like this:
    document.forms[0].propertyName.value;

  • How I can include js (javascript) file in a jsp page?

    Hi,
    I�ve tried to include a js (javascript) file in jsp file but it doesn�t work.
    When I try to use a js function in the browser I always receive an error. Oh, of course, I�m including the correct tag <script src= ...
    What can I do? Does the problem in the WebServer?

    I cheated and put the scripts in another '.jsp' file and had no problem...then put an include b4 the closing 'head' tag, like this:
    <jsp:include page="scrpt.jsp" flush="true" />
    I had to do it this way for debugging using JDeveloper (it doesnt seem to like '.js' files). But when the jsp is on the server I used the following line instead:
    <script language='JavaScript' src='scrpt.js'></script>
    hope this helps.

  • Problem during call java class (model layer) from jsp page (view layer)

    I created new Fusion web application so I have now to parts in the application navigator (model, viewcontroller)
    I want to write java class in the Model part as following:
    package persistence;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class DBManager {
    Connection connection = null;
    public DBManager() {
    super();
    public void init() {
    try {
    // Load the JDBC driver
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    // Create a connection to the database
    String serverName = Constant.DB_SERVER_NAME;
    String portNumber = Constant.DB_PORT_NUMBER;
    String sid = Constant.DB_SID;
    String url =
    "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" +
    sid;
    String username = Constant.DB_USER_NAME;
    String password = Constant.DB_PASSWORD;
    connection = DriverManager.getConnection(url, username, password);
    System.out.println("*");
    System.out.println(connection.getCatalog());
    } catch (ClassNotFoundException e) {
    System.out.println("Could not find the database driver");
    } catch (SQLException e) {
    System.out.println("Could not connect to the database");
    e.printStackTrace();
    and wrote JSP page in the view controller part as following :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@page import="persistance.*"%>
    <% persistance.DBManager manager = new DBManager(); %>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>Browse</title>
    </head>
    <body>
    <table>
    </table>
    </body>
    </html>
    but this I have the following error in the jsp page :type persistance.DBManager not found
    my job is to build simple ADF application using JSF and java without any ADF faces or JPA or any another technology
    thanks

    Duplicate message.
    type persistance.DBManager not found
    Add a Dependency on the Model project in the View project. In Project Properties select the Dependencies node to add dependencies.
    Edited by: dvohra16 on Jun 19, 2011 8:37 AM

Maybe you are looking for

  • Exception when trying to use web service login method

    Hi all, we've installed Discoverer, upgraded OAS to version 10.1.2 and installed the web service patch successfully. I can get the list of web service methods through http://app1.localdomain:7778/discoverer/wsi We've also created a bipublisher user i

  • All my office programs are crashing regularly, especially Outlook!!!

    MS Office programs, all of them, Outlook, Powerpoint, etc. all crashing. Started when I upgraded to Office 2013/365 Every other program is stable on the machine. Removed completely and reinstalled. Remove all display drivers completely and reinstalle

  • How do I get InCopy CC trial to open?

    I have spent countless hours in the last two days troubleshooting on my own and with adobe tech support in India. After multiple remote logins, InCopy still will not open. It is downloaded but when I try to launch the application it bounces around in

  • Synchronization of JMS queue with backup instance

    Hello,           I have the following problem: there are two machines in active - passive           configuration. Both those machines serve as JMS servers in two environments.           What I want to do is to keep a backup of JMS queue from the pro

  • Download OS X Mountain Lion

    When you download OS X Mountain Lion, does it delete everything on the mac? I have many pictures I want to be in the mac, but I don't know what to do if it is not there when i have downloaded Mountain Lion.