Request.getParameter is NULL from window.open form submit

Hi all,
We have one portlet application where a jsp page has a link which opens as a child window using the window.open function in javascript.
It has a form and some textboxes with a save submit button.When the save button is clicked the portlet processAction is called but when i try to set the renderrequest all the request.getParameters are null .I have tried both the ActionRequest and HttpServletRequest and both have nul values.
As a result me Save is failing since the request.getparametrs are null.I added the "save" as part of form action URL and its getting passsed but the other, i am unable to fetch.
My Form action is : <form name="saveEntries" id="saveEntries" action="<portlet:actionURL secure="true"/>&action=save&_pageLabel=ABC" method="post">
My process action code is :
Enumeration<String> parameters = request.getParameterNames();
          while(parameters.hasMoreElements()) {
               String parameter = parameters.nextElement();
               String[] values = request.getParameterValues(parameter);
               if(values != null && values.length > 1){
                    response.setRenderParameter(parameter, values);
               } else {
                    response.setRenderParameter(parameter, request.getParameter(parameter));
                    if(request.getParameter(parameter)!=null && "save".equalsIgnoreCase(request.getParameter(parameter))){
                         HttpServletRequest httpRequest = (HttpServletRequest) request.getAttribute("javax.servlet.request");
                         Enumeration parameterNames = httpRequest.getParameterNames();
                         Enumeration<String> httpparameters = parameterNames;
                         while(httpparameters.hasMoreElements()) {
                              String httpparameter = httpparameters.nextElement();
                              String[] httpvalues = httpRequest.getParameterValues(httpparameter);
                              if(httpvalues != null && httpvalues.length > 1){
                                   response.setRenderParameter(httpparameter, httpvalues);
                              } else {
                                   logger.debug("----------------->:ApproveTime else processAction = :Getting HTTP :parameter:"+parameter);
                                   logger.debug("----------------->:ApproveTime else processAction = :Getting HTTP :request.getParameter(parameter):"+request.getParameter(parameter));
                                   response.setRenderParameter(httpparameter, httpRequest.getParameter(httpparameter));
Any help is highly appreciated.

Hello,
One potential reason why it isn't working for you is that the Java Portlet specifications (JSR168 and JSR286) don't allow URLs to be manipulated once they are created with a a portlet:xxxURL tag. The reason for this is that the portlet container needs to be able to rewrite the URLs to properly go back through the portal framework (or over WSRP if running the portlet remotely) and to encode all the parameters needed. The portal framework could even change it from a URL to a Javascript action, where simply appending extra "&paramName=someValue" onto the end of the generated URL won't work. So this:
<form action="<portlet:actionURL secure="true"/>&action=save&_pageLabel=ABC" method="post">isn't legal by the portlet specification-- if you want to add parameters to the actionURL, you can by doing this:
<form action="<portlet:actionURL secure="true"><portlet:param name="action" value="save"/><portlet:param name="_pageLabel" value="ABC"/></portlet:actionURL>" method="post">which will add the parameters to the URL in a way that will always work with the portal framework.
One other thing to note- it looks like you're just trying to copy all of the action parameters in the request into render parameters in the response; this can be done much easier like this:
response.setRenderParameters(request.getParameterMap());Kevin

Similar Messages

  • Request.getParameter returns null - Converting webapp from Tomcat to oc4j

    I support a simple web app that passes arguments via url context variables. For some reason it does not work in OC4J. When I use request.getContextPath() I see that the URL string only contains the webapps name, not the whole URL with parameters set.
    BTW it is an OC4J cluster

    *Name:             index.jsp
    *Function:         This page is 1st url for WebApp
    *Information:      This page is used as the home page for this application.
    *Version:          1.0 (created on 2005-06-06)
    * 2.0 052406 pge
    %>
    <%@ page pageEncoding="UTF-8"%>
    <%@ page import="com.hp.itsm.api.*" %>
    <%@ page import="com.hp.itsm.api.interfaces.*" %>
    <%@ page import="java.text.Collator" %>
    <%@ page import="java.util.*"%>
    <%@ page contentType="text/html; charset=utf-8" %>
    <%@ include file="include/variables_initialize.jsp" %>
    <%@ include file="include/methods_global.jsp" %>
    <%@ include file="include/methods_servicedesk.jsp" %>
    <%
    String login = request.getParameter("u");
    String xxx = request.getContextPath();
    //Service Call objects
    ApiSDSession SDsession = null;
    IPerson[] personList = null;
    IAccount accountRequester = null;
    Boolean bError = Boolean.FALSE; //Default to no errors found
    List errMsgList = new ArrayList(); //Array of error messages
    //Get account information
    accountRequester = getAccount(SDsession, login);
    if (accountRequester == null) {
    bError = Boolean.TRUE;
    errMsgList.add("Could not retrieve the accountRequester.");
    }

  • In JSP pages request.getParameter returns null

    There are two jsp's,the first JSP has 1 textbox inside the form tag.We input the values in the textbox and submit.
    Code :Ist jsp
    <BODY>
    <HEAD>
    function validate()
    document.add.submit();
    </HEAD>
    <FORM name="add" method="post" action=/dir/two.jsp" >
    <TABLE width="37%" border="0" align="center" class="c4f3">
    <TR>
    <TD class="c4">Rating</TD>
    <TD><input type=text name="rating"></TD?
    </TR>
    <TR>
    <TD align=center><INPUT type="button" name="submitadd" value="Submit" onClick="validate()" </TD>
    </TR>
    </TABLE>
    </FORM>
    </BODY>
    After the submit it goes to the 2nd JSP page .
    code:2nd Jsp
    <%
    String Rating=request.getParameter("rating");
    out.println(" Rating "+Rating);
    %>
    The 2nd JSP pages gets the values by request.getParameter.When I use method='post' in Ist JSP ,even if I enter values in the textbox, it prints null. But when I give method="get" , it prints the value.
    Pls let me know if there is any problem in the code or its the problem due to webserver configuration.Also suggest the solution to over come this problem.
    Thanks

    If I'am right you have misplaced the opening body-tag of your first jsp-page.
    The opening body-tag should follow after the closing head tag .
    The structure of your HTML-code should look like this:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>

  • In WL6.1 request.getParameter returns NULL for URL parameters that exist

              With the following URL, I get different results between WebLogic 4.5.1 and WebLogic
              6.1:
              http://phx-kmccarthy.medspecialists.net/tsweb/ParametersTest.jsp?apple=macintosh&tree&dog&country=USA
              Weblogic 6.1 returns:
              query string = apple=macintosh&tree&dog&country=USA
              apple = macintosh
              tree = null
              dog = null
              country = USA
              WebLogic 4.5.1 returns:
              query string = apple=macintosh&tree&dog&country=USA
              apple = macintosh
              tree =
              dog =
              country = USA
              here is the jsp...
              <%--
              * ParamtersTest.jsp which shows that empty parameters are ignored in WebLogic
              6.1
              --%>
              <%
              String apple, tree, dog, country;
              apple = request.getParameter("apple");
              tree = request.getParameter("tree");
              dog = request.getParameter("dog");
              country = request.getParameter("country");
              out.println("<br>query string = " + request.getQueryString());
              out.println("<br>apple = " + apple);
              out.println("<br>tree = " + tree);
              out.println("<br>dog = " + dog);
              out.println("<br>country = " + country);
              %>
              From the documentation on the getParameter() method:
              Returns the value of a request parameter as a String, or null if the parameter
              does not exist.
              In my opinion, not existing and being empty are different. Also, every other web
              application environment we've dealt with (including WebLogic 4.5.1) treats them
              as different. If the parameter doesn't have a value, (i.e. ...&tree&dog&...) then
              getParameter() returns the empty string, not null.
              As a result of this we have JSPs that break when running on 6.1.
              

    Found the solution at last. Tomcat servlet container can't handle the chunked transfer-encoding that the J2ME Wireless Toolkit uses when you call outputstream.flush() in midlet. Using outputstream.close() instead of outputstream.flush() will avoid this problem for small requests. For all the codes in the articles on Http Post in Wireless Forum, don't use outputstream.flush() and it will run perfectly - Servlet's request.getParameter(parameterName) will work fine in doPost method.

  • In Portal, request.getparameter return NULL (Sample Monthcalendar)

    I used the sample monthcalendar. When i used it without integrated in portal, i can change month by month with ">>" button.
    In the JSP File, there is a call to the P_CALDATE parameter
    String l_inputDate = request.getParameter("P_CALDATE"); // Input Date.
    When i put this JSP file as an URL Portlet, i can't navigate month by month. the function request.getParameter("P_CALDATE") return NULL, but in the URL i have the parameter:
    http://hddms220.cg63.fr/servlet/page?_pageid=54,58,56&_dad=portal30&_schema=PORTAL30&P_CALDATE=2002-05-01.
    Someone have an idea
    Thanks in advanced

    I have tested the sample with JSERV, and all works fine.
    But if i wan't use OC4J/ORION to display a portlet how can i do it.
    Thanks in advanced

  • Hide Menu Bar from Users Opening Form

    Allow Documents To Hide The Menu Bar, Toolbars, And Window Controls
    I see this in Preferences>Documents, but how does my doc hide the Menu Bar? The doc is a form that hospital patients can fill out in a kiosk, and we don't want them to see the Menu Bar when they open the form. How do I set the form so that when it opens, the Menu Bar is not visible? Once I have the form open, I know that F9 will close it, but we want the Menu Bar to be closed whenever this form is opened. So, in short how does this work?
    Allow Documents To Hide The Menu Bar, Toolbars, And Window Controls

    That's not an option but you can run some apps such as Safari in full screen mode which hides the menu bar.
    From the Safari menu bar ckik View > Enter Full Screen
    If an app supports full screen mode, that feature should be available from the apps View menu.

  • Refer an Open Forms, Items Contents from another Open Form

    Hi All,
    I need help on the following Questions.
    Q1. How can I find the Contents of an Item in a Form from another Form in the Same session.
    Q2. How can we save contents of a Called form when the Calling form is in Changed Status. (using When Validate Trigger on the Calling Form). (Key-Next does not work in this context 'coz if a user clicks with a mouse or uses shortcut keys this trigger is not fired).
    Thanks in adv. for the reply.
    Regards
    ravi

    Is this so impossible?

  • Request.getParameter() from same page as HTML form

    I have a jsp page with a form. form contains a textfield, once the user submits the form, i want jsp scriptlet to get the
    value of the user input and carry out processing on it within the same page and give a result.
    problem is the first time the page is loaded, there is an error in the request.getParameter() statement since no form has
    yet been submitted i guess ....
    if i use another page ... it works ... but i want to display the information in the same page ...
    thanks

    I'd like to see an example where you'd get a NullPointerException from the line
    if(request.getParameter("foo") == null)
    but not one from
    if(null == request.getParameter("foo"))
    In either case, the only possibility for a NullPointerException would be if your request variable were null (but this would cause a NullPointerException in either method). Otherwise request.getParameter() returns a null value if the parameter does not exist, but will not throw a NullPointerException.

  • Window.opener doesn't work

    I have a website that seems to have just broken with the 18 or 18.0.1 release. The specific code that is breaking is a call to window.opener.
    The error I see in the console says: TypeError: window.opener.Assignments is undefined
    I checked this with IE and FF on our test servers as well as our comparison server (runs last releases version of the code) and they all have the same problem so it's not something that changed in our codebase.
    Can anyone tell me why there are javascript errors on calls to window.opener with the latest release and how I can work around this?

    I think I found the answer to my own question. In case anyone stumbles on this and it's useful.
    I think the problem was that the code was calling window.opener.form when it appears in firefox you have to call window.opener.document.form. Since both work in FF and IE and since it seems there are only a few places in the code where we aren't calling window.opener.document I'll just update the code to do that.

  • Transfer CS6 to mac from windows

    request transfer photoshop CS6 from windows to mac

    Cloud version or perpetually licensed version?
    For perpetually licensed version, follow the steps outined here
    http://helpx.adobe.com/x-productkb/policy-pricing/order-product-platform-language-swap.htm l

  • Double type for request.getParameter

    Hi , I have a page to get a parameter which is a double
    I declare :
    Double score = request.getParameter("score") == null ? "" : request.getParameter("score");
    But I got error :
    incompatible types found; java.lang.String, required:java.lang.Double.
    Any idea how to solve this.
    I appreciated for any solution.
    Thank you very much in advance.

    request.getParameter always returns a string, so you'll have to convert it to a double.
    Something like this:
    String score = request.getParameter("score");
    Double score = (score == null) ? 0 : new Double(score);

  • Form Submit doesn't work in toolbox

    Hi!
    I downloaded public accessible toolbox from Adobe webpages. In ProcessPDF.lar workflow example, there is used Formserver Submit action. Unfortunatel it throw exception and doesn't work:
    18:57:25,609 ERROR [SubmitFormService] FSQP004: An unexpected exception occurred com.adobe.formServer.interfaces.ProcessFormSubmissionException: java.lang.NullPointerException
    at com.adobe.formServer.client.EJBClient.processFormSubmission(EJBClient.java:437)
    at com.adobe.formserver.wfplugin.SubmitForm.SubmitFormService.execute(Unknown Source)
    at com.adobe.workflow.engine.PEUtil.executeAction(PEUtil.java:184)
    at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction (ProcessEngineBMTBean.java:2320)
    What is wrong? I need to extract XML data from PDF, so Form Submit action is handy :)
    Thank You for any help.
    --- Jaroslav

    Hi
    I haven't imported that particular lar file, but usually a null-pointer expection means that one of your inputs is missing.
    Howard
    http://www.avoka.com

  • Open form in new windows from another form

    hi,
    I have module for departments, and one for employees
    and I have push botton, I need when_button_pressed to open form employees in new window ( to view the employees in that department)
    I used this code
    open_form('Employees')
    but it gives me an error: FRM-30203: No items on block EMPLOYEES.
    FRM-30407: Block must have at least one database item.
    Block: EMPLOYEES
    FRM-30113: Block must have non-query-only database item.
    Block: EMPLOYEES
    Created form file C:\Users\m\Desktop\New Folder\MODULE1.fmx
    and when I click the button I get error FRM-40010 cannot read from employees
    any help would be appreciated

    but I created new module for employeesOk, so make sure that this new module contains a block EMPLOYEES, save the module as EMPLOYEE.fmb and create the fmx. Make sure the fmx is created and is located in a directory listed in the FORMS_PATH in your default.env (assuming you use 10G)

  • Getting chinese charaters from Form using request.getParameter()

    Hi,
    I want my JSPs to be unicode enabled. In HTML forms user can enter any characters like japnese, chinese etc. But on the server side if user enters any such characters i am getting decimal equivalent of that character in the form of &#{decimal equivalent}; in the request.egetParameter() method.
    For ex if I enter �&#35234;&#35235;&#35271;&#35273;&#35333; then i get "&#9570;&# 35234;&# 35235;&# 35271;&# 35273;&# 35333;" in request.getPrameter().
    I have given the charset "UTF-8" in the header of my JSPs.
    I tried to decode it with URLDecoder but it fails then i tried to read these parameters using reader but it also fails, then
    String para = request.getParameter("para"); // where para is name of received parameter
    byte[] bytes = para.getBytes();
    para = new String(bytes, "UTF-8");
    This also fails.
    Can anyone please tell me how to handel this problem?
    Thanx
    -Vaijayanti

    Hi,
    I have tried this in my jsp and it works for me, assuming that the form is submitted with encoding UTF-8 :
    Submitting JSP :
    <form action="test.jsp">
    <input type="text" name="a">
    </form>
    This is test.jsp :
    <%
    String a = new String (request.getParameter ("a").getBytes (), "UTF-8");
    %>
    Passed Parameter = <%=a%>
    Hope that helps
    Thanks
    Amit

  • Opening a list item pdf attachment from the display form in a new window

    I have a list setup in which attachments are enabled.
    Users attach pdf's to list items.
    When they go into the display form for a list item and click on a pdf attachment in the "Attachments" area at the bottom of the form, it opens in the same browser window.
    I would like to amend this so it opens in a new window.  Has anyone found a fix for this?
    Thanks in advance,
    Mark

    Hi ,
    Put the code below in your DispForm.aspx page .The you can open the attachments in a new window. Including all the other links on the DispForm.aspx page .
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
    $(function(){ 
    $('a').click(function(){
                    window.open(this.href);
                   return false;
    });</script>
    Thanks,
    Entan Ming

Maybe you are looking for

  • HT2452 my imac is slow starting up

    WHEN I START MY IMAC UP IT GOES TO GREY SCREEN FOR 2 MINS THEN I GET APPLE LOGO AND IT STARTS UP BEFORE THIS HAPPEND IT WAS VERY QUICK I HAVE HAD THE IMAC 6 WEEKS IS IT A SOFTWARE PROBLEM I HAVE LION ON IT.

  • Handling Check Boxes in the selection screen

    Hi All, I have defined 3 Check Boxes in the selection screen and one box will be ticked as 'X" by default. I need to put restriction so that only any one should be selected as 'X' whenever user wish to select. Hence any time, when user selects a box,

  • Very Strange Bug! Help me plz!

    When i downloaded and installed iTunes 10.5, it looked like this: I've already reïnstalled all my apple stuff enz. That didn't work. Now i got 10.5.1 and that didn't solve anything either. I have windows 7. Does anyone have a solution?

  • Creating array of hidden inputs - APEX 2.2

    Hi, all. Thanks for all of your help with questions I've had so far. I want to create an array of hidden inputs and put them into a collection on page submit. My intention is to create this array in JavaScript. I realize I can probably just create a

  • Can't process songs.

    Hey guys itunes has worked great for me for a long time now. But lately there have been some songs (not all) that I have tried downloading over and over and yet it never "processes". It downloads the whole thing but will get stuck on processing for h