Invoker servlet

Hi,
I am interested in knowing why we should avoid invoker servlets?
what are short comings of invoker servlet?
( Yes for invoker servlets completer path up to servlet is to be given)
Thanks

The Invoker servlet is a built int servlet mapped such that allows you to invoke any servlet by using the URL: /servletPackage/servletClassName. While this is good to get started and to know, you should never use it in a production environment.
If you give password protected access to a folder, say Employees and map a servlet to /Employees/MyServlet, the servlet is also protected. Only people with the authorized username/password combinations can run the servlet. But if you allow the default mapping with the Invoker servlet, then the same servlet will also be accessible to everyone as /servlet/MyServlet in which case your authorization fails and everyone has access to your servlet's functionality, potentially modifying data etc.
This is only the authorization aspect. Other than this, the Invoker servlet makes it hard for you to hide your actual package/ classnames. Other features like init parameters and filters are also not possible in this case.
This is why you should NOT use the Invoker servlet. Even the Tomcat FAQ says you should not.
Read more here:
[1] http://faq.javaranch.com/view?InvokerServlet
[2] http://jakarta.apache.org/tomcat/faq/misc.html#evil
P.S. a_joseph also had a valid point and he gave you the same link also.
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
----------------------------------------------------------------

Similar Messages

  • Invoke servlet

    How can I invoke servlet from an <af:form> tag ?

    Hi Zaro,
    it depends what you'd like to do.
    1. Put the result into the page: Use normal links, eg. <af:objectImage source="/graphservlet"/>2. Use it as a navigation step: edit your faces-config.xml
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Invoking servlet from mDB

    Hi all;
    this is the process.
    1. Servlet received / creates msg.
    2. Servlet Enqueues Msg on JMS queue.
    3. MDB dequeues.
    -- processes against DB
    -- composes respoonse.
    4. mdb invokes servlet with response.
    servlet need not maintain state.
    State information can be passed in Msg (Query and Response)
    I was just wanting to find out if this possible in oc4j.
    apparently, there is a process in weblogic 6.1 to support this.
    Any help is appreciated.
    thanks.
    jayant

    I would assume that you would need to do a "createSipApplicationSession" on your sip factory and then get the ID from there.
    Then create a request from your session and send it.
    Wouldn't you want each outgoing call to be associated with a different sip app session?

  • How to configure IIS webserver with weblogic so that I can invoke servlets without the .wlforward extension

    How to configure IIS webserver with weblogic so that I can
    invoke servlets without the .wlforward extension
    As per the documentation iisforward.dll is registered as a filter and .wlforward
    has also been
    included as a special file type. However this requires me to key-in ".wlforward"
    after my servlet name.
    What I want is something like this
    http://iis/MyServlet
    Please help me find a solution to this
    Thanks,
    Rishi

    I am able to invoke the servlet without the wlforward extension now.
    However, now I am required to add /weblogic before the servlet
    name otherwise it does not execute the pathtrim property.
    I have tried with the pathprepend thing also.
    Can we get rid of the /weblogic part also. I just want to execute
    my servlet as http://iis/myServlet.
    Your help in this regard is greatly appreciated...
    Thanks..
    "Rishi" <[email protected]> wrote:
    >
    Thanks for the reply Kumar.
    I did follow the instructions as given in the Weblogic documentation
    The documentation said to add iisforward.dll as a filter service
    and register .wlforward as a special
    file type to be handled by iisproxy.dll. For this,
    while configuring the IIS server in the Home Directory tab
    I added an extension ".wlforward" and the executable as
    iisproxy.dll. Is this the way it should have been done...
    I also modified the iisproxy.ini file as per the documentation.
    I have added the WLForwardPath property and set it to /weblogic.
    My server works fine when I give the url as
    http://iis/myServlet.wlforward
    but it does not work for
    http://iis/myServlet and this is the way i'd want it to work.
    Please tell me if I am missing something on the configuration part
    and if there is something special that needs to be done. I shall
    be grateful to you.
    Kumar Allamraju <[email protected]> wrote:
    http://e-docs.bea.com/wls/docs61/adminguide/isapi.html#101184
    Rishi wrote:
    How to configure IIS webserver with weblogic so that I can
    invoke servlets without the .wlforward extension
    As per the documentation iisforward.dll is registered as a filter
    and
    .wlforward
    has also been
    included as a special file type. However this requires me to key-in".wlforward"
    after my servlet name.
    What I want is something like this
    http://iis/MyServlet
    Please help me find a solution to this
    Thanks,
    Rishi

  • Re: How do I invoke Servlets...continued

    Hi Howard,
              Could you show us web.xml?
              Regards,
              Slava Imeshev
              "Howard Hyde" <[email protected]> wrote in message
              news:3ccedf8a$[email protected]..
              > My posting appears to have been truncated, so here is the remainder:
              > (continued)
              > 'Pilot' is a servlet defined and mapped in my web.xml file. But when I
              attempt
              > to invoke the servlet in the app with any of the following:
              > http://localhost:7001/pilots/Pilot
              > http://localhost:7001/pilots/pilot
              > http://localhost:7001/pilots/servlet/Pilot
              > http://localhost:7001/pilots/servlet/pilot
              >
              > ... I get a 404 error.
              >
              > However, the following JSP, which is part of the same web application
              component
              > of the Enterprise app, works:
              > http://localhost:7001/pilots/Rating.jsp
              >
              > So the question of the day once again, is:
              >
              > How do I invoke servlets in an enterprise application?
              >
              > Best regards,
              >
              > Howard
              > 818-366-2686
              

    and to add to matt's post:
              in the servlet init() method trace out some debug to ensure that new
              versions of your servlet are actually being deployed:
              ..init() {
              System.out.println( getServletName() + " was deployed at " + " new
              Date(System.currentTimeMillis()) );
              "Matt Krevs" <[email protected]> wrote in message
              news:[email protected]...
              > 1. What stack trace do you receive, if any, when your call to your servlet
              > doesnt work
              >
              > 2. Is your servlet in a package? If it is then you need to specify the
              > package in the servlet-class element
              >
              > 3. Is it possible that your servlet-name and/or servlet-class elements in
              > web.xml have some spaces in them? Maybe you should remove the line feeds
              > etc. and specify your servlet elements as you have your servlet-mapping
              > elements
              >
              > eg like this
              >
              > <servlet>
              > <servlet-name>Pilot</servlet-name>
              > <servlet-class>FrmPilot2</servlet-class>
              > <load-on-startup>0</load-on-startup>
              > </servlet>
              >
              > 4. Do you get any deployment errors when weblogic starts up?
              >
              > 5. Try setting the load-on-startup parameter to a positive number. You may
              > receive a helpful? stacktrace when weblogic starts up
              >
              >
              > "Howard Hyde" <[email protected]> wrote in message
              > news:[email protected]...
              > > The following are EXCERPTS from the web.xml file:
              > >
              > > <web-app>
              > > <servlet>
              > > <servlet-name>
              > > Pilot
              > > </servlet-name>
              > > <servlet-class>
              > > FrmPilot2
              > > </servlet-class>
              > > <load-on-startup>
              > > 0
              > > </load-on-startup>
              > > </servlet>
              > > <servlet-mapping>
              > > <servlet-name>Pilot</servlet-name>
              > > <url-pattern>/Pilot</url-pattern>
              > > </servlet-mapping>
              > >
              > > </web-app>
              > >
              > >
              >
              >
              

  • How do I invoke Servlets...continued

    My posting appears to have been truncated, so here is the remainder:
              (continued)
              'Pilot' is a servlet defined and mapped in my web.xml file. But when I attempt
              to invoke the servlet in the app with any of the following:
              http://localhost:7001/pilots/Pilot
              http://localhost:7001/pilots/pilot
              http://localhost:7001/pilots/servlet/Pilot
              http://localhost:7001/pilots/servlet/pilot
              ... I get a 404 error.
              However, the following JSP, which is part of the same web application component
              of the Enterprise app, works:
              http://localhost:7001/pilots/Rating.jsp
              So the question of the day once again, is:
              How do I invoke servlets in an enterprise application?
              Best regards,
              Howard
              818-366-2686
              

    My posting appears to have been truncated, so here is the remainder:
              (continued)
              'Pilot' is a servlet defined and mapped in my web.xml file. But when I attempt
              to invoke the servlet in the app with any of the following:
              http://localhost:7001/pilots/Pilot
              http://localhost:7001/pilots/pilot
              http://localhost:7001/pilots/servlet/Pilot
              http://localhost:7001/pilots/servlet/pilot
              ... I get a 404 error.
              However, the following JSP, which is part of the same web application component
              of the Enterprise app, works:
              http://localhost:7001/pilots/Rating.jsp
              So the question of the day once again, is:
              How do I invoke servlets in an enterprise application?
              Best regards,
              Howard
              818-366-2686
              

  • 404 error while invoking servlet in weblogic 6.0

              Hi,
              When I try to invoke a servlet from weblogic 6.0, I am getting
              404 error. I have copied the HelloWorldServlet class into defaultWebAppl_Server/WEB_INF/CLASSES
              directory and when I invoke the HelloWorldservlet, its giving file
              not found(404) error. I am doing exactly what has been given in
              the "quick start to servlets" in weblogic 6.0. I am using Windows
              NT.
              I have also another problem when I use java utils.dbping to test
              the connection to my oracle8.1.8, its giving licence file not found.
              Could some one help me out from this.
              Thanks in advance,
              Ramu
              

              Hi kumar,
              I have been keep trying to solve that. After some time Suddenly
              "Error 404" disappeared and instead "Error 500" came. Okay kumar,
              here is what I am doing...
              I have installed weblogic6.0(eval), oracle 8.1.6 on Windows NT4.0.
              I have installed oracle Enterprise edition from CD "ORACLE 8.1.6
              for NT".
              I installed the weblogic under D: drive.
              I did class path settings as given in documentation. But Iam not
              sure whether I need to do any other class path settings.
              I was able to run pet store application given in weblogic server.
              I went to "quick start" section and ran HelloWorld.jsp page from
              "DefaultWebApp_myServer" directory.
              I was not able to run servlet program as per given in the "quick
              start". I am getting
              "Error 500---Internal server error"
              The server encountered an unexpected condition which prevented
              it from fulfilling the request"
              I have modified the web.xml under WEB-INF of DefaultWebApp_myServer
              as per given in the quick start.
              Here is the quick start link For you reference(as what I talking
              about)
              http://edocs.beasys.com/wls/docs60/quickstart/quick_start.html
              In the web.xml, I have given <servlet-class> as just HelloWorldServlet,
              since I directly copied the file from some other examples directory.
              But still I am getting 500 error.
              Here is the url that I am invoking...Http://ramup:7001/quickStartServlet
              Coming to your oracle connection test, I did exactly what you said.
              kumar, I have executed the command
              "D:\bea\wlserver6.0\config\mydomain>java -classpath %classpath%;D:\bea
              utils.dbping ORACLE
              >scott tiger TestDB"
              Where TestDB is the database that I have created while installing,
              but I am not aware of the instance you said.
              Here is what I got after executing the command.
              --------*******-------Pasting the ms-dos command results----**-
              // This mode is superior, especially in serverside classes because
              // it avoids DriverManager calls are class synchronized, and will
              // bottleneck any other JDBC in the server, even already-running
              // connections, because all JDBC drivers use DriverManager.println()
              // to log info and exceptions, and that call is also class synchronized.
              // For repeated connecting, a single driver instance can be re-used.
              **** or ****
              Class.forName("weblogic.jdbc.oci.Driver").newInstance();
              java.sql.Connection conn =
              DriverManager.getConnection("jdbc:weblogic:oracle:TestDB", "scott",
              "tiger")
              **** or ****
              java.util.Properties props = new java.util.Properties();
              props.put("user", "scott");
              props.put("password", "tiger");
              props.put("server", "TestDB");
              Class.forName("weblogic.jdbc.oci.Driver").newInstance();
              java.sql.Connection conn =
              DriverManager.getConnection("jdbc:weblogic:oracle", props);
              D:\bea\wlserver6.0\config\mydomain>
              --------*******-------Pasting the ms-dos command results----**-
              I think I have connection to database, thanks for your suggestion.
              Kumar, I have not seen weblogic.properties file any where in D:\bea
              directory.
              Kumar, if you have some time can you jot down the classpath settings
              and path settings for executing SERVLETS/EJB programs.
              Thanks for helping me out..,
              Ramu
              Kumar Allamraju <[email protected]> wrote:
              >Assuming you registered the helloworld servlet in web.xml,
              >could you show me the url
              >that you typed in the browser window? :)
              >
              >
              >Regarding the dbping problem, make sure license.bea is
              >in the classpath
              >
              >ie.. java -classpath %classpath%;D:\bea utils.dbping ORACLE
              >scott tiger [instance-name]
              >
              >PS: I'm assuming WLS is installed in D:\bea directory.
              >
              >--
              >Kumar
              >
              >
              >Ramu wrote:
              >
              >> Hi,
              >>
              >> When I try to invoke a servlet from weblogic 6.0, I
              >am getting
              >> 404 error. I have copied the HelloWorldServlet class
              >into defaultWebAppl_Server/WEB_INF/CLASSES
              >> directory and when I invoke the HelloWorldservlet, its
              >giving file
              >> not found(404) error. I am doing exactly what has been
              >given in
              >> the "quick start to servlets" in weblogic 6.0. I am
              >using Windows
              >> NT.
              >>
              >> I have also another problem when I use java utils.dbping
              >to test
              >> the connection to my oracle8.1.8, its giving licence
              >file not found.
              >>
              >> Could some one help me out from this.
              >>
              >> Thanks in advance,
              >> Ramu
              >
              

  • Error 404 invoking servlet in tomcat

    OK Im new in this and I have searched the forums and do most of the answers but I cant make my servlet to work. So here is how I have my structure
    MEDEX \ WEB-INF -> all JSP files
    MEDEX \ WEB-INF \ classes -> all CLASS files
    MEDEX \ WEB-INF \ servlet -> SERVLET CLASS FILE
    I have a page called index.jsp that invokes the servlet by a form like this:
    <form name="form1" method="post" action="http:\\localhost:80\Medex\WEB-INF\servlet">
    this is what I have in my web.xml
    <display-name>Servlet SvMedex</display-name>
    <servlet>
    <servlet-name>SvMedex</servlet-name>
    <servlet-class>SvMedex</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>SvMedex</servlet-name>
    <url-pattern>http:\\localhost:80\Medex\WEB-INF\servlet</url-pattern>
    </servlet-mapping>
    <-- <resource-ref>
    <res-ref-name>http:\\localhost:80\Medex\WEB-INF\bd</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>-->
    </web-app>
    I dont have a server.xml since I edited the server.xml in tomcat/conf to evoke anonimous servlets... that will be while I test
    PLease IM DESPERATE ! any help is really appreciated.

    <url-pattern>http:\\localhost:80\Medex\WEB-INF\servle
    t</url-pattern>URL patterns are specified relative to the webapp. If you use a url-pattern of /SvMedex, your servlet will be available at http://localhost:80/Medex/SvMedex

  • Error in invoking servlet from JSP

    Hi - again!
    after being thoroughly reprimanded for posting on the wrong board, and hence seeing the error in my ways, all help greatly appreciated....
    I have read elsewhere that it is possible to call a servlet (which produces HTML) from within a JSP, thus keeping a nice clean MVC paradigm and making it easier for non-java people to design the front-end.
    I am having difficulty getting it to work and any help is much appreciated:
    My servlet (Mole):
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                out.write("###some html stored in DB#####");
            } finally {
                out.close();
        }my JSP:
    <jsp:include page="Mole" flush="false"></jsp:include>the error I get
    Internal error flushing the buffer in release()
    StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exception
    java.io.IOException: Stream closed
            at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:257)
            at org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:206)
            at org.apache.jsp.CMS.services_jsp._jspService(services_jsp.java from :176)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
            at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
            at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
            at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
            at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
            at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
            at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
            at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)Any pointer as to what I am donig wrong?
    many thanks

    in your web.xml
    <servlet>
    <servlet-name>Mole</servlet-name>
    <servlet-class>srvlt.Mole</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Mole</servlet-name>
    <url-pattern>/Mole</url-pattern>
    </servlet-mapping>
    package srvlt;
    // Import servlet packages
    import javax.servlet.*;
    import javax.servlet.http.*;
    // Import other Java packages
    import java.io.*;
    public class Mole extends HttpServlet {
            public void init() throws ServletException {}
            public void doGet(HttpServletRequest request, HttpServletResponse response)
                    throws ServletException, IOException {
                response.setContentType("text/html;charset=UTF-8");
                PrintWriter out = response.getWriter();
                try {
                    out.write("###some html stored in DB#####");
                } finally {
                    out.close();
    }in your jsp
    <jsp:include page="/Mole" flush="false"></jsp:include>

  • Unable to invoke Servlet Directly in address bar in Weblogic10.3

    Hi,
    I am trying to invoke the servlet directly in the address bar as below
    http://localhost:7004/servlet/loginToApp
    but It's giving me following error :
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI...................
    but the same servlet is getting invoked when I use it in jsp form submit
    <html>
         <body>
              <form method="post" action = "http://localhost:7004/servlet/loginToApp">
                   <input type="submit"/>
              </form>
         </body>
    </html>
    in web.xml I have
    <servlet>
              <servlet-name>loginToApp</servlet-name>
              <display-name>loginToApp</display-name>
              <description></description>
              <servlet-class>abc.Common.ClientBeans.LoginToApp</servlet-class>
    </servlet>
    <servlet-mapping>
              <servlet-name>loginToApp</servlet-name>
              <url-pattern>/servlet/loginToApp</url-pattern>
         </servlet-mapping>
    This works fine on Weblogic 8.3.
    Please Help here.

    Hard to tell exactly.
    I note that your JSP page does a "POST" submit, whereas when you enter the direct URL of the servlet on the address bar, it'll result in a "GET" request.
    <form method="post" action = "http://localhost:7004/servlet/loginToApp">
    I don't know what error WLS will return if the servlet can't handle a GET, but it may be something to look at.
    Do you have a doGet() method in your servlet code?
    -steve-

  • How to invoke servlet in a package in iPlanet Web Server 4.01 platform ?

    I want to use a servlet which is in a package.
    http://10.251.9.194/servlet/aibd.GetService
    servlet is mapping to /home03/zhangxs/bbn/servlets.
    but the servlet can not be invoked.
    I read the errors file as following:
    [02/ 7��/2001:17:06:35] warning (19620):
    requested file not found
    (uri=/servlet/aibd.GetService,
    filename=/home03/zhangxs/bbn/servlets/aibd.GetService)
    html invoking statement is as following:
    <frame src="/servlet/aibd.GetService>
    I already set the CLASSPATH env variable.
    I think it should be applied using servlet of a package.
    Maybe I missed some setting.
    I hope u can help me.
    Thanks in advance.

    There is an option in the Netscape admin functionality for mapping the servlet virtual directory from the request URI into the physical directory.
    However I say don't. The Java support in Netscape 4.xx is lousy. Use Tomcat instead. It's more stable and a more complete implementation. Unfortunatly it's even more difficult to set up.

  • JSP cannot invoke servlet

              Hi,
              I am trying to invoke an applet using the jsp:plugin tag. However, it always comes
              back with the message in jsp:fallback (cannot run java applet). Here is the code
              for my jsp:plugin
              <jsp:plugin type="applet" code="com.eboomerang.rulesadmin.main.AppletMain.class"
              codebase="/functions" archive="srulesadmin.jar,xerces.jar" width=550 height=500
              jreversion="1.3" nspluginurl="http://java.sun.com/products/plugin/1.3/plugin-install.html"
              iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-131-win32.cab" >
              I am following the exact steps mentioned in the weblogic JSP guide.
              Thanks,
              --Krish.
              

    Shaun,
    Nice to know that you find a way that works. However, what Zsolt suggests should work; otherwise, it is a bug. That is, put the servlet definition and servlet mapping in your web.xml and then you should be able to access http://host:port/myWebContext/servlet/CreateSPSS?myParmName=myParm without seeing a response like "No resource found". Please make sure that your servlet definition come before the corresponding servlet mapping.

  • Cannot invoke servlet from JSP

    I am trying to invoke a servlet from my JSP file. At present I am getting the error:
    500 Internal Server Error
    java.lang.IllegalArgumentException: Resource /servlet/CreateSPSS not found
         at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.EvermindPageContext.forward
    I understand that my JSP cannot find my servlet but I cannot identify what the correct path or amendment is.
    My JSP file is located in:
    default-web-app/examples/jsp/com.xml2spss.jsp
    In the JSP my forward parameter is :
    <jsp:forward page="/servlet/CreateSPSS" />
    and my servlet (.java & .class) is located in
    default-web-app/WEB-INF/classes/com/pmstation/spss/site/servlet.CreateSPSS.java
    I have added the following line to Web.XML:
    <servlet-mapping>
    <servlet-name>CreateSPSS</servlet-name>
    <url-pattern>/servlet/CreateSPSS</url-pattern>
    </servlet-mapping>
    Where am I going wrong??
    Thankyou for any help at all on this one.

    Shaun,
    Nice to know that you find a way that works. However, what Zsolt suggests should work; otherwise, it is a bug. That is, put the servlet definition and servlet mapping in your web.xml and then you should be able to access http://host:port/myWebContext/servlet/CreateSPSS?myParmName=myParm without seeing a response like "No resource found". Please make sure that your servlet definition come before the corresponding servlet mapping.

  • Problem invoking servlet

              Hello.
              I'm trying to invoke a servlet. I get the following error:
              javax.servlet.ServletException: [HTTP:101250][ServletContext(id=371807,name=BibleApp,context-path=/BibleApp)]:
              Servlet class /com/brainysoftware/burnaby/ControllerServlet for servlet ControllerServlet
              could not be loaded because a class on which it depends was not found in the classpath
              C:\bea\user_projects\infologic1\applications\BibleApp;C:\bea\user_projects\infologic1\applications\BibleApp\WEB-INF\classes.
              java.lang.NoClassDefFoundError: /com/brainysoftware/burnaby/ControllerServlet
              (wrong name: ControllerServlet).
              at weblogic.servlet.internal.ServletStubImpl.prepareServlet
              web.xml
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
              "http://java.sun.com/dtd/web-app_2_3.dtd">
              <web-app>
              <servlet>
              <servlet-name>simple</servlet-name>
              <jsp-file>simplePage.jsp</jsp-file>
              </servlet>
              <servlet>
              <servlet-name>ControllerServlet</servlet-name>
              <servlet-class>com.brainysoftware.burnaby.ControllerServlet</servlet-class>
              <!-- Define initial parameters that will be loaded into
              the ServletContext object in the controller servlet -->
              <init-param>
              <param-name>base</param-name>
              <param-value>http://localhost:7001/BibleApp/ControllerServlet</param-value>
              </init-param>
              <init-param>
              <param-name>jdbcDriver</param-name>
              <param-value>weblogic.jdbc.mssqlserver4.Driver</param-value>
              </init-param>
              <init-param>
              <param-name>imageUrl</param-name>
              <param-value>http://localhost:7001/BibleApp/images/</param-value>
              </init-param>
              <init-param>
              <param-name>dbUrl</param-name>
              <param-value>jdbc:weblogic:mssqlserver4:users@COMPAQSERVER</param-value>
              </init-param>
              <init-param>
              <param-name>dbUserName</param-name>
              <param-value>dinesh</param-value>
              </init-param>
              <init-param>
              <param-name>dbPassword</param-name>
              <param-value>werty69</param-value>
              </init-param>
              </servlet>
              <servlet>
              <servlet-name>test</servlet-name>
              <jsp-file>menu_1.jsp</jsp-file>
              </servlet>
              <servlet>
              <servlet-name>HelloServlet</servlet-name>
              <servlet-class>HelloServlet</servlet-class>
              </servlet>
              <servlet>
              <servlet-name>ShowEmployees</servlet-name>
              <servlet-class>ShowEmployees</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>HelloServlet</servlet-name>
              <url-pattern>/helloservlet</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>test</servlet-name>
              <url-pattern>/test</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>simple</servlet-name>
              <url-pattern>/simple</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>ShowEmployees</servlet-name>
              <url-pattern>/ShowEmployees</url-pattern>
              </servlet-mapping>
              <servlet-mapping>
              <servlet-name>ControllerServlet</servlet-name>
              <url-pattern>/controlIt</url-pattern>
              </servlet-mapping>
              </web-app>
              ControllerServlet.class
              import java.sql.*;
              import javax.servlet.*;
              import javax.servlet.http.*;
              import java.io.*;
              import java.util.*;
              import com.brainysoftware.burnaby.DbBean;
              public class ControllerServlet extends HttpServlet {
              /**Initialize global variables*/
              public void init(ServletConfig config) throws ServletException {
              System.out.println("initializing controller servlet.");
              ServletContext context = config.getServletContext();
              context.setAttribute("base", config.getInitParameter("base"));
              context.setAttribute("imageUrl", config.getInitParameter("imageUrl"));
              // instantiating the DbBean
              DbBean dbBean = new DbBean();
              // initialize the DbBean's fields
              dbBean.setDbUrl(config.getInitParameter("dbUrl"));
              dbBean.setDbUserName(config.getInitParameter("dbUserName"));
              dbBean.setDbPassword(config.getInitParameter("dbPassword"));
              // put the bean in the servlet context
              // the bean will be accessed from JSP pages
              context.setAttribute("dbBean", dbBean);
              try {
              // loading the database JDBC driver
              Class.forName(config.getInitParameter("jdbcDriver"));
              catch (ClassNotFoundException e) {
              System.out.println(e.toString());
              super.init(config);
              /**Process the HTTP Get request*/
              public void doGet(HttpServletRequest request, HttpServletResponse response) throws
              ServletException, IOException {
              doPost(request, response);
              /**Process the HTTP Post request*/
              public void doPost(HttpServletRequest request, HttpServletResponse response) throws
              ServletException, IOException {
              String base = "/jsp/";
              String url = base + "Default.jsp";
              String action = request.getParameter("action");
              if (action!=null) {
              if (action.equals("search"))
              url = base + "SearchResults.jsp";
              else if (action.equals("browseCatalog"))
              url = base + "BrowseCatalog.jsp";
              else if (action.equals("productDetails"))
              url = base + "ProductDetails.jsp";
              else if (action.equals("productDetails"))
              url = base + "ProductDetails.jsp";
              else if (action.equals("addShoppingItem") ||
              action.equals("updateShoppingItem") ||
              action.equals("deleteShoppingItem") ||
              action.equals("displayShoppingCart"))
              url = base + "ShoppingCart.jsp";
              else if (action.equals("checkOut"))
              url = base + "CheckOut.jsp";
              else if (action.equals("order"))
              url = base + "Order.jsp";
              RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher(url);
              requestDispatcher.forward(request, response);
              

              WEB-INF/classes dir & WEB-INF/lib dir are in the server classpath.
              "dinesh" <[email protected]> wrote:
              >
              >Ok, I tried that and it's giving the same error. Do I need to define
              >the JAR file
              >in the web.xml?
              >Thanks.
              >
              >"Deepak Vohra" <[email protected]> wrote:
              >>
              >>
              >>Create a jar file from the classes referred by the servlet class & copy
              >>the jar
              >>file to the WEB-INF/lib directory.
              >>
              >>
              >>"dinesh" <[email protected]> wrote:
              >>>
              >>>I tried to add the servlet to the classpath with the following command:
              >>>
              >>>
              >>>software\burnaby>java -cp -classpath c:\bea\user_projects\infologic1\application
              >>>s\BibleApp\WEB-INF\classes\com\brainysoftware\burnaby\ControllerServlet.class
              >>>
              >>>
              >>>Exception in thread "main" java.lang.NoClassDefFoundError: c:\bea\user_projects\
              >>>infologic1\applications\BibleApp\WEB-INF\classes\com\brainysoftware\burnaby\Cont
              >>>rollerServlet/class;
              >>>
              >>>Is there another way to do this?
              >>>
              >>>
              >>>"Deepak Vohra" <[email protected]> wrote:
              >>>>
              >>>>Is the servlet class com/brainysoftware/burnaby/ControllerServlet
              >in
              >>>>the WEB-INF\classes
              >>>>directory?
              >>>>
              >>>>
              >>>>
              >>>>
              >>>>"dinesh" <[email protected]> wrote:
              >>>>>
              >>>>>Hello.
              >>>>>I'm trying to invoke a servlet. I get the following error:
              >>>>>javax.servlet.ServletException: [HTTP:101250][ServletContext(id=371807,name=BibleApp,context-path=/BibleApp)]:
              >>>>>Servlet class /com/brainysoftware/burnaby/ControllerServlet for servlet
              >>>>>ControllerServlet
              >>>>>could not be loaded because a class on which it depends was not found
              >>>>>in the classpath
              >>>>>C:\bea\user_projects\infologic1\applications\BibleApp;C:\bea\user_projects\infologic1\applications\BibleApp\WEB-INF\classes.
              >>>>>java.lang.NoClassDefFoundError: /com/brainysoftware/burnaby/ControllerServlet
              >>>>>(wrong name: ControllerServlet).
              >>>>>at weblogic.servlet.internal.ServletStubImpl.prepareServlet
              >>>>>----------
              >>>>>web.xml
              >>>>><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              >>>>>2.3//EN"
              >>>>>"http://java.sun.com/dtd/web-app_2_3.dtd">
              >>>>><web-app>
              >>>>><servlet>
              >>>>>
              >>>>><servlet-name>simple</servlet-name>
              >>>>><jsp-file>simplePage.jsp</jsp-file>
              >>>>>
              >>>>></servlet>
              >>>>>
              >>>>><servlet>
              >>>>><servlet-name>ControllerServlet</servlet-name>
              >>>>><servlet-class>com.brainysoftware.burnaby.ControllerServlet</servlet-class>
              >>>>>
              >>>>><!-- Define initial parameters that will be loaded into
              >>>>>the ServletContext object in the controller servlet -->
              >>>>><init-param>
              >>>>><param-name>base</param-name>
              >>>>><param-value>http://localhost:7001/BibleApp/ControllerServlet</param-value>
              >>>>></init-param>
              >>>>><init-param>
              >>>>><param-name>jdbcDriver</param-name>
              >>>>><param-value>weblogic.jdbc.mssqlserver4.Driver</param-value>
              >>>>></init-param>
              >>>>><init-param>
              >>>>><param-name>imageUrl</param-name>
              >>>>><param-value>http://localhost:7001/BibleApp/images/</param-value>
              >>>>></init-param>
              >>>>><init-param>
              >>>>><param-name>dbUrl</param-name>
              >>>>><param-value>jdbc:weblogic:mssqlserver4:users@COMPAQSERVER</param-value>
              >>>>></init-param>
              >>>>><init-param>
              >>>>><param-name>dbUserName</param-name>
              >>>>><param-value>dinesh</param-value>
              >>>>></init-param>
              >>>>><init-param>
              >>>>><param-name>dbPassword</param-name>
              >>>>><param-value>werty69</param-value>
              >>>>></init-param>
              >>>>></servlet>
              >>>>><servlet>
              >>>>><servlet-name>test</servlet-name>
              >>>>><jsp-file>menu_1.jsp</jsp-file>
              >>>>></servlet>
              >>>>>
              >>>>><servlet>
              >>>>><servlet-name>HelloServlet</servlet-name>
              >>>>><servlet-class>HelloServlet</servlet-class>
              >>>>></servlet>
              >>>>>
              >>>>><servlet>
              >>>>><servlet-name>ShowEmployees</servlet-name>
              >>>>><servlet-class>ShowEmployees</servlet-class>
              >>>>></servlet>
              >>>>>
              >>>>><servlet-mapping>
              >>>>><servlet-name>HelloServlet</servlet-name>
              >>>>><url-pattern>/helloservlet</url-pattern>
              >>>>></servlet-mapping>
              >>>>>
              >>>>><servlet-mapping>
              >>>>><servlet-name>test</servlet-name>
              >>>>><url-pattern>/test</url-pattern>
              >>>>></servlet-mapping>
              >>>>>
              >>>>><servlet-mapping>
              >>>>><servlet-name>simple</servlet-name>
              >>>>><url-pattern>/simple</url-pattern>
              >>>>></servlet-mapping>
              >>>>><servlet-mapping>
              >>>>><servlet-name>ShowEmployees</servlet-name>
              >>>>><url-pattern>/ShowEmployees</url-pattern>
              >>>>></servlet-mapping>
              >>>>>
              >>>>><servlet-mapping>
              >>>>><servlet-name>ControllerServlet</servlet-name>
              >>>>><url-pattern>/controlIt</url-pattern>
              >>>>></servlet-mapping>
              >>>>>
              >>>>></web-app>
              >>>>>--------------
              >>>>>ControllerServlet.class
              >>>>>
              >>>>>import java.sql.*;
              >>>>>import javax.servlet.*;
              >>>>>import javax.servlet.http.*;
              >>>>>import java.io.*;
              >>>>>import java.util.*;
              >>>>>import com.brainysoftware.burnaby.DbBean;
              >>>>>
              >>>>>public class ControllerServlet extends HttpServlet {
              >>>>>
              >>>>>/**Initialize global variables*/
              >>>>>public void init(ServletConfig config) throws ServletException {
              >>>>>
              >>>>>System.out.println("initializing controller servlet.");
              >>>>>
              >>>>>ServletContext context = config.getServletContext();
              >>>>>context.setAttribute("base", config.getInitParameter("base"));
              >>>>>context.setAttribute("imageUrl", config.getInitParameter("imageUrl"));
              >>>>>
              >>>>>// instantiating the DbBean
              >>>>>DbBean dbBean = new DbBean();
              >>>>>// initialize the DbBean's fields
              >>>>>dbBean.setDbUrl(config.getInitParameter("dbUrl"));
              >>>>>dbBean.setDbUserName(config.getInitParameter("dbUserName"));
              >>>>>dbBean.setDbPassword(config.getInitParameter("dbPassword"));
              >>>>>
              >>>>>// put the bean in the servlet context
              >>>>>// the bean will be accessed from JSP pages
              >>>>>context.setAttribute("dbBean", dbBean);
              >>>>>
              >>>>>try {
              >>>>>// loading the database JDBC driver
              >>>>>Class.forName(config.getInitParameter("jdbcDriver"));
              >>>>>}
              >>>>>catch (ClassNotFoundException e) {
              >>>>>System.out.println(e.toString());
              >>>>>}
              >>>>>super.init(config);
              >>>>>}
              >>>>>
              >>>>>
              >>>>>/**Process the HTTP Get request*/
              >>>>>public void doGet(HttpServletRequest request, HttpServletResponse
              >>response)
              >>>>>throws
              >>>>>ServletException, IOException {
              >>>>>doPost(request, response);
              >>>>>}
              >>>>>
              >>>>>/**Process the HTTP Post request*/
              >>>>>public void doPost(HttpServletRequest request, HttpServletResponse
              >>>response)
              >>>>>throws
              >>>>>ServletException, IOException {
              >>>>>
              >>>>>String base = "/jsp/";
              >>>>>String url = base + "Default.jsp";
              >>>>>String action = request.getParameter("action");
              >>>>>
              >>>>>if (action!=null) {
              >>>>>if (action.equals("search"))
              >>>>>url = base + "SearchResults.jsp";
              >>>>>else if (action.equals("browseCatalog"))
              >>>>>url = base + "BrowseCatalog.jsp";
              >>>>>else if (action.equals("productDetails"))
              >>>>>url = base + "ProductDetails.jsp";
              >>>>>else if (action.equals("productDetails"))
              >>>>>url = base + "ProductDetails.jsp";
              >>>>>else if (action.equals("addShoppingItem") ||
              >>>>>action.equals("updateShoppingItem") ||
              >>>>>action.equals("deleteShoppingItem") ||
              >>>>>action.equals("displayShoppingCart"))
              >>>>>url = base + "ShoppingCart.jsp";
              >>>>>else if (action.equals("checkOut"))
              >>>>>url = base + "CheckOut.jsp";
              >>>>>else if (action.equals("order"))
              >>>>>url = base + "Order.jsp";
              >>>>>}
              >>>>>RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher(url);
              >>>>>requestDispatcher.forward(request, response);
              >>>>>
              >>>>>}
              >>>>>}
              >>>>>
              >>>>>
              >>>>
              >>>
              >>
              >
              

  • Invoking Servlets in Flash MX

    Hello, I'm new here.. and hope some kind souls would help me out here?
    Our project scope
    My friend and I are working on this Flash application that retrieves data from a IBM DB2 database and displays it. We read somewhere that Flash can't connect directly to a database, thus some middleware is required. So we are using JSP or servlets for our middleware.
    The problem
    In our best (but limited haha) knowledge, we understand that we need to first declare an XML object, and then use a Load method to invoke a servlet that accesses the database and fills the XML object with records of the database. Finally it'll return the filled object back to Flash. Are we correct in this sense?
    Er, the problem is, we have no idea on how the servlet code works. We can successfully connect to the DB2 database and retrieve records, though. Can anyone help us out here?
    We would appreciate greatly. Thanks! :)
    Another not-so-important question
    Btw, we did try loading a XML file into a XML object. However, it's wierd. This is our XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <test>
         <bubble>Hello</bubble>
         <bubble2>Hello hello</bubblewat>
    </test>To retrieve Hello Hello from bubble2, we used this patch of ActionScript:
    doc.load("text.xml");
    doc.onLoad = waitLoad;
    function waitLoad()
    test = doc.childNodes[1].childNodes[3].childNodes[0];
    trace(test.nodeName);
    }Notice, in order to get the 2nd nested child of TEXT we would need to use .childNodes[3], instead of .childNodes[2]. Is that how Flash goes? That each increment is by... 2? But at least, it works...
    That's why it's so wierd... lol. Headache man!

    Sorry I don't know anything about Flash, but I can answer your second question.
    If you look closely at that XML, you can see that the test element has 5 children:
    1. A whitespace text node containing a line-ending character and some spaces.
    2. A bubble element.
    3. A whitespace text node.
    4. A bubble element.
    5. A whitespace text node.
    So incrementing by 2 has nothing to do with Flash. You don't have to have those spaces there, you know, they only make the XML easier for people to read.

Maybe you are looking for

  • Bridge CC hangs upon opening, suggests purging cache which dies nothing except make issue worse

    Have had issues with Bridge becoming increasingly and painfully slow in loading/previewing its thumbnails on all machines in the studio. We have purged cache as per suggestions from the opening error messages but this has only made matters worse to t

  • Transport Parameters for FTP1.0

    While defining Communication Capability of a Remote trading partner i am confused what to put in these fields of Transport Parameter fields,i am using FTP1.0 transport protocol.Please comment on importance of these fields. Transport Parameter Values

  • Variable.extend in pl/sql

    if l_max_date = to_date('01-01-1900', 'dd-mm-yyyy') then p_tax_id.extend; p_tax_desc.extend; p_effective_date.extend; p_tax_rate.extend; p_tax_id(1) := 0; p_tax_desc(1) := 'ENT'; p_effective_date(1) := null; p_tax_rate(1) := 0; This is one part of pl

  • Need insight from DNG gurus about implementing DNG as input format for HDR software

    I've been having a discussion about the DNG file format and the developers of a new HDR software called Essential HDR (EHDR) but we are having some difficulties because none of us really understands much about the DNG spec and concept. The first vers

  • Do I even need more backup?

    ..Not necessarily a Mountain Lion question, but still: I use my iMac for my business, can't take any chances losing stuff... ...But maybe this is an overkill: 1. Time Machine is doing it's job, backing up those critical folders to my Ext. HD. 2. I'm