Search Results

Search found 2 results on 1 pages for 'user236501'.

Page 1/1 | 1 

  • JSP getParameter problem

    - by user236501
    I have a form, if the timer reach the form will auto redirect to the Servlet to update database. My problem now is if javascript redirect the window to servlet my request.getParameter is null. function verify(f,whichCase){ if(whichCase == "Submit"){ msg = "Are you sure that you want to submit this test?"; var i = confirm(msg) if(i){ parent.window.location = "sindex.jsp" } return i; } } I doing this because i got a iframe in my jsp. Timer update problem have to use iframe. So, when time up or user click submit parent.window.location can let me refresh parent window <form method="POST" action="${pageContext.request.contextPath}/TestServlet" onSubmit="return verify(this,whichPressed)"> My form when user click submit button within the timing, it will trigger the verify function to let user confirm submit. So inside my TestServlet i got this, because using javascript redirect request.getParameter("answer") this keep return me null. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getParameter("Submit") != null) { String ans = request.getParameter("answer"); Answer a = new Answer(ans, no); aa.CreateAnswer(an,t.getTestCode(),username); RequestDispatcher rd = request.getRequestDispatcher("/sindex.jsp"); rd.forward(request, response); } } Below are my timer when time up redirect to TestServlet trigger the doGet method if((mins == 0) && (secs == 0)) { window.alert("Time is up. Press OK to submit the test."); // change timeout message as required var sUrl = "TestServlet"; parent.window.location = sUrl // redirects to specified page once timer ends and ok button is pressed } else { cd = setTimeout("redo()",1000); }

    Read the article

  • JSF commandbutton id inside datatable

    - by user236501
    How can I add in commandbutton inside datatable? <hx:dataTableEx value="#{searchData.searchFriends}" var="s"> <hx:columnEx> <f:facet name="header"> <h:outputText value="First Name" /> </f:facet> <hx:requestLink action="#{pc_Search.doAddFriendAction}"> <h:outputText value="Add as Friend" /> <f:param name="friendId" value="#{s.memberId}" /> </hx:requestLink> </hx:columnEx> </hx:dataTableEx> To get the data at backend String friendId = (String)getRequestParam().get("friendId"); But once I change the requestlink to command button the friedId = null? any idea how can i pass value using command button

    Read the article

1