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.");
}

Similar Messages

  • 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

  • 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>

  • Conversion agent; CMException: Request IF_EXEC2 returned null

    Hi all,
    "CMException: Request IF_EXEC2 returned null"
    I'm trying to use a conversion agent serializer to ouput a file from PI 7.1 and am getting the above message in the receiver comm. channel monitor.  No idea what it means.
    This is my first use of conversion agent, so I'm not sure that everything is correctly in place, but the Conversion agent console set-up test works, and I've followed all the blogs I can find so I'm reasonably happy with it.
    Executing the script from the CM console gives me the transformation I want, so my serializer seems OK.
    The PI configuration scenario works fine if I use a receiver channel without the CMTransform bean module (i.e I get an xml file output), so that's OK.
    I get nothing in the NWA logs.
    I'm running out-of-process (64 bit PI system) and the console config looks OK per the admin guide.
    Any ideas folks ?
    Regards,
    Guy

    That's an odd thing.
    When I run it in studio, it completes without any obvious error, but there's no "results" file.
    We had initially installed the 32 bit version (when I was on XI 3.0), and I ran the studio on the XI machine and the results file showed in studio.  But now, my studio is on my PC (not the PI machine).
    However, all that aside, when I execute the CM_Console with my project I get exactly the output I expect...so I'm sure that the serializer is OK.

  • 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

  • Request.getCookies() returns null, not 0 length array

    (reposted from J2EE forum)
    Just upgraded to 9ias with Embedded OC4J and we were getting a NullPointerException.
    Our previous calls to request.getCookies() AKA http://java.sun.com/products/servlet/2.1/api/javax.servlet.http.HttpServletRequest.html#getCookies()
    would return an an array of Cookie Objects or an array of zero length if there are no cookies.
    When we upgraded to 9ias, we got the NPE.
    Know why?
    OC4J implementation of HttpServletRequest doesn't return a zero length array, it returns a null object when there are no cookies!!!
    So we had to change our code to catch this.
    Not a big problem, and it's fixed now, but it was a problem nonetheless.
    Any reason/rationale for why this was done this way? Anyone? Bueller?

    Josh,
    According to Servlet Spec 2.3 (page 193) SRV 15.1.3.2 Methods for (HttpServletRequest SRV.15.1.3) getCookies() returns null if no cookies present. So we are compliant to the spec.
    regards
    Debu Panda
    Oracle That's strange that the NPE problem didn't occurr until deleting cookies on OC4J, then.
    Thanks for responding!

  • JSPX Migration from Tomcat to OC4J

    We are migrating the web tier of our application from Tomcat 5 to OC4J 10.1.3.0.0. We are having a problem in our jspx files. The code below works in Tomcat but not in oc4j.
    <gc3:viewFieldText name="invoice/invoice_xid" valueIndicator="invoice/indicator">
    <jsp:attribute name="label">
    <x:when select="$mainNode/invoice_type = 'B'">field.invoice/bill_xid</x:when>
    <x:otherwise>field.invoice/invoice_xid</x:otherwise>
    </x:choose>
    </jsp:attribute>
    </gc3:viewFieldText>
    We are trying to dynamically set the label attribute of one of our custom tags using <jsp:attribute> and the jstl xtags. mainNode is a variable bound in the request and based on the result of the XPath expression, we want to dynamically set the label attribute. The XPath expression is correctly evaluated, however instead of passing the text within the x:when or x:otherwise to our custom tag, it just writes it out to the screen.
    If I remove the xtags from the code and hard code the label it works as shown below.
    <gc3:viewFieldText name="invoice/invoice_xid" valueIndicator="invoice/indicator">
    <jsp:attribute name="label">
    field.invoice/bill_xid
    </jsp:attribute>
    </gc3:viewFieldText>
    Let me know if you need any further information.

    Chad,
    10.1.3.0.0 was buggy.
    Try 10.1.3.1.0 or the latest: 10.1.3.2.0
    (Just a suggestion.)
    Good Luck,
    Avi.

  • URLConnection returns NULL when called from within a weblogic servlet

    The following code snippet works when executed outside of weblogic, but does
    not work from within a weblogic servlet instance.
    URL u = new URL("http://" + ipString + newString.toString());
    URLConnection uc = u.openConnection();
    BufferedReader in = new BufferedReader (new InputStreamReader(uc.getInputStream()));
    String response = "", response2 = "";
    while(response2 != null)
         response = ((response2 = in.readLine()) == null) ? response : response + response2;
    The response is quite big. When this code is executed from within a weblogic servlet instance,
    in.readLine always returns a null right away. Yet a TCP/IP trace shows that the packets are coming
    back to my NT machine.
    Other info:
    Inside of weblogic:
    u's handler is of type weblogic.net.http.Hanlder
    uc is of type weblogic.net.http.HttpURLConnection
    Outside of weblogic:
    u's handler is of type sun.net.www.protocol.http.Handler
    uc is of type sun.new.www.protocol.http.HttpURLConnection
    Weblogic V4.51. Running on NT.
    Attempted the following to no avail:
    1. installing sp11
    2. changing the security to permission java.security.AllPermission;
    3. adding the following calls : uc.setRequestProperty("Content-Type", "text/xml");          
              uc.setDoInput(true);
              uc.setDoOutput(true);
    4. Started playing around with modifying the java.protocol.handler.pkgs system property,
    but I shouldn't have to do this.
    Any help would be appreciated.

    There are some problems with the WL implementations of certain protocols.
    WL hides the Sun implementations when you are in the WebLogic server. Here
    is an a solution that was posted to a similar problem:
    Https is an add-in so to speak. Try this before you create your url:
    System.setProperty ("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    // add the default security provider (again, in JSSE1.0.1)
    int iap = java.security.Security.addProvider(new
    com.sun.net.ssl.internal.ssl.Provider() );
    dennisNote how the code overides the WL setting which overode the Sun setting.
    Cameron Purdy
    [email protected]
    http://www.tangosol.com
    WebLogic Consulting Available
    "Brian Howell" <[email protected]> wrote in message
    news:[email protected]...
    >
    The following code snippet works when executed outside of weblogic, butdoes
    not work from within a weblogic servlet instance.
    URL u = new URL("http://" + ipString + newString.toString());
    URLConnection uc = u.openConnection();
    BufferedReader in = new BufferedReader (newInputStreamReader(uc.getInputStream()));
    >
    String response = "", response2 = "";
    while(response2 != null)
    response = ((response2 = in.readLine()) == null) ? response : response +response2;
    The response is quite big. When this code is executed from within aweblogic servlet instance,
    in.readLine always returns a null right away. Yet a TCP/IP trace showsthat the packets are coming
    back to my NT machine.
    Other info:
    Inside of weblogic:
    u's handler is of type weblogic.net.http.Hanlder
    uc is of type weblogic.net.http.HttpURLConnection
    Outside of weblogic:
    u's handler is of type sun.net.www.protocol.http.Handler
    uc is of type sun.new.www.protocol.http.HttpURLConnection
    Weblogic V4.51. Running on NT.
    Attempted the following to no avail:
    1. installing sp11
    2. changing the security to permission java.security.AllPermission;
    3. adding the following calls : uc.setRequestProperty("Content-Type","text/xml");
    uc.setDoInput(true);
    uc.setDoOutput(true);
    4. Started playing around with modifying the java.protocol.handler.pkgssystem property,
    but I shouldn't have to do this.
    Any help would be appreciated.

  • Upgrade from tomcat to OC4J 10.1.3 jsp parser exception in tag lib

    i have problem in oc4j jsp parser
    but it work ok on tomcat as tomcat using jasper-compiler.jar
    when run on oc4j it give me the exception
    OracleJSP: oracle.jsp.parse.JspParseException: /jsp/layouts/elec/pageheading.jsp: Line # 3, <aa:h1 wrapped="true" labelKey="${heading1BundleKey}"/>
    Error: Errors parsing tag :h1 oracle.jsp.parse.JspParseException: /jsp/layouts/elec/pageheading.jsp: Line # 3, <aa:h1 wrapped="true" labelKey="${heading1BundleKey}"/>
    Error: oracle.jsp.provider.JspCompileException: <H3>Errors compiling:E:\oc4j\j2ee\home\application-deployments\default\sc40\persistence\_tagfiles\_oracle\_jsp\_tag\_aacom\_h1_2e_tag.java</H3><TABLE BORDER=1 WIDTH=100%><TR><TH ALIGN=CENTER>Line #</TH><TH ALIGN=CENTER>Error</TH></TR><TR><TD WIDTH=7% VALIGN=TOP><P ALIGN=CENTER>191</TD><TD> non-static variable _jspFragWriter cannot be referenced from a static context
    _jspFragWriter = null;
    -------------------------------------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    and i have problem in web.xml
    as i using jsp servlet in jasper-compiler.jar in tomcat package
    <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
    ------------------------------------>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    i try to use this package in oc4j but i can not
    i put this servlet in global-web-application.xml instead of
    <servlet>
         <servlet-name>jsp</servlet-name>
    <servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
    ------------------>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    to make oc4j depend on tomcat parser it give me
    classnotfound mean that (oc4j can not found package) this printed in global-application.log
    i make
    <library path="E:/oc4j/j2ee/home/applib/jasper-compiler.jar"/>
    and still have problem
    any 1 have idea using tomcat parser in oc4j
    or have idea solve this problem
    thanx
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]
    Message was edited by:
    [email protected]

    OC4J 10.1.3 does support JSP 2.0, as well as custom tag libraries (including JSTL 1.1).
    There are two approaches to configuring a custom tag library for use in JSPs served by OC4J:
    1) Package the JSTL or custom tag library with your application:
    i. include the necessary JAR file in your web app's /WEB-INF/lib folder
    ii. include the relevant Tag Library Descriptor (TLD) file(s) in your web app's /WEB-INF folder
    iii. for each TLD, add a <tag-lib> element to web.xml referencing the TLD file's location and taglib URI
    2) Place the JSTL or custom tag library in an Application Server instance-level directory ($ORACLE_HOME/j2ee/home/jsp/lib/taglib) to make them available to multiple applications (in all OC4Js installed in the Oracle Home)
    For example, if you'd like to use the JSTL 1.1 Core and Internationalization Tag Libraries, do one of the following:
    1) Package the JSTL or custom tag library with your application:
    i. Obtain an implementation of JSTL (e.g. Jakarta Taglibs) and include the standard.jar and jstl.jar files in your web module's /WEB-INF/lib directory
    ii. From the JSTL implementation you're using, also copy the c.tld and fmt.tld Tag Library Descriptors to your web module's /WEB-INF/lib directory
    iii. Add the following elements to your web module's web.xml file:
    <jsp-config>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
    </taglib>
    </jsp-config>
    OR
    2) Copy the standard.jar and jstl.jar libraries from the JSTL implementation you're using to $ORACLE_HOME/j2ee/home/jsp/lib/taglib

  • JAX-RPC on OC4J (Migrating from TOMCAT to OC4J) Problems

    I am attempting to compile and build a simple web service
    to using wsdeploy from Sun's JWSDP1.2. It works fine on Tomcat but when I try to deploy it to OC4J. I get the following error:
    7/23/03 11:58 AM Internal error in HttpServer
    java.lang.ClassCastException: com.evermind.naming.ContextClassLoader
         at com.sun.xml.rpc.server.http.JAXRPCContextListener.contextInitialized(JAXRPCContextListener.java:52)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:583)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:374)
         at com.evermind.server.Application.getHttpApplication(Application.java:657)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:663)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:387)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:378)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)7/23/03 3:53 PM 9.0.2.0.0
    I've come to notice that Oracle's WebServicesAssembler doesn't use com.sun.xml.rpc.server.http.JAXRPCContextListener but instead uses something else. When the JAXRPCContextListener starts to initialize it trys to perform the following operation:
    classLoader = (URLClassLoader)Thread.currentThread().getContextClassLoader();
    Is there any way to remedy this?? Or is there anything I can do to get this to work??
    Thanks
    Mike

    Have you deployed JAX-RPC onto OC4J? We currently do not have JAX-RPC available on OC4J.
    Mike.

  • Migrating from Tomcat to OC4J

    We are currently just using Tomcat for both HTTP and Servlet engine duties on our web server. The HTTP side is quite slow so
    we have just purchased the 9iAS with OC4J (v.1.0.2.2). The documentation say OC4J is "100%" Tomcat compatible. That's great but current setup uses HTML to build 3 frames then puts an HTML menu in one which has the javascript commands to run java classes via a servlet. We have our index.html in the top level folder, then the menu files in a sub-folder (menu), graphics in another (misc), javascript in another (lib), then the class files are below that in :
    /Web-inf/classes/html...
    /Web-inf/classes/database
    /Web-inf/classes/objecttypes
    /Web-inf/classes/Utils
    Anyone set up this style of application? as the examples only show running servlets directly.

    Sure. Are you having a specific problem, or just wondering if it will work? YOu class files are fine in those subdirectories so long as they correspond correctly with the package names. As far as referencing a servlet whose class is in a package, you do it in OC4J just like in Tomcat - by defining the servlet name and class and mappings in the web.xml file. If you can build a war using Ant and deploy that war to Tomcat, you will find that that war will deploy very nicely to Orion. The only additional work is to add any custom application setup to the Orion configuration files (server.xml, default-web-site.xml, etc) similar to what you would do in the Tomcat server.xml and worker.xml files.
    John H.

  • Migrate from Tomcat to OC4J

    Hi! Everyone,
    I developed a Servlet/JSP application on tomcat, now I am going to deploy it to OC4J. In OC4J, directly under default-web-apps, I created a directory called misc, and put my servlets (in default-web-apps/misc/WEB-INF/classes), jsp (in default-web-apps/misc/jsp), beans (in default-web-apps/misc/WEB-INF/classes/beans) there (no EJB). The OC4J server can run jsp correctly, but it can not locate servlets. It can only locate servlets under default-web-apps/WEB-INF/classes directory.
    It means it is not scalable if I put my servlets directly in default-web-apps/WEB-INF/classes, because if I deploy another project, which has a servlet, I also need to put it in the same directory.
    All in all, OC4J can locate the servlet by "http://127.0.0.1:port/servlet/myservlet", but if I put the servlet in misc/WEB-INF/classes directory, it can not locate the servlet by "http://127.0.0.1:port/misc/servlet/myservlet".
    In tomcat, it is good because every time I created a new project, I just create a new directory "misc" parallel to "examples", and I can access that project by "http://127.0.0.1:port/misc/servlet/myservlet". By doing this way, different projects are in different directory. But in OC4J, different projects' servlet has to be in the same directory (I know I can create a directory under WEB-INF/classes called misc, and then call my servlet by "http://127.0.0.1:port/servlet/misc.myservlet, but this is not what I want).
    Is there a way to let OC4J to deploy projects like tomcat? The documentation said OC4J is 100% compatible with tomcat, but I think it is not.
    Thanks a lot if you can provide help.
    Jingzhi

    Hi! Everyone,
    I developed a Servlet/JSP application on tomcat, now I am going to deploy it to OC4J. In OC4J, directly under default-web-apps, I created a directory called misc, and put my servlets (in default-web-apps/misc/WEB-INF/classes), jsp (in default-web-apps/misc/jsp), beans (in default-web-apps/misc/WEB-INF/classes/beans) there (no EJB). The OC4J server can run jsp correctly, but it can not locate servlets. It can only locate servlets under default-web-apps/WEB-INF/classes directory.
    It means it is not scalable if I put my servlets directly in default-web-apps/WEB-INF/classes, because if I deploy another project, which has a servlet, I also need to put it in the same directory.
    All in all, OC4J can locate the servlet by "http://127.0.0.1:port/servlet/myservlet", but if I put the servlet in misc/WEB-INF/classes directory, it can not locate the servlet by "http://127.0.0.1:port/misc/servlet/myservlet".
    In tomcat, it is good because every time I created a new project, I just create a new directory "misc" parallel to "examples", and I can access that project by "http://127.0.0.1:port/misc/servlet/myservlet". By doing this way, different projects are in different directory. But in OC4J, different projects' servlet has to be in the same directory (I know I can create a directory under WEB-INF/classes called misc, and then call my servlet by "http://127.0.0.1:port/servlet/misc.myservlet, but this is not what I want).
    Is there a way to let OC4J to deploy projects like tomcat? The documentation said OC4J is 100% compatible with tomcat, but I think it is not.
    Thanks a lot if you can provide help.
    Jingzhi

  • 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.

  • Why does getParameter("uri") returns null ???

    Hi !
    JAVA can be rather frustrating and I have run of of dukes. How about IOU ?
    Unfortunately none of the previous questions in the db shed light on my problem.
    I am trying to get at the "uri" and I have the following code fragment :
    package com.developer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.IOException;
    import java.io.PrintWriter;
    public class proptest extends HttpServlet
      public void doGet( HttpServletRequest req,  HttpServletResponse resp)
        throws ServletException, IOException
        PrintWriter out = resp.getWriter();
        out.println("Parameter Name: " + req.getParameter("uri"));
      public void init() throws ServletException
        // initialie the servlet here. Use ServletConfig object to get
        //    initialization parameters...
        ServletConfig config = getServletConfig();
        // ... more stuff ...
      }

    Hi!
    In case anyone stumbles upon this in the database, I worked aroung it by using req.getRequestURI().
    However I still do not know why getParameter() returns null. It would be useful e.g. if you want to display a list of all request params e.g.:
    // stub code follows...
    java.util.Enumeration enum = rea.getParameterNames();
    while (enum.hasMoreElements())
    String name = (String) enum.nextElement();
    System.out.println("Parameter "+name + " " + req.getParameter(name))
    ...For me, nope, all nulls. If it works for you , do tell me.
    Also if you look at the "bugs db" there seems to be a number of issues concerning getParameter().

Maybe you are looking for

  • Ipod is not recognized by computer

    I've tried everything to get my ipod connected to my computer. i don't think it's the ipod b/c it will connect and work to my dad's computer...any ideas on what else i could try? i've removed the programs and tried re-installing a few times, still no

  • FIOS Smart TV App no longer available on Samsung UN50ES6100 model TV. What happened?

    I had to reinstall all my SAMSUNG Smart TV apps.  The Verizon FIOS TV app was one I had previously downloaded and was working.  It's no longer in the list of SAMSUNG Smart TV applicaitons.  Was it removed for any special reason?  Will it be returned?

  • Inventory management in BW7.0

    Hi,   We have implemented 0IC_C03 in 7.X flow. We are facing a issue with the 2lis_03_BX load. Usually when this is loaded to the cube it gets loaded with record type '1' in 3.x flow but in 7.0 flow this gets loaded with record type 0 and when i do m

  • Empty fields in the approval step - process an forms

    Hi experts Am developing process for add address infotype to employee , if i didn't use workflow its working fine, but if i use workflow , when i fill the form and send it , the next agent get empty data, i mean what i entered not appear to him even

  • Inventory based import cvd conditions

    Dear SAP MM Cons, I have created import pricing procedure , in that i created new conditions like ZCV1 for CVD , ZECV for education cess on CVD, and Z1CV for H ed cess and Z2DC for additional duty by copying existing conditions. My requirement is tha