How To Get The CLOSE Event In a JSP File?

Hello everybody,
Right now I am working in a JSP project which is about access log, when the users start , oprate, or close the system, the access log system works. I am in trouble in that when the users close the system, how can I get the close event?
The JSP file contains the following fields :
Close Window
How to add code to get the CLOSE Event and submit to the service?
And If I hit the "Close Button"(on the right-top of the window), how can I get the CLOSE event, too?
Can anyone tell me?

1. Add a hidden field:
<input type="hidden" id="status" value="">2. modify <a href="index.jsp" onclick ="parent.window.close( );">Close Window</a> with <a href="index.jsp" onclick ="closefn();">Close Window</a>3. Add a javascript
<script language="javascript">function closefn(){
document.getElementById('status').value="close";
document.form.action="";
document.form.method="post";
document.form.submit();
parent.window.close( );
}4. Now on the action page get the value of status by request.getParameter("status"); and log it.

Similar Messages

  • How to get the attribute value of an XML file??

    How to get the attribute value of an XML file??
    For example, how to get name and age attributes?
    <student name="Joe" age="20" />

    What are you using to read the XML file??
    On the assumption of JDOM - www.jdom.org. Something along the lines of:SAXBuilder builder = new SAXBuilder(true);
    Document doc = builder.build(filename);
    Element root = doc.getRootElement();
    List children = root.getChildren();
    Element thisElement = (Element)children.get(n);
    String name = thisElement.getAttributeValue("name")
    try
         int age = Integer.parseInt(thisElement.getAttributeValue("age"));
    catch (Exception ex)
         throw new InvalidElementException("Expected an int.....");
    }Ben

  • Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?

    Programming help - how to get the read-only state of PDF file is windows explorer preview is ON?
    I'm developing an application where a file is need to be saved as pdf. But, if there is already a pdf file with same name in the specified directory, I wish to overwrite it. And in the overwrite case, read-only files should not be overwritten. If the duplicate(old) file is opened in windows (Win7) explorer preview, it is write protected. So, it should not be overwritten. I tried to get the '
    FILE_ATTRIBUTE_READONLY' using MS API 'GetFileAttributes', but it didn't succeed. How Adobe marks the file as read-only for preview? Do I need to check some other attribute of the file?
    Thanks!

    Divya - I have done it in the past following these documents. Please read it and try it it will work.
    Please read it in the following order since both are a continuation documents for the same purpose (it also contains how to change colors of row dynamically but I didnt do that part I just did the read_only part as your requirement) 
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b?quicklink=index&overridelayout=true
    thanks!
    Jason PV

  • How to get the table Event action in the controller???

    HI
    Based on my requirement i have extended my controller,but i want to perform some validation like ,,,,
    i have table in one region ,in which one column is having a Button (flex field) action with image,
    i want to write the code in the controller according to the validation ,,,,but i am unable to find the event action in the main controller,
    how to get the event action ?,,,,, of the item type as image
    thanks in advance
    Kash

    If not you can use image component with clientListener and serverListener to preform your requirement set clientListener click event and then inside clientListener java script method call the
    serverListener then will execute serverListener method.

  • How to get the pull path name from a file upload window

    Hello everyone!
    I have encountered the following problem with the following JSP code:
    <form method="post" action="filename.jsp">
    Upload JAVA program:
    <input type=file size=20 name="fname" accept="java">
    <input type=submit value="go">
    </form>
    <%
    String s = "";
    if (request.getParameter("fname") != null)
    s = request.getParameter("fname")
    %>
    The value of s is alway the filename. However I want to get the full path in addition to the filename, so that I can read the file. Does anyone know how to get the pull name of the file?
    thanks a lot in advance,

    Dear Sir,
    thanks a lot for your reply. Please let me explain what I intended to do: I want to upload a file from the local machine and then read the content of the file. Therefore I need to the fullpath of the filename like /var/local/file.java instead of file.java. The latter is what I got.
    The problem I have with your code is that the function like "request.getServerScheme()" is not recognized. Maybe is it because I didn't install servelet package? I only installed javax package btw. Also my application runns on Tomcat server if this could give you some information. The error message I had is as follows:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:133: cannot resolve symbol
    symbol : method getServerScheme ()
    location: interface javax.servlet.http.HttpServletRequest
    url = request.getServerScheme()
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:136: cannot resolve symbol
    symbol : method getServerScheme ()
    location: interface javax.servlet.http.HttpServletRequest
    + ((("http".equals(request.getServerScheme()) && request.getServerPort() != 80)
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:137: cannot resolve symbol
    symbol : method getServerScheme ()
    location: interface javax.servlet.http.HttpServletRequest
    ||("https".equals(request.getServerScheme()) && request.getServerPort() != 443))
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:139: cannot resolve symbol
    symbol : method getServletConfig ()
    location: interface javax.servlet.http.HttpServletRequest
    + "/" + request.getServletConfig().getServletName()
    ^
    An error occurred at line: 36 in the jsp file: /addExercise.jsp
    Generated servlet error:
    /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost/tutor/org/apache/jsp/addExercise_jsp.java:140: cannot resolve symbol
    symbol : variable path
    location: class org.apache.jsp.addExercise_jsp
    + "/" + path
    ^
    5 errors
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:413)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • How to get the link report of a swf file to the set of clases

    He  But How to get the link Report of the SwF File

    Here are some links with additional information:
    http://stackoverflow.com/questions/185252/optimizing-flex-when-multiple-modules-are-used
    http://livedocs.adobe.com/flex/3/html/help.html?content=modular_4.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
    http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_14.html
    If this post answers your question or helps, please mark it as such.

  • How to get the view tree from a jsp page

    Hi,
    I would like to get the view tree of a jsp page. The idea is to dynamically include the content of one or more jsf pages into a UIPanel during a "value changed" event.
    So, i could get from an arbitrary page like ...
    <%@ taglib uri="http://java.sun.com/jsf/core"   prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html"   prefix="h" %>
    <h:panelGrid columns="3" width="100%" rowClasses="gridTop">
        <h:outputText value="#{someBean.someValue}"/>
    </h:panelGrid>... the corresponding List of components...
    Any idea?

    Thanks for your answer Jayashri,
    The view tree can be retrieved by this way during the page is parsed, for example with scriptlets <%%>, or once the page has been parsed (the view has been builded and attached to the FacesContext).
    My problem is to get the view tree of a page from another Context.
    The idea is to build a dynamic layout of some pages that represents "views". I can imagine this like the concept of perspectives and views of Eclipse IDE.
    Because of the difficulty to build it with pure JSP (cannot use dynamic ID nor JSTL ForEach), I try to build it into my backing bean and to bind it with a <h:panelGrid/>. By this way, I'm not able to use the <jsp:include/> tag as I usually did to include some content into the view tree.
    Sorry for my english ;)
    - Renaud.

  • How to get the Clinet IP address in PAR files

    Hi Frndzz...
    My requirement is  to get the log on details of portal users, here i need the User ID n client IP address .
    Am trying to  get these details from masthead iview PAR file, and this details am passing to a java(custom) class which can create a log_Test.txt file with these details.
    User ID am gettiing using UME API like this in masthead PAR file
    public void GetWelcomeID(IPortalComponentRequest request, String welcomeClause)
    IUserContext userContext = request.getUser();
    String usr =userContext.getLogonUid();
    But am unable to get the Client IP
    In normal JSP will get the client IP like this   request.getRemoteAddress()
    So in par file i used the IPORTALCOMPONET request to get the client IP,  i thought IPORTALCOMPONET request  is equalent to HTTPSERVLETRequest request interface.
    Any one suggest me that how we can get the Client IP in PAR files .
    Thanks in Advance
    Regards
    Rajesh

    Hi,
    This is a very interesting question, i searched many time before to get an answer for this on sdn. I havn't found solution. As i know, It is very diffcult to find the ip address from request object.
    The main reason is, before reaching the servlet class the request is by pass through other node like dispatcher/central node. If you try to fetch request objects ip from server class i think it will only return you the dispatcher server ip only.
    There is a solution for this problem.. if you are able to fetch the ip using some client side scripting and pass it to the servelet as parameter, i hopes you can acheive this.
    I will try this and let u know the result.
    Others please share your thoughts on this topic.
    Regards
    Baby

  • How to get the cancel event of inlineDocument-style dialog.

    Hi experts,
    My customer has a question about ADF dialog framework.
    When we open new inlineDocument-style dialog from af:commandButtton, how can we get dialog cancel event?
    [Sample code]
    <af:commandButton id="cb2" action="dialog:test"
    windowModalityType="modeless"
    text="dialog:test" windowHeight="500"
    windowWidth="800"
    windowEmbedStyle="inlineDocument"
    useWindow="true"/>
    When we use af:popup, it has popupCanceledlListener attribute so that we can handle the situation where users click close button or Esc button.
    Does dialog have a similar feature?
    We can set a returnListener for dialog, but it doesn't work in case users click close button.
    Regards,
    Atsushi

    is this what you are looking for [url http://www.oracle.com/technetwork/developer-tools/adf/learnmore/77-ok-cancel-support-in-dialog-351871.pdf]Handling the af:dialog Ok and CANCEL buttons
    and [url https://blogs.oracle.com/jdevotnharvest/entry/strategies_for_controlling_the_af]Strategies for controlling the af:popup close event
    Edited by: Mohammad Jabr on Apr 27, 2012 11:34 AM

  • How to get vi close event..??

    Hi i am a begginer in labview.
    I have a main Vi, and i am using a sub vi for communicating to device via COM1 (RS232).
    The problem if the main vi is stopped or closed then i want to make sure that COM1 has been released.
    So i want to check and close if COM1 is open in the main VI but i dont know how to get an event of vi closing or stopping..

    Holy Mackerel! a 3633px x 757px jpg?  Not sure what the point of that was since the VI was probably smaller than that image.
    In any case I think you might benefit from going though the LabVIEW basics course.  If you're trying to do what I think you don't need a notification of when the VI is done because there can be output from your VI to preserve data flow.  If you use that VI and say have an ouput terminal of an error cluster (instead of handling it in this VI) then when data comes out of that error cluster you know the VI is done executing.  A similar thing could be done using sequence structures, you'll know the VI is done when it goes to the next state in the sequence strucutre.  This is the less prefered method.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • How to get the closing event (not closed) of Dialog control

    Hi All,
    I have one requirement, that I have to close the Dialog box in an animated way like on clicking of the Dialog close button the popup has to close from top to bottom in a slide effect.
    sap.ui.commons.Dialog
    When I tried closed method of Dialog, it is calling only after dialog box closed but, I need the closing event rather closed event.
    I am putting a UI5 view in Dialog as I need some custom/dynamic content in the dialog.
    Please suggest the solution for this.
    Thanks & Regards,
    Pavan Thirunamala,
    [Moderator Message - Please do not provide contact information like Phone Number etc in the discussion message. It has been removed.]
    Message was edited by: Chandrashekhar Mahajan

    JS Bin - Collaborative JavaScript Debugging&lt;/title&gt; &lt;link rel=&quot;alternate&quot; type=&quot;application/jso…
                sap.ui.getCore().getEventBus().subscribe("sap.ui","__beforePopupClose",
    function(channel, event, params)
      debugger;   
    $(params.domNode).animate({
                      opacity : 1,
                  height : 0

  • How to get the entries in a jar/zip file contained within a jar/zip file?

    If I want to list the jar/zip entries in a jar/zip file contained within a jar/zip file how can I do that?
    In order to get to the entry enumeration I need a Zip/JarFile:
    ZipFile zip = new ZipFile("C:/java_dev/Java_dl/java_jdk_commander_v36d.zip");
    // Process the zip file. Close it when the block is exited.
    try {
    // Loop through the zip entries and print the name of each one.
    for (Enumeration list =zip.entries(); list.hasMoreElements(); ) {
    ZipEntry entry = (ZipEntry) list.nextElement();
    System.out.println(entry.getName());
    finally {
    zip.close();
    Zip file "java_jdk_commander_v36d.zip" contains two zip entries:
    1) UsersGuide.zip
    2) JDKcommander.exe
    How to list the entries in "jar:file:/C:/java_dev/Java_dl/java_jdk_commander_v36d.zip!/UsersGuide.zip"?
    The following code:
    URL url = new URL("jar:file:/C:/java_dev/Java_dl/java_jdk_commander_v36d.zip!/UsersGuide.zip");
    JarURLConnection jarConnection = (JarURLConnection)url.openConnection();
    zipFile = (ZipFile)jarConnection.getJarFile();
    would point to "jar:file:/C:/java_dev/Java_dl/java_jdk_commander_v36d.zip", which is no help at all and Class JarURLConnection does not have an enumeration method.
    How can I do this?
    Thanks.
    Andre

    I'm not sure I understand the problem. The difference between a zip and jar file is the manifest file; JarFile is extended from ZipFile and is able to read the manifest, other than that they are the same. Your code
    for (Enumeration list =zip.entries(); list.hasMoreElements(); ) {
    ZipEntry entry = (ZipEntry) list.nextElement();
    System.out.println(entry.getName());
    }is close to what I've use for a jar, below. Why not use the same approach? I don't understand what you're trying to do by using JarURLConnection - it's usually used to read the jar contents.
    String jarName = "";
    JarFile jar = null;
    try
        jar = new JarFile(jarName);
    catch (IOException ex)
        System.out.println("Unable to open jarfile" + jarName);
        ex.printStackTrace();
    for ( Enumeration en = jar.entries() ;  en.hasMoreElements() ;)
        System.out.println(en.nextElement());
    }

  • How to get the data of table from JSP to Servlet?

    Hi,
    I have a dynamic editable table of 3 columns on a jsp. On click on any cell the usr can edit the data. Now on click of submit button on the jsp I need to submit or get the whole data of all the rows to a servlet which would further process it.
    How do I do that?
    TIA.

    I am not sure whether u r getting my doubt or not
    properly. I am populating the table data in an
    arraylist of DO. with this arraylist I am displaying
    the data on the Screen.
    <%
    for(int i=0;i<alList.size();i++)
    DO d = alList.get(i);
    %>
    <Table>
    <tr>
    <td><%=d.getfirstField()%></td>
    <tr>
    </Table>
    <%
    %>
    The above code sniipet displays the data on screen.
    But as table being editable i would change the data
    in the cell and submit .
    So how do i capture this data? I cannot name the cell
    becos I am not sure how many rows would be displayed.
    In servlet I would use request.getParameter(?);
    TIAIf you table is editable nad has input field to edit then "malcolmmc's " answer will work perfectly.
    you can also use hidden form fields to use those vaues at servlet like this
    <input type="hidden" name="UniqueName' value="<%=d.getfirstField()%>'>
    Here UniqueName should be the unique for each cell value so that on servlet you can fetch these values using request.getParameter("UniqueName").

  • How to get the number of lines of a file?

    Folks:
    Is there a way to get the number of lines of a text file? I don't know if there is an existing method to do that.
    Thanks a lot.

    HI
    I found some solution
    other than increment loop and all
    here is the code it might helpful to u
    //returns the number of lines in a file
    //author : Ravindra S
    //Symphony software Hyderabad
    try
    RandomAccessFile randFile = new RandomAccessFile(csvFile,"r");
    long lastRec=randFile.length();
    randFile.close();
    FileReader fileRead = new FileReader(csvFile);
    LineNumberReader lineRead = new LineNumberReader(fileRead);
    lineRead.skip(lastRec);
    countRec=lineRead.getLineNumber()-1;
    fileRead.close();
    lineRead.close();
    catch(IOException e)

  • How to get the HttpServletRequest object in a jsp

    Hi,
    I am a little confused here. Am trying to use the HttpServletRequest object in my jsp. I have set up just a simple test page jsp. How can i use the HttpServletRequest object to get some information about the request for example using the method getPathInfo(). I know i can do this in a servlet and pass the value as a parameter in a doGet method. But how do i do it in a jsp. Can it be done..?
    Pls help
    Thankyou

    The request object is already created for you in JSP, as are many other things
    request - the HttpServletRequest object
    response - the HttpServletResponse object
    session - the HttpSession object
    application - the ServletContext object
    out - the JspWriter object (like PrintWriter)
    So you just use them...
    <%
    String asdf = request.getParameter("asdf");
    %>

Maybe you are looking for

  • Acrobat DC fails to install

    I am an Adobe CC user. In the last week, Acrobat fails to work. I've tried to update it and the only option is to update it to Acrobat DC. I try to do the update and the update just hangs. I am using Windows 7 and rarely have any trouble with my lapt

  • Airport problem with WEP

    Hi, I started having problem connecting to WEP 40/128-bit ASCII access point after installing the following updates. http://www.info.apple.com/kbnum/n305031 I always get an error something like.. "There was an error connecting on the airport network

  • Migration from SQL Server 7 to Oracle 8i

    I am new to Oracle, is there a way to migrate all tables and store procedure form SQL Server 7 to the oracle database thanks; null

  • Revaluate material issues in Production order WIP

    hello All We are long cycle time industry and Business would like to revaluate the material issues in the WIP if there are any changes in the standard cost of the issued material. Is it possible w/o ML implementation? regards mahesh

  • Time Difference Calculation Using Shared Variables

    I have a subreport that is passing times(HH:MM:SS AM) through shared TIMEVAR variables to a main report.  I am trying to use these shared variables to calculate a time difference between the shared variable and one in the main report.  The shared var