Request.setParameter ?

I know, this method does not exist, but how can I change/ set parameters in a request? I need to add parameters to a request before I forward to another .jsp...

I can't (for internal reason). I know I can always use
beans or the session for storing data, but in this
case it has to be the request because I cannot modify
the page that will get the request...
Basically, the scenario is like this:
Page 1. A form that allows the User to search through
a database using 4 different fields.
Page 2. This page shows the search results. Each line
is clickable and will return a detail view.
Page 3. This page is the detail view. It needs to get
all (!) data to display from the request, and cannot
(!!) be modified.
<%
// this is in page 2.
// you pick all parameters...
String parameterQuery="?";
String parameter="";
String[] parameterValue = new String[1];
Enumeration paramNames = request.getParameterNames();
while( paramNames.hasMoreElements() )
parameter = (String)paramNames.nextElement();
parameterQuery += parameter+"=";
parameterValue = request.getParameterValues(parameter);
parameterQuery += parameterValue[0];
if(paramNames.hasMoreElements())
     parameterQuery += "&";
%>
SOLUTION 1
<%-- works but I would not use it, overkill --%>
<html>
<head>
</head>
<body>
<%
int i=0;
while( hasMoreDetails )
//the detail is clickable as you said, and so you can send the parametes to page3.jsp.
%>
<a href="page3.jsp<%=parameterQuery%>">detail<%= i++ %></a>
<%
%>
</body>
</html>
SOLUTION 2
<%-- good solution but you need to use javascript --%>
<html>
<head>
<script>
function sendForm( aDetailId )
     //this will sett the detailId in the form to a detailid from the clicked link.
     document.yourform.detailID.value = aDetailId;
     //no submit the request to page3.jsp
     document.yourform.submit();
</script>
</head>
<body>
<%
int i=0;
while( hasMoreDetails )
//the detail is still clickable and will be sended to page3.jsp with a detailid.
%>
<a href="javascript:sendForm('<%= aDetailId %>');">detail</a>
<%
%>
<%-- you have the request in one form, no need for overkill --%>
<FORM NAME="yourform" METHOD="LINK" ACTION="page3.jsp<%=parameterQuery%>">
<INPUT TYPE="HIDDEN" NAME="detailID" VALUE="">
</FORM>
</body>
</html>
I ve not tested all functions, but this should work...
maybe you have to make some changes, but I hope u understand the idea.
GOOD LUCK!

Similar Messages

  • Get a parameter from a Request

    Hello everybody,
    I noticed that there is not a method like request.setParameter(...,...), so i was wondering if i can use the method request.setAttribute(...,...) to put an object in the request and then get it with the method request.getParameter().....;anyway what is the difference between a Parameter and an attribute in the request object?
    Cheers.
    Stefano

    Hello,
    Basically the difference I see is that a request's parameter is information that is already part of the request. An attribute is something that you add into a request and is not essential to the object. As for putting an object in there it can be done with the setAttribute just as you mention.
    Hope this helps

  • Partner for request.getParameter?

    Hello,
    Does Servlet API contain any methods to add parameter to
    querystring?
    I have a situation where I should add key=value-pair to request
    that I am forwarding to other servlet.
    How can this kind of thing be handled?
    There are no request.setParameter or response.setParameter methods
    or I did not find them. And using request.setAttribute does not work in
    this case.
    Is it possible to do a own new request and fill a new
    key=value-pair there ?
    Can anyone help me?
    Thanks,

    Here's an extract from the servlet spec:
    Java Servlet Specification Version 2.2 39
    In the ServletContext and ServletRequest methods which allow the creation of a RequestDispatcher using path information, optional query string information may be attached to the path. For example, a Developer may obtain a RequestDispatcher by using the following code:
    String path = ?/raisons.jsp?orderno=5?;
    RequestDispatcher rd = context.getRequestDispatcher(path);
    rd.include(request, response);The contents of the query string are added to the parameter set that the included servlet has access to. The parameters are ordered so that any parameters specified in the query string used to create the RequestDispatcher take precedence. The parameters associated with a
    RequestDispatcher are only scoped for the duration of the include or forward call.
    i.e. you can add or override parameters by including them on the getRequestDispatcher() path.

  • Calling a java static method from javascript

    I am running into issue while calling a java static method with a parameter from javascript. I am getting the following error. Any help is greatly appreciated.
    Thx
    An error occurred at line: 103 in the jsp file: /jnlpLaunch.jsp
    pfProjectId cannot be resolved to a variable
    =================================================
    // Java static method with one parameter
    <%!
    public static void CreateJnlpFile(String pfProjectId)
    %>
    //Script that calls java static method
    <script language="javascript" type="text/javascript">
    var pfProjectId = "proj1057";
    // Here I am calling java method
    <%CreateJnlpFile(pfProjectId);%>
    </script>
    ===================================================
    Edited by: 878645 on Mar 6, 2012 11:30 PM

    Thanks, Got what you are telling. Right now I have one jsp file which is setting the parameter 'pfProjectId' and in another .jsp I am retrieving it. But I am getting null valuue
    for the variable. I am wondering why I am getting null value in the second jsp page?.
    Thx
    ====================================================================
    <script language="javascript" type="text/javascript">
    // Setting parameter pfProjectId
    var pfProjectId = "proj1057";
    request.setParameter("pfProjectId", "pfProjectId");
    </script>
    // Using Button post to call a .jsp that creates jnlp file
    <form method=post action="CreateJnlpFile.jsp">
    <input type="submit" value="Create JNLP File">
    </form>
    //Contents of second .jsp file CreateJNLPFile.jsp
    String pfProjectId = request.getParameter("pfProjectId ");
    System.out.println( "In CreateJnlpFile.jsp pfProjectId " + pfProjectId );
    =======================================================

  • JSP- Servlet- Same JSP - Urgent HELP!

    I have a scenario as follows:
    The JSP is a Login JSP which forwards the request to the Servlet to validate the Login info from the HTML. This I do by submitting the JSP page to itself & in the beginning checking if the Submit button was clicked, if yes, then I extract all the form elements by request.getPArameter(element name) & set in on the request using request.setAttribute() methods! The servlet uses the values by doing a request.getAttribute() & say, a validate User failure, the servlet ahs tor edirect user to the same Login.jsp page, but the second time, the "Submit" button value is still true, since the servlet forwards the same request, response & this ends in an infinite loop, of JSP calling Servlet, the User validation fails & the Servlets calls the JSp again, and so on.
    How do I reset the HTML form element values in the JSP before forwarding to the Servlet? is there a request.setParameter() method? Or is there a way for the servlet to forward a new request & response to the same JSP?
    Thanks in advance.

    if the user is invalid.. redirect them to the error page and in the error page pu this javascript... It will refresh the page so the loop will not happen.
    <script language="JavaScript">
    var sec2count = "2"
    var redirectpage = "Login.jsp"
    function countdown() {
    if (sec2count == "0") {
    document.location = redirectpage
    else {
    sec2count = sec2count - 1
    document.form1234.counter.value = sec2count
    setTimeout("countdown()", 1000)
    countdown()
    </script>

  • Error printing twice

    String error_msg = (String)((DynamoHttpServletRequest)request).getObjectParameter("message");
    int msg=error_msg.indexOf("some string");
    if (msg >=0) {
         StringBuffer new_error_msg= new StringBuffer();
    ((DynamoHttpServletRequest)request).setParameter("message",new_error_msg.toString());
    else {  //when it enters this else loop, the error message is printing twice. how to restrict this
    if (error_msg.startsWith("the ShipTo me")) {
         StringBuffer new_error_msg= new StringBuffer();
    if (error_msg.indexOf("phone number") >= 0) {
    new_error_msg.append("The " + error_msg.substring(14));
    else {
              new_error_msg.append(error_msg.substring(14));
    error_msg = "The "+ new_error_msg.toString();
    ((DynamoHttpServletRequest)request).setParameter("message",error_msg.toString());
    else if (error_msg.indexOf("zip code is not valid") > -1 ) {
         ((DynamoHttpServletRequest)request).setParameter("message","Invalid Zip");
    When it enters the first else loop, error messages are printing twice. how to stop this error messages printing twice?It should print error messages once.

    I corrected the problem by doing the following:
    1. created a commit action in my ui model and renamed it to save.
    2. put a UniquePkValidationBean on my primary key so that the overridden setAttributeInternal method would throw a JboException
    Thanks,
    David

  • How to convert ResultSet's value to String

    Dear JDC's
    plz tell me how to convert ResultSet's value to String.
    kashif

    I want to read a whole array from a table into a String[]
    and then send it to another servlet before I forward it all to anther servlet with request.setParameter.....
    Any ideas how to solve it....that is how far I got so far:
    rs=pgresult("select count (answer) from answers where qid="+idnum);
                                                           numberofquestions = rs.getInt("mynumber");     
                                                           rs=pgresult("SELECT answer FROM answers WHERE qgroup="+qgroup);
                                                           allanswers = new String[numberofquestions];
                                                           allanswers = (String[])rs.getArray(1).getArray();     
                                                           req.setParameter("allanswers",allanswers);
                                                           RequestDispatcher dispatcher = req.getRequestDispatcher("editanswers");
                                                           dispatcher.forward(req,res);
    Tobi

  • ATGDustCase - Unable to load the components when the nuclues is starting up

    Hi,
    Below is the ATGDust Case code to unit test existing DropletInvoker. But when we invoke the code it is unable to start the nucleus and throwing error like:-
    Unable to resolve component /atg/dynamo/service/groupconfig/Configuration
    java.lang.NoSuchFieldError: TRACE
    at org.jboss.logging.Log4jLogger.translate(Log4jLogger.java:60)
    I am using ATG 10.2 and I have tried with various Log4j versions like:-
    log4j-1.2.13.jar
    log4j-1.2.14.jar
    log4j-1.2.17.jar
    But none of them worked, all these JARS are in the .classpath as well as JUnit classpath. But still the above error persists? Below is the Junit test class in ATGDust.
    public class DropletInvokerTest extends AtgDustCase
      String ATGHOMEPROPERTY = "C:/ATG/ATG10.2/home";
      final String ATGHOME = "C:/ATG/ATG10.2/home";
      static boolean isNucleusUp;
      Nucleus mNucleus;
      Logger mLogger = Logger.getLogger(this.getClass());
      * Start up Nucleus with Initial services
      protected void setUp() throws Exception
      super.setUp();
      String dynamoHome = System.getProperty(ATGHOMEPROPERTY);
      if (dynamoHome == null)
      System.setProperty(ATGHOMEPROPERTY, ATGHOME);
      File configpath = null;
      configpath = NucleusTestUtils.getConfigpath(
      DropletInvokerTest.class,
      DropletInvokerTest.class.getName(), true);
      copyConfigurationFiles(new String[]
      { "D:/ATGDust_Test/modules/junit/commerce/config" },
      configpath.getAbsolutePath(), new String[]
      { ".svn" });
      mNucleus = NucleusTestUtils.startNucleusWithModules(new String[]
      { "DAS", "DafEar" }, this.getClass(), "/atg/dynamo/droplet/Switch");
      * Shut down Nucleus
      protected void tearDown() throws Exception
      super.tearDown();
      ServletUtil.setCurrentRequest(null);
      if (mNucleus != null)
      NucleusTestUtils.shutdownNucleus(mNucleus);
      mNucleus = null;
      /** Test the DropletInvoker */
      public void testInvoker() throws ServletException, IOException
      doTestSwitch();
      public void doTestSwitch() throws ServletException, IOException
      DropletInvoker invoker = new DropletInvoker(mNucleus);
      DynamoHttpServletRequest request = invoker.getRequest();
      DropletResult result = null;
      request.setParameter("value", "foo");
      result = invoker.invokeDroplet("/atg/dynamo/droplet/Switch");
      assertNotNull("Make sure that foo got rendered",
      result.getRenderedOutputParameter("foo"));
      System.out.println("result.getRenderedOutputParameter(foo)-->"
      + result.getRenderedOutputParameter("foo"));
    Please Clarify , what is the problem here?
    Regards,
    ATGCrazy

    Hi,
    To add the local administrators in the User Rights assignments
    1) Start>Run>gpedit.msc
    2) Computer Configuration>Windows Settings>Security Settings>Local Policies>User Rights Assignments
    3) Double click  on Back up files and directories and add the Administrators.
    4) Double click  on Restore files and directories and add the Administrators.
    5) Close  the window and reboot the machine.
    6) Try to add the machine to the domain.
    If  the issue persist, Reset the security database.
    1) Open MMC
    2) Add Security Configuration and Analysis tool
    3) Right click Security Configuration and Analysis in the left pane
    4) Select open database
    5) In the new database, type in secnew.sdb, click ok.
    6) Select setup defltbase.inf as the template to import from C:\Windows\inf, click ok.
    7) Rightclick Security Configuration and Analysis in the left pane again
    8) Select configure computer
    9) Reboot the machine.
    10) Try adding the machine to the domain.
    Hope this helps!
    Best Regards
    Elytis Cheng
    Elytis Cheng
    TechNet Community Support
    By the way folks, this is the FIX that worked for me.  No need to go re-installing the OS
    Paul E Coz

  • HttpUnit Testing error

    Hi all,
    HAPPY NEW YEAR to every one.
    i have one problem in HttpUnit, i used below code to login the page, i entered same un and password directly in IE login is working, but in HttpUnit below program not login, another method testContactUs Link click is working properly.
    Thanks,
    import com.meterware.httpunit.*;
    import junit.framework.*;
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import junit.framework.TestCase;
    public class TestHttpUnitTest extends TestCase {
        public static void main(String[] args) {
            junit.textui.TestRunner.run(MainHttpUnitTest.class);
        public TestHttpUnitTest(String name) {
            super(name);
    public static void testLogin() throws Exception {
            WebConversation wc = new WebConversation();
            WebRequest request = new GetMethodWebRequest("http://localhost:7001/project/flow.jx?stateID=start");
            WebResponse response = wc.getResponse(request);
            WebForm loginForm = response.getForms()[0];
            request = loginForm.getRequest();
            request.setParameter("userID", "password");
            request.setParameter("tempID", "tempPASS");
            response = loginForm.submit();
            //response = wc.getResponse(request);
            assertTrue("Login rejected while logging in with 'tempID'",
                    response.getText().indexOf("Invalid Username or Password") != -1);
            String text = response.getText();
            System.out.println("Login Response:" + text);
    public static void testContactUsClick() throws Exception {
            WebConversation wc = new WebConversation(); // create a new web client
            WebResponse response = wc.getResponse( "http://localhost:7001/project/index.html" ); //get the response from Web Server
            response = response.getLinkWith("contact us").click();
            System.out.println("The title of the ContactUs page is: " + response.getTitle());
    }

    So the password is passed to a field named "tempID"? That's odd. The next step might be to make sure your code is grabbing the right form.
    You're doing this:
    WebForm loginForm = response.getForms()[0];Are you sure that is returning the one you think it is? You should do some debugging (using a real debugger to step thru the code and examine things, or use a "poor man's debugger" by simply adding some System.out.println statements in there to let it show you what form the code actually retrieved).

  • Help!!!How to test Servlet?

    how to test servlet with the code below.
    in method doPost or doGet,
    doPost(HttpServletRequest req,HttpServletResponse resp)
    DataInputStream dis =null;
    String data="";
    dis = new DataInputStream(req.getInputStream());
    data=dis.readUTF();// readInt(),readBoolean() ,etc may applied
    System.out.println("data:"+data);
    if i code req.getParameter("param"); then i wrote test programm like this request.setParameter("param","something");the servlet can get the value.
    my question is ,how can i test the code above?how to set the input value so that the HttpServletRequest object can read the data?

    1) Do yoiu mean how to "run" your servlet code with sample parameter? This call manual testing with a sample run of you code. You need a web server(eg Tomcat), create a webapp with your servlet then deploy it there in order to run it.
    2) httpunit and junit are framework to write test case code that can be automated and repeatable. Plz read their doc.
    3) Your sample code me a very wrong way to retrieve and convert servlet parameters.
    Get a java toturial and servlet tutorial book and read it over the weekend. You need to get at least the basic.

  • Parameter passing from jsp to jsp in diffrent domain

    Hi All,
    I need to pass parameter from one jsp to other in diffrent domain.
    I am using
    <form name ="menuForm" method="post" action="http://xxx/vijay.jsp">
    <input type="text" name="userid" value="<%=mySession.getAttribute("userid")%>">
    </form>
    The problem i am facing I can't really use this because on the view soure people can see easily what i am passing .Is there any other way i can pass the parameter without exposing them.
    Vijay

    That's an nice suggestion ,I have already have JCE for db password.
    but by using
    <input type="text" name="userid" value="<%=mySession.getAttribute("userid")%>">
    people can still see the contains in the html source.
    This is all because they removed
    request.setParameter() method
    Vijay

  • Struts and JSP problem..help needed

    Hi,
    I am trying to use request.setParameter("formatName") from the JSP page into the ACtion class to display the user entered values.
    I have my struts action classes tagged to be in session scope since the UI is a wizard and i want the values to be carried on until they click finish. on the wizard.
    I want the formatName floating across the wizard, I have another value called."Category" floating since its a dynamically generated variable using the formbean.
    ***************ACTION class****************
    public class CreateFormatReportDefinitionAction extends Action
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
         final Logger logger = Logger.getLogger(this.getClass());
    ActionErrors errors = new ActionErrors();
    ActionForward forward = new ActionForward(); // return value
    ClarityReportDefinitionFormBean rdFormBean = (ClarityReportDefinitionFormBean) form;
              HttpSession session = request.getSession();
              List fList = new ArrayList();
              FormatDAO fDAO = new FormatDAO();
              Format fmt = null;
    try {
              logger.log(Level.INFO, "Entering CreateFormatReportDefinition Action...");
              Person person = PersonUtil.getCurrentUser(request);
              logger.debug("Category is: "+rdFormBean.getCategory());
              List formats = fDAO.findFormatsForCategory(rdFormBean.getCategory());
              for(int i=0;i < formats.size(); i++) {
                   fmt = (Format)formats.get(i);
              if(fmt.getOwner().getEmailaddr().equals(person.getEmailaddr())){
              fList.add(fmt);
              rdFormBean.setUserFormatList(fList);
              logger.log(Level.DEBUG,"sessionObject for formName is: "+session.getAttribute("formatName"));
    } catch(Exception e) {
    // Report the error using the appropriate name and ID.
    errors.add("name", new ActionError("id"));
    // If a message is required, save the specified key(s)
    // into the request for use by the <struts:errors> tag.
    if (!errors.isEmpty()) {
    saveErrors(request, errors);
    // Write logic determining how the user should be forwarded.
    forward = mapping.findForward("success");
    // Finish with
    return (forward);
    ***********JSP form for the class****************
    <html:form action="/createFilterAction" >
    <table>
    <tr><td>
    <html:text property="formatName" />
    </td></tr>
              <tr>
                   <td>
    <html:select property="myFormats" onchange="insertSelectedMyFormat()">
    <html:option value="">Select user Formats</html:option>
    <c:forEach var="formats" items="${reportDefFormBean.userFormatList}">
    <html:option value="${formats.name}"><c:out value="${formats.name}"/></html:option>
    </c:forEach>
    </html:select>
    </td>
              </tr>
    </table>
    </html:form>
    ***********JAVASCRIPT**********
    var box = document.reportDefFormBean.myFormats;
    function insertSelectedMyFormat()
         var hisFormat = box.options[box.selectedIndex].value;
         document.reportDefFormBean.formatName.value = hisFormat;
    ********STRUTS_CONFIG.XML*****************
    <form-beans>
         <form-bean name="reportDefFormBean"
                   type="com.ibm.ads.reports.web.formbeans.ClarityReportDefinitionFormBean"></form-bean>
    </form-beans>
    <action name="reportDefFormBean" path="/createFormatReportDefinition"
                   type="com.ibm.ads.reports.web.actions.reportDefinition.CreateFormatReportDefinitionAction"
                   scope="session" validate="false">
                   <forward name="success" path="/createFormatReportDefinition.jsp"/>
    </action>
    I am getting a null for Session.getAttribute("formatName") or even if i change the scope to request, i use request.getPArameter("formatName"), i get null again.
    I dunno what iam missing in this regard, but if anyone has found anything wrong with my code...please help me out.
    any time spent will be appreciated.
    Thank you and regards,
    dev

    Hi,
    I am trying to use request.setParameter("formatName") from the JSP page into the ACtion class to display the user entered values.
    I have my struts action classes tagged to be in session scope since the UI is a wizard and i want the values to be carried on until they click finish. on the wizard.
    I want the formatName floating across the wizard, I have another value called."Category" floating since its a dynamically generated variable using the formbean.
    ***************ACTION class****************
    public class CreateFormatReportDefinitionAction extends Action
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    final Logger logger = Logger.getLogger(this.getClass());
    ActionErrors errors = new ActionErrors();
    ActionForward forward = new ActionForward(); // return value
    ClarityReportDefinitionFormBean rdFormBean = (ClarityReportDefinitionFormBean) form;
    HttpSession session = request.getSession();
    List fList = new ArrayList();
    FormatDAO fDAO = new FormatDAO();
    Format fmt = null;
    try {
    logger.log(Level.INFO, "Entering CreateFormatReportDefinition Action...");
    Person person = PersonUtil.getCurrentUser(request);
    logger.debug("Category is: "+rdFormBean.getCategory());
    List formats = fDAO.findFormatsForCategory(rdFormBean.getCategory());
    for(int i=0;i < formats.size(); i++) {
    fmt = (Format)formats.get(i);
    if(fmt.getOwner().getEmailaddr().equals(person.getEmailaddr())){
    fList.add(fmt);
    rdFormBean.setUserFormatList(fList);
    logger.log(Level.DEBUG,"sessionObject for formName is: "+session.getAttribute("formatName"));
    } catch(Exception e) {
    // Report the error using the appropriate name and ID.
    errors.add("name", new ActionError("id"));
    // If a message is required, save the specified key(s)
    // into the request for use by the <struts:errors> tag.
    if (!errors.isEmpty()) {
    saveErrors(request, errors);
    // Write logic determining how the user should be forwarded.
    forward = mapping.findForward("success");
    // Finish with
    return (forward);
    }***********JSP form for the class****************
    <html:form action="/createFilterAction" >
    <table>
    <tr><td>
    <html:text property="formatName" />
    </td></tr>
    <tr>
    <td>
    <html:select property="myFormats" onchange="insertSelectedMyFormat()">
    <html:option value="">Select user Formats</html:option>
    <c:forEach var="formats" items="${reportDefFormBean.userFormatList}">
    <html:option value="${formats.name}"><c:out value="${formats.name}"/></html:option>
    </c:forEach>
    </html:select>
    </td>
    </tr>
    </table>
    </html:form>***********JAVASCRIPT**********
    var box = document.reportDefFormBean.myFormats;
    function insertSelectedMyFormat()
    var hisFormat = box.options[box.selectedIndex].value;
    document.reportDefFormBean.formatName.value = hisFormat;
    }********STRUTS_CONFIG.XML*****************
    <form-beans>
    <form-bean name="reportDefFormBean"
    type="com.ibm.ads.reports.web.formbeans.ClarityReportDefinitionFormBean"></form-bean>
    </form-beans>
    <action name="reportDefFormBean" path="/createFormatReportDefinition"
    type="com.ibm.ads.reports.web.actions.reportDefinition.CreateFormatReportDefinitionAction"
    scope="session" validate="false">
    <forward name="success" path="/createFormatReportDefinition.jsp"/>
    </action>I am getting a null for Session.getAttribute("formatName") or even if i change the scope to request, i use request.getPArameter("formatName"), i get null again.
    I dunno what iam missing in this regard, but if anyone has found anything wrong with my code...please help me out.
    any time spent will be appreciated.
    Thank you and regards,
    dev

  • Is there any way to set ServletRequest attributes?

    Hello all,
    I have a central servlet that accepts requests and routes them to handlers based on their "action" parameters. The problem I have is what to do when there is no handler registered to deal with a particular action.
    In my mind the most elegant solution would be to set the request's "action" parameter to "errorPage", set an error message in a context attribute, and let the servlet resume normal operation, routing the request to a servlet registered to return error pages. So my ideal solution would look something like:ActionHandler handler = handlerPool.getHandler(action);
    if (handler = null) {
        request.setParameter("action", "errorPage");
        context.setAttribute("errorMessage", "No handler is available for the " +
                "specified action (" + action + ").);
    }But of course there is no ServletRequest.setAttribute(String, String) method. There doesn't appear to be a way to manipulate request parameters at all, or even to create new requests.
    If anyone has any ideas or knows of a better way to do this, please let me know.

    Well don't I feel like a nOOb :P. At least I figured it out quickly. The solution is to pass on a subclass of ServletRequestWrapper wrapped around the client's request. Something like this:if (action == null) {
        MutableServletRequest r = new MutableServletRequest(request);
        r.setParameter("action", "errorPage");
        request = r;
    }The subclass looks like this:public class MutableServletRequest extends ServletRequestWrapper {
        ServletRequest request;
        private HashMap parameters = new HashMap();
        public String getParameter(String name) {
            String result = parameters.get(name);
            if (result == null) {
                return super.getParameter(name);
        public String setParameter(String name, String value) {
            String oldValue = getParemeter(name);
            parameters.put(name, value);
            return oldValue;
    }Well, I hope this was informative, sorry to clutter up the forum.

  • Managing users passwords with ADF

    Hi,
    We have created an user manager application wich edits Realm Users. Since we change the realm to use SHA encription we would like to have the password field encrypted before ADF updates the table ....
    There is a clean way of doing this ?
    So far we thought on overwriting the OnCommit method for the datapage and in there modify the request object but there is nothing like a request.setParameter( String, String ) .... and apparently is the request.parameter the one that ADF will endup sendind to the datafield ....
    Again, there is a direct way of doing this other than locating afterwards the viewObject Row and updating the unencrypted password with the encripted version ????
    Thanks,
    Omar

    Hi
    Put the code in YourEOImpl.java
    public void setPassword(String value) {
    String encryptedPassword = null;
    encryptedPassword = ....; // your encryption implementation
    setAttributeInternal(PASSWORD, encryptedPassword);
    Hope this help
    Regards,
    Nhut Trung

  • BSP: clear URL parameter

    Hi,
    in my BSP application I want to give a value from one controller to the following one. To do so, I set a parameter to the navigation object, and read it in the subsequent controller.
    * Controller A, do_handle_event
    navigation->set_parameter( name = 'key' value = model->guid ).
    navigation->next_page( co_exit_show ).
    * Controller B, do_request
    guid = request->get_form_field( 'key' ).
    This part works fine. The problem is that the parameter once set to the navigation object in controller A will be part of all subsequent requests to controller B. So, how do I get rid of the parameter, so that it is only part of the first request to controller B, similar to Java's request.setParameter()?
    Thanks in advance,
    Frank

    Hi Christine,
    in a way, yes, this is want I want to do. However, doing so seems to be quite complicated. I've already tried the following:
    * Controller B
    navigation->set_parameter( NAME = CO_PARAM_GUID value = space ).
    request->set_form_field( NAME = CO_PARAM_GUID value = space ).
    response->set_form_field( NAME = CO_PARAM_GUID value = space ).
    None of them solved the problem. When the controller is called again, request->get_form_field( CO_PARAM_GUID ) contains the originally provided value.
    Any ideas?
    Best regards,
    Frank

Maybe you are looking for

  • Dynamic data selection in process chain

    Dear BW gurus, I've an infocube 0PA_C01. I'm gettting data with data source 0HR_PA_0. Because of time-dependency of personel data i should get the package month by month. SO I set the data selection parameter 0CALMONTH in data package.   0CALMONTH=20

  • Problem with attachments

    Hi We have a lot of problems with new webaccess. We cannot open attachments ? We cannot save attachments. It is possible to save, but all attachments are 22kb long. We cannot display images.... It looks like we have an early beta product. Any ideas ?

  • Network stream Two network adaptor cards in PC comms with crio

    Hi all, I have two network adaptor cards in my pc which i think is causing my problems when collecting data over the tcp.  I'm seeing an error message -314340 from the create network stream write/read my address match up and i'm using a template crio

  • Use of global currencies in configuration

    Our site would only like to see their information in the local currency. We have no need for multiple global currencies. We configured the ETL with nulls in the three global currency fields, but notice that all the out of the box dashboards are going

  • Get working day of month for specific date

    Hi, I need to get the working day of a month for a specific date. For example: Which working day is the 15th of september 2005... Is there any function module, I could use? Cheers Arne