JavaScript + setTimeOut + JSP

Hi I have the following code,
Can someone tell me why this code aint' working.....
Session has a variable 'sessionstartime' that holds the user login time..
<script language="JavaScript">
function timesUp(type) {
if(type==0) alert("Your session will be timed out in next"+ type +" minutes.");
else if(type>0) alert("Your session has timed out. Please relogin");
else alert("Your session is still valid");
</script>
</head>
<%
// or we can use request.getSession(false) to check if session is valid
long maxTime = (session.getMaxInactiveInterval()*1000);
long currTime = System.currentTimeMillis();
long startTime=0;
long elapseTime=300000;
try{
startTime = Long.parseLong((String)session.getAttribute("sessionStartTime"));
catch(Exception e){}
long remTime = maxTime -(currTime-startTime);
long type=-1;
if(remTime==0){
type=0;
else if(remTime>0 && remTime<elapseTime){
type=remTime;
remTime=0;
else if(remTime>0)
type=-1;
remTime=0;
System.out.println("type: "+type+" remTime " +remTime);
%>
<body onload="setTimeout('timesUp(type);', <%= remTime%>);">
-----------------------------------------------------------

GOTCHA...
<body onload="setTimeout('timesUp(type);', <%= remTime%>);">
should be
<body onload="setTimeout('timesUp(<%= type%>);', <%= remTime%>);">

Similar Messages

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

  • Embed javascript in JSP

    hi
    i want to store the query string of an URL in a flat file. but i want to append the name of the person who's passing the query string by prompting him to enter his/her name. i have a code something like this
    FileWriter outputFile = new FileWriter("Libset1.txt", true);
    BufferedWriter outputBuffer= new BufferedWriter(outputFile);
    final PrintWriter outputWriter = new PrintWriter(outputBuffer);
    //writes all data to the output file
    for (int i=0; i<Selected_set1.length; i++)
    outputWriter.println("some javascript to prompt the user goes here..." + Selected_set1);
    outputWriter.close(); //closes output file
    i want to embed some javascript in place "some javascript to prompt the user goes here..." prompting the user to enter his name..
    is it possible to do that. if yes, how.?
    sorry i'm just a beginner, it might look silly for you...please help...
    thanks in advance..

    First of all, you need to understand how Javascript and JSP work together....they don't. Javascript is a client side scripting language, which means that it executes and runs in the client browser after the page has been loaded. JSP is purely server side, it only runs while the request is being serviced, or while it's generating the HTML to send back to the client browser.
    To do what you're asking for should be pretty easy using javascript. You should be able to use the Javascript onClick() event for the link the user is clicking on to execute a Javascript method that prompts the user for their name.
    You might try something like this...
    <script language="JavaScript">
    function promptUser(newPage)
      var username = prompt("Please enter your username");
      if(username)
        document.location = newPage + "&username=" + username;
    }</script>
    Click Here Please!
    This will result in a query string that looks something like mypage.jsp?id=23&view=whatever&username=john
    Make sense?

  • Parameters b/w javascript and JSp

    how i can pass values between javascript and jsp .
    ( java script varaible in the JSP part & jsp object in the javascript code )

    Since Java script is on the client side , to get the value of a java script variable into jsp, u have to set some form field variable and submit it to the server again. So, it can be something like:
    <script>
    function submit()
         var scriptVar = 12;
         document.form1.formVariable.value=scriptVar;
         document.form1.submit();
    </script>
    <%
    System.out.println("Script variable value = " +request.getParameter("formVariable"));
    %>
    <form name="form1" method="post">
    <input type="hidden" name="formVariable" value=""/>
    <input type="button" name="bSubmit" value="Submit" onclick="javascript:submit()" />
    </form>
    The first time this jsp is called, the value of formVariable will be null.
    The next time, when u click on submit button, the value will be 12.
    I have not tested this. There might be some syntax errors. Just try it out. Also, make sure that u don't end up submitting the form in an infinite loop by using the submit() generally in the script. Hope this helps.

  • Mix JavaScript and JSP

    Hi.
    I have jsp and javascript mixed when I click a check call a function javascript for example:
    //JavaScript
    function Hola(numerop) {
              idRol = Number(numerop)
              <%nombreRol = roles.get(numerop)%> }
    //Form
    <input type="checkbox" name="<%=roles.get(sum)%>" value="<%=roles.get(sum)%>" onClick="Hola('<%=roles.get(sum)%>')">
    In the function numerop is a number but in the jsp code numerop is undefined.
    How I can mixed javaScript and jsp??
    Please I need help you.

    Remember that the JSP runs on the server and generates the HTML, including Javascript. The Javascript runs on the browser after the JSP is finished. So you cannot do whatever it is you expected that to do.

  • How to genarate javascript from jsp?

    how to genarate javascript from jsp?
    Edited by: coolsayan.2009 on May 12, 2009 6:21 AM

    coolsayan.2009 wrote:
    [got an example|http://www.ibm.com/developerworks/web/library/wa-aj-simplejava1/index.html] but can you say all this specifically because i am not familier with AJAX.and i want to generate a javascript random number and by jsp i want to send it to user email.once user got the number it will be checked wheather he got it or not in next page say check.jsp if it this entry is right he will be grant to access the his account....
    What does AJAX have to do with the rest of this question? And why do you want to generate a number in JavaScript at all? If you are trying to confirm a working email address, which is what I think you are trying to do then leave that all on the server side. Generate the number in the servlet, mail it, etc. Neither JavaScript nor AJAX are any part of that.

  • Can JavaScript access JSP variable?

    Could we do this? Or, how could we have JavaScript access JSP variable?
    <%
    String fooBar = request.getParameter(......
    %>
    <script language="JavaScript">
    <!--
    if (fooBar  == ...) {
    -->
    </script>

    To access the variable in Javascript you'll have to
    write it out from the JSP. You'll need to do something
    like:
    <%
    String fooBar = request.getParameter(......
    %>
    <script language="JavaScript">
    <!--
    var fooBar = '<%=encodeQuotes(fooBar)%>';
    if (fooBar  == ...) {
    -->
    </script>You'll need to either make sure fooBar doesn't contain
    any quotes or write a function to replace each ' with
    \'.Thanks!
    That works perfectly, without encodeQuote() method in my current case.
    Thanks again. You ar a saviour.

  • Passing parameter from Servlet to javascript in JSP. Very Urgent - 5 jukes!

    Well my servlet will retrieve questions from database.
    Then the player will answer the question in the JSP and submit the answer to the servlet to process.
    Each time an answer is submitted, or a "Next Question" button is clicked, the countdown time will restart.
    And will reload the page with a new question.
    So how can i do that?
    This is my servlet, JSP, javascript
    =====================================================================
    * Interacts with the player depending on his types of selection and output them
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class GameQuestionServlet extends HttpServlet
         String sSQL = null;
         String sCategory = null;
         String paramName = null;
         User userObject = null;
         Questions gameQsObj = new Questions();
         HttpSession session;
         int cnt = -1;
         int score = 0;
         boolean connected = false;
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              session = request.getSession(false);
              //System.out.println("Testing Score:" + score);
              if(connected == true)
                   Questions object = (Questions)gameQsObj.getQsList().elementAt(cnt);
                   System.out.println("\n" + object.sAns1);
                   System.out.println(object.sAns2);
                   System.out.println(object.sAns3 + "\n");
                   Enumeration enum = request.getParameterNames();
                   while(enum.hasMoreElements())
                        paramName = (String)enum.nextElement();
                        if(paramName.equals("mcq"))
                             System.out.println(request.getParameter("mcq"));
                             score = Integer.parseInt(userObject.score.trim());
                             System.out.println("Player old score: " + score);
                             //Check to see if the selected answer matches the correct answer
                             if((object.sCorrect).equals(request.getParameter("mcq")))
                                  score = score + 10;
                             else
                                  if((object.sCorrect).equals(request.getParameter("mcq")))
                                       score = score + 10;     
                                  else
                                       if((object.sCorrect).equals(request.getParameter("mcq")))
                                            score = score + 10;     
                                       else
                                            score = score - 10;     
              System.out.println("Player current score: " + score);
              else     //will only go into this once
                   userObject = (User)session.getAttribute("user");
                   System.out.println("\n"+userObject.nric);
                   System.out.println(userObject.name);
                   System.out.println(userObject.password);
                   System.out.println(userObject.email);
                   System.out.println(userObject.score+"\n");
                   //depending on user selection
                   sCategory = request.getParameter("qsCategory");
                   sSQL = "SELECT * FROM " + sCategory;
                   gameQsObj.getQuestions(sSQL, sCategory);
                   score = Integer.parseInt(userObject.score);
                   connected = true;
              System.out.println("Connected:" + connected);
              System.out.println("Before:" + userObject.score);
              cnt = cnt + 1; //increment to retrieve next question
              userObject.score = Integer.toString(score);     
              System.out.println("After:" + userObject.score);
              if(cnt < 3) //setting for the number of questions per game.
                   //request.setAttribute("qsCnt", cnt); //count of the question number
                   request.setAttribute("aQs", gameQsObj.getQsList().elementAt(cnt));
                   System.out.println(request.getAttribute("aQs"));
                   System.out.println("This is question number: "+ cnt);
                   getServletConfig().getServletContext().getRequestDispatcher("/JSP/PlayGame.jsp").forward(request, response);
              else
                   //forward to the result page     
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
    <%@ page import="Questions" %>
    <HTML>
         <HEAD>
              <TITLE>Play Game</TITLE>
              <SCRIPT LANGUAGE="JavaScript">
                   var refreshinterval=10
                   var displaycountdown="yes"
                   var starttime
                   var nowtime
                   var reloadseconds=0
                   var secondssinceloaded=0
                   function starttime() {
                        starttime=new Date()
                        starttime=starttime.getTime()
                        countdown()
                   function countdown() {
                        nowtime= new Date()
                        nowtime=nowtime.getTime()
                        secondssinceloaded=(nowtime-starttime)/1000
                        reloadseconds=Math.round(refreshinterval-secondssinceloaded)
                        if (refreshinterval>=secondssinceloaded) {
                   var timer=setTimeout("countdown()",1000)
                             if (displaycountdown=="yes") {
                                  window.status="You have "+reloadseconds+ " second before timeout"
                   else {
                        hide();
                   clearTimeout(timer)
                             //window.location.reload(true)
                   function hide() {
                        //hidelayer
                        if(gameLayers.style.visibility == "visible"){
                             gameLayers.style.visibility = "hidden"
                             oops.style.visibility = "show"
                   window.onload=starttime
              </SCRIPT>
         </HEAD>
         <BODY>
              <FORM METHOD="post" ACTION="http://localhost:8080/Java_Assignment2/servlet/GameQuestionServlet">
                   <DIV ID="oops" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:2; visibility:hidden">
                        Oops! 30 seconds time up!!! <BR><BR>
                        <INPUT TYPE="submit" VALUE="Next Question">
                        <INPUT TYPE="hidden" NAME="nextQs" VALUE="Next Question">
                   </DIV>
                   <DIV ID="gameLayers" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:3; visibility:show">
                   <TABLE BORDER="0">
                        <TR>
                             <TH><BIG>Questions:</BIG></TH>
                        </TR>
    <%
                        Questions aQsObj = (Questions)request.getAttribute("aQs");
                        String aQsBody = aQsObj.sQs;
                        String aQsAns1 = aQsObj.sAns1;
                        String aQsAns2 = aQsObj.sAns2;
                        String aQsAns3 = aQsObj.sAns3;
    %>
                        <TR>
                             <TD><B><%= aQsBody%></B></TD>
                        </TR>
                        <TR>
                             <TD>
                                  <SELECT SIZE="3" NAME="mcq">
                                       <OPTION SELECTED><%= aQsAns1 %></OPTION>
                                       <OPTION><%= aQsAns2 %></OPTION>
                                       <OPTION><%= aQsAns3 %></OPTION>
                                  </SELECT><BR><BR>
                             </TD>
                        </TR>
                        <TR>
                             <TD>
                                  <INPUT TYPE="submit" VALUE="Submit Your Answer">
                                  <INPUT TYPE="hidden" NAME="submitAns" VALUE="Submit Your Answer">
                             </TD>
                        </TR>
                   </TABLE>
                   </DIV>
              </FORM>
         </BODY>
    </HTML>
    This must be answered before 28th of september.
    Please help. It is indeed very urgent.

    this is just a skeleton code.. alot of stuff is not here..
    <FORM name = "form1" action="../servlet/wateverSevlet>
    <input type="text" name="searchStr" size="40">
    <INPUT type="hidden" id=answer name=answer size=7>
    <input type="button" name="button" value="Submit Answer" onClick="javascript:submitCheck(document.form1.searchStr.value);">
    <input type="button" name="button" value="Skip Question" onClick="javascript:submitCheck('skip');">
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    function submitCheck(str)
      form1.answer.value = str
      form1.submit()
    </script>i assuming you are submitting it to the same servlet regardless of whether the user clicks the skip question or the submit question button.

  • Problem with Javascript in JSP

    Hi Guys,
    I have this problem with my JSP page. I am using a javascript function
    which calls a function within a bean. The problem that I have is that I get an error when trying to call the following function :
    function refDataTypes_onchange()
    Vector empNames = DBQuery.getResult();
    I get a runtime error at the line Vector empNames = DBQuery.getResult;
    Any ideas would be much appreciated.
    Below is the whole code:
    Thanks in advance
    FRank
    <%@ page contentType="text/html;charset=WINDOWS-1252"%>
    <%@ page import="java.util.*, java.lang.*" %>
    <%-- Declare the java bean for the countries to be queried --%>
    <jsp:useBean id="DBQuery" class="DBQuery" scope="page" />
    <%-- Bean property searchCondition is not set to query countries --%>
    <jsp:setProperty name="DBQuery" property="searchCondition" />
    <%
    Vector empNames = DBQuery.getResult();
    %>
    <HTML>
    <BODY BGCOLOR="GREY">
    <SCRIPT LANGUAGE="JavaScript1.1">
    function refDataTypes_onchange()
    Vector empNames = DBQuery.getResult();
    </SCRIPT>
    <FORM NAME = form1>
    Please enter in the following details
    <p>
    Reference Type :::====
    <select name="refDataTypes" onchange="refDataTypes_onchange()">
    <option value ="1"></option>
    <% for(Enumeration enum = empNames.elements();enum.hasMoreElements();)
    String nextEmpName = (String)enum.nextElement();
    %>
    <option value =<%=nextEmpName%>><%=nextEmpName%></option>
    <%
    %>
    </select>
    <BR>
    <BR>
    Emp No
    <INPUT TYPE="text" NAME=txtAge >
    <BR>
    <BR>
    <INPUT TYPE="button" VALUE="Check Details" NAME=butCheckForm >
    </FORM>
    </BODY>
    </HTML>

    Thanks dimadoo
    I need my JSP to do the following :
    When a user selects a option from a select list. There is a textfield which I want to populate based on the option that thas been selected from the list.
    I tried the following :
    <% Vector empNames = DBQuery.getResult(); %>
    and it does not even go into the bean.
    Will this work if I refresh the page?

  • How to get the value of a variable defined in javascript in JSP

    how to get the value of a variable defined in javascript in/through JSP????

    In Javascript you can use the DOM to access the input element and set it's value before submitting the form. Then it's value will just be passed.

  • Javascript to JSP question...Can javascript function set session attributes

    hello,
    i have a web app that, on one of its pages, displays "tabbed pane" as an image map at the top (a la amazon.com). my problem is this: each "logical" page contains separate forms that all use the same javabean. in other words, imagine that the tabs represent an account maintenance web ui for an on-line record store. the first tab might be labeled "General," the second "Contact info," the third "Shipping Info." Each uses the same account bean and displays portions of its properties relevant to the tab at hand. what i want to do is allow a user to enter the account maintenance ui, update info on the first tab, click on tab two and have the request with the changes sent to a processing jsp. yet, since each "tab" is actually a separate URL to another page, how do i get the updated info on the first tabe without adding some sort of "SAVE" button on each tab. ive considered using javascript, but dont know how to get the request params out of the first tab whn i click on another tab. is it possible to include an "onClick" function in each URL that "grabs" the updated form fields off the preceeding tab? can a javacript function set session attributes in jsp?

    hello there,
    wow, you've created one big mammy-jammy tool.
    first, javascript cannot access, set values to the session, without having to post to another JSP. javascript is great for manipulating objects, layers, form values, etc.
    you have 2 issues [if i understand correctly]:
    1) you need to able to save user info for a specific tab without having to reloading the page.
    ---you can create a form for EACH of your tabs and POST all the information to a hidden IFRAME or LAYER for NN4. that hidden IFRAME / LAYER will load a JSP page which with all the parameters you posted to it. or you can build a FRAMESET and target that document["frame-name"].src with that same JSP.
    2) handling when the SAVE INFO action should happen: hence some javascript event handler: onMouseOver, onClick, etc
    ---i don't know the dynamics of your tabs, but if store which tab was clicked on last, then if the user clicks on some other tab, javascript can submit that FORM to a JSP [see condition above]
    you have an interesting tool. can i see?
    i hope i wasn't too confusing, but your problem is sooo interesting. =)
    -WJP

  • Problems when using javascript in jsp

    hello, i am implementing a program to upload files.
    a user can upload either a pdf or a latex file.
    so for example if the user uploads a pdf file the form action should be
    "uploadPDF.jsp" and if it is a latex file the action is "uploadlatex.jsp"
    currently when the user uploads the pdf file IT WORKS and does the action correctly but it does not do it for the other file (latex file) gives
    some long jasper exceptions pls help
    *************here is the code*******************
    <SCRIPT LANGUAGE="JavaScript">
    var extArray = new Array(".pdf", ".tex", ".txt");
    function LimitAttach(form, file) {
    allowSubmit = false;
    if (!file) return;
    while (file.indexOf("\\") != -1)
    file = file.slice(file.indexOf("\\") + 1);
    ext = file.slice(file.indexOf(".")).toLowerCase();
    for (var i = 0; i < extArray.length; i++) {
    if (ext = "pdf"){
    document.forms[0].action.value = "uploadPDF.jsp";
    allowSubmit = true;
    break;
    if (allowSubmit) form.submit();
    else
    alert("Please only upload files that end in types: "
    + (extArray.join(" ")) + "\nPlease select a new "
    + "file to upload and submit again.");
    </script>
    </HEAD>
    and below is the form
    <form action="" name="upform"enctype="multipart/form-data">
    <input type="file" name="PDFfilename" size="50"><br>
    <input type="hidden" name="todo" value="upload">
    <input type="submit" name="Submit" value="Upload" onclick="LimitAttach(this.form, this.form.PDFfilename.value)">
    </form>
    thanks,
    moh

    when uploading this latex file in a different jsp file and form it works fine
    however in the above form it does not...........here is the exception errors:
    org.apache.jasper.JasperException: This file appears to be damaged and cannot be repaired. This may not actually be a PDF file.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    javax.servlet.ServletException: This file appears to be damaged and cannot be repaired. This may not actually be a PDF file.
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.uploadPDF_jsp._jspService(uploadPDF_jsp.java:209)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    root cause
    com.adobe.acrobat.pdfobjstore.CantRebuildXRefException: This file appears to be damaged and cannot be repaired. This may not actually be a PDF file.
         com.adobe.acrobat.pdfobjstore.XRefTableRebuilder.buildTrailerDict(XRefTableRebuilder.java:141)
         com.adobe.acrobat.pdfobjstore.XRefTableRebuilder.rebuildXRefTable(XRefTableRebuilder.java:121)
         com.adobe.acrobat.pdfobjstore.XRefTableRebuilder.<init>(XRefTableRebuilder.java:46)
         com.adobe.acrobat.pdfobjstore.XRefTable.<init>(XRefTable.java:44)
         com.adobe.acrobat.pdfobjstore.XRefTable.<init>(XRefTable.java:64)
         com.adobe.acrobat.pdfobjstore.PDFObjMap.compute(PDFObjMap.java:122)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.acrobat.pdfobjstore.PDFObjMap.getTrailerDictRef(PDFObjMap.java:49)
         com.adobe.acrobat.pdfobjstore.VTrailerDict.computeReference(PDFObjStore.java:552)
         com.adobe.acrobat.pdfobjstore.VPDFReference.compute(VPDFReference.java:150)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.acrobat.pdfobjstore.VPDFReference.pdfReferenceValue(VPDFReference.java:161)
         com.adobe.acrobat.pdfobjstore.security.VEncryptionMethod.computeString(SecurityHandler.java:208)
         com.adobe.pe.vtypes.VString.compute(VString.java:55)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.pe.vtypes.VString.stringValue(VString.java:126)
         com.adobe.acrobat.pdfobjstore.security.VPDFObjStorePerms.computePDFObjStorePerms(VPDFObjStorePerms.java:41)
         com.adobe.acrobat.pdfobjstore.security.VPDFObjStorePerms.compute(VPDFObjStorePerms.java:54)
         com.adobe.pe.notify.VValue.handleRequest(VValue.java:172)
         com.adobe.acrobat.pdfobjstore.security.VPDFObjStorePerms.peObjStorePermsValue(VPDFObjStorePerms.java:32)
         com.adobe.acrobat.gui.AcroViewContext.setByteArraySource(AcroViewContext.java:587)
         com.adobe.acrobat.Viewer$3.buildChanges(Viewer.java:907)
         com.adobe.pe.notify.Transactor.commit(Transactor.java:70)
         com.adobe.acrobat.Viewer.setByteArraySource(Viewer.java:911)
         com.adobe.acrobat.Viewer.setDocumentByteArray(Viewer.java:948)
         com.adobe.acrobat.Viewer.setDocumentInputStream(Viewer.java:971)
         org.apache.jsp.uploadPDF_jsp._jspService(uploadPDF_jsp.java:106)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    on the first line it says that the file may be corrupted but it is fine and works, thanks
    moh

  • Using javascript inside jsp

    hello
    My front end is jsp.so in jsp i want to write a javascript function for validating the form fields given by the client. so give me any simple javasript sample program....thank you.

    See: www.google.com for more information

  • Javascript in JSP Portlet error..can anybody help?

    Hi..
    I got a problem..
    I use JSP in Portlet..
    The problem is, when i put this code in Portlet, it gaves me javascript Error..not sure what to do...
    'document.standinglist._piref1_41281_1_1.next_page' is null or not an object '
    In normal situation (jsp in server, not in portlet)..it is ok..
    function cancelR(flag) {
    var total = 0;
    if ( confirm("Do you want to continue process this record ?") ) {
    document.standinglist._piref1_41281_1_1.next_page.value = "/htdocs/stand/standcancel.jsp?flag=flag";
    document.standinglist.submit();
    else {
    alert("Please select the required record!");
    }

    Hi,
    The behavior that you are seeing is an expected one. As i can understand, you have an HTML form element whose name is a fully qualified parameter & currently at runtime it is _piref1_41281_1_1.next_page If you carefully observe this, this name itself contains a period (dot).Hence when the browser tries to execute this, it thinks that _piref1_41281_1_1 is an object (which it isn't).
    The whole issue is because there is a dot in the fully qualified name which has this format _piref<portletInstanceRefId>.<ParamName>
    You could do the following to get it work. Use the following,
    document.standinglist.elements["._piref1_41281_1_1.next_page"].value = "/htdocs/stand/standcancel.jsp?flag=flag";
    Note however that this method call will not work on portal 3.0.9. when viewed using IE. This is due to IE's bizzare handling of this javascript call.
    Since, you are using Portal 9.0.2, you should not face any issues.
    Hope this helps.
    Regards,
    Abhinav

Maybe you are looking for