Structure of servlets in weblogic8.1

I insalled the weblogic8.1 these days only.Actually,i am not getting how the structure of web application(war file) and how to deploy it in the server.

STFW
http://e-docs.bea.com/wls/docs81/webapp/deployment.html#163278

Similar Messages

  • Directory structure for servlets and webservices in one application

    hi,
    Can any one help me for creating servlets and webservices in one
    application and deploying in Jboss 4.2.0.
    I want to know exactly what is the directory structure for creating this
    application and what are the additional .xml files for deploying this application.
    if any one know this answere please tell the answere.

    I figured out a solution - it's a problem of policies. In detail: Server1's codebase entry (file:) refers to the class directory of Server1's project. In the simple case of only Client1, which has no codebase entry, it works fine without a file permission on the side of Server1. In the complex case of Client1+Server2, which has to have a codebase entry (file:) refering to the class directory of the Server2's project on a separate machine, for exactly the same method call from Client1 to Server1 a file permission entry on the side of Server1 is needed for Server1's class directory. But WHY ???
    It seems to be a little confusing with the codebase entries, many of the posts are contrary to others and to my personal experiences. Some comments given by Adrian Colley throw a little light upon some aspects. Is there anybody, who can explain the whole topic, when, why, and which part of RMI application deals with codebase entries, also in case of not dynamic code downloading ? May be there is also a reference into the java docs, which I didn't found up to now.
    Thanks in advance
    Axel

  • Moving in directory structure through servlet

    Hi everyone,
    I am currently using this directory structure and have 2 web applications "myweb1" and "myweb2".
    /myweb1/jsp pages
    /myweb1/WEB-INF
    /myweb1/WEB-INF/classes
    /myweb1/WEB-INF/classes/myservlet
    /myweb1/WEB-INF/lib
    /myweb2/display.jsp
    /myweb2/WEB-INF
    /myweb2/WEB-INF/classes
    /myweb2/WEB-INF/lib
    I have a servlet named "myservlet" in WEB-INF/classes directory(myweb1 application) as shown above. I have following entries in my web.xml file of "myweb1" webapplication.
    <servlet>
    <servlet-name>myservlet</servlet-name>
    <display-name>myservlet</display-name>
    <servlet-class>com.abc.servlet.myservlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>myservlet</servlet-name>
    <url-pattern>/myservlet</url-pattern>
    </servlet-mapping>
    This whole application is running fine. Now I need to forward user from "myservlet" to "display.jsp" page in myweb2 application.
    I am using this line in "myservlet" file.
    getServletConfig().getServletContext().getRequestDispatcher("../myweb2/display.jsp").forward(request, response);
    however this line is not working. Can anyone suggest me how to access display.jsp file from myservlet.
    Thanks.
    Rahul

    As long as everything is running within the same application server instance, you should be able to access both contexts. The key is using the getContext(String URI) method of the ServletContext. From the servlet in webapp1:RequestDispatchter dispatch =
        getServletContext().getContext("/webapp2").getRequestDispatcher("display.jsp");You may have to fiddle with the value in the getContext call (it should be the application context of webapp2) but you should be able to get this to work.

  • Displaying of uploaded directory in a tree structure using servlet

    I have uploaded a directory at the server side.I want to diplay the whole directory in tree form at the client side.I don't want to use Jtree or swing option neither applets.I want to do it using Java Server Page.But I am not able to do it??COuld anyone sujjest a method or can send me a piece of code that may help me to do this...Looking forward for your Brainstorming replies....and codes....

    Could you please explain it more and if possible can u give piece of code??I will be grateful to you...

  • Problem in debug a servlet

    hello all,
    i am using eclipse 3.2 and tomcat 5.0.28
    i made a servlet class ServletFetchingDataFromDatabase.java in this package ( given below )
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ServletDataBaseConnection\src\servlet
    and corresponding this java file .... its class file situated in this package ( given below )
    C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ServletDataBaseConnection\build\classes\servlet
    because of my java file in servlet package , i wrote this file ( given below )
    package servlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ServletFetchingDataFromDatabase extends HttpServlet {
    private static final long serialVersionUID = 8572240412874905464L;
         String url = "jdbc:mysql://localhost/mokshadatabase";
         String user = "root";
         String password = "password";
         String jdbcDriver = "com.mysql.jdbc.Driver";
    public void doGet(HttpServletRequest request , HttpServletResponse response) throws ServletException , IOException{
              String query = null;
              response.setContentType("text/html");
              PrintWriter pw = response.getWriter();
              pw.println("<html>");          
              pw.println("<body>");
              pw.println("<form>");
              pw.println("Servlet DataBase Connection<br>");
              pw.println("Patient Master Table <br><br>");
              try{
                  Class.forName(jdbcDriver).newInstance();
                  Connection conn = DriverManager.getConnection(url, user, password);
                  query = "SELECT * FROM mhis_m_patientmaster";
                  PreparedStatement stmt = conn.prepareStatement(query);
                  stmt.executeQuery();
                  ResultSet rs = stmt.getResultSet();
                  pw.println("<table border = 1>");
                  pw.println("<tr>");
                  pw.println("<td>patient_Id</td>");
                  pw.println("<td>patient_Registration_Date</td>");
                  pw.println("<td>patient_Registration_Time</td>");
                  pw.println("<td>patient_First_Name</td>");
                  pw.println("<td>patient_Last_Name</td>");
                  pw.println("</tr>");
                  while(rs.next()){
                              pw.println("<tr>");
                       if("".equalsIgnoreCase(rs.getString(1))){
                            pw.println("<td>Null</td>");
                       }else{
                            pw.println("<td>" + rs.getString(1) + "</td>");
                       if("".equalsIgnoreCase(rs.getString(2))){
                            pw.println("<td>Null</td>");
                       }else{
                            pw.println("<td>" + rs.getString(2) + "</td>");
                       pw.println("</tr>");
                  pw.println("</table>");
             }catch(IllegalAccessException e){
                   pw.println("Error is : " + e.getMessage() + "<br>");
                   pw.println("Error is IllegalAccessException<br>");
              }catch (ClassNotFoundException e) {
                   pw.println("Error is : " + e.getMessage() + "<br>");
                   pw.println("Error is ClassNotFoundException<br>");
              }catch(InstantiationException e){
                   pw.println("Error is : " + e.getMessage() + "<br>");
                   pw.println("Error is InstantiationException<br>");
              }catch(SQLException e){
                   pw.println("Error is : " + e.getMessage() + "<br>");
                   pw.println("Error is SQLException<br>");
              pw.println("</form>");
              pw.println("</body>");          
              pw.println("</html>");
    }and web.xml .. i wrote
    <!--    ServletFetchingDataFromDatabase.java (In side servlet package )    -->
        <servlet>
            <servlet-name>servlet\ServletFetchingDataFromDatabase</servlet-name>
            <servlet-class>servlet.ServletFetchingDataFromDatabase</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>servlet\ServletFetchingDataFromDatabase</servlet-name>
            <url-pattern>/servlet/ServletFetchingDataFromDatabase.do</url-pattern>
        </servlet-mapping>now when i debug it then it gives error like that...
    HTTP Status 404 - /ServletDataBaseConnection/servlet/servlet.ServletFetchingDataFromDatabase.do
    type Status report
    message /ServletDataBaseConnection/servlet/servlet.ServletFetchingDataFromDatabase.do
    description The requested resource (/ServletDataBaseConnection/servlet/servlet.ServletFetchingDataFromDatabase.do) is not available.main thing is that when i check it from web browser
    ( http://localhost:8080/ServletDataBaseConnection/servlet/ServletFetchingDataFromDatabase.do ) then it gives correct out put .. no problem is there..but when i check it by debug using break point ...then it gives this error....
    i thing this problem is related to web.xml ... but if this web.xml is wrong then why this web.xml gives write out put from when i checked it by browser...

    Hi ,
    I really dont understand why you are making such a complicated folder structure for servlet.
    May be i m wrong, but if you are using eclipse everything is straight forward.
    Just create dynamic web project create servlet into src & jsp into webcontent . Everything place in your
    workspace thats all. Just simply call your servlet thats it
    Please Revert Back
    Sachin Kokcha

  • Re: issue with servlet-mapping

    Hello,
    i got following url pattern on web xml and it works fine on resin, however,
    its gives me, java.lang.IllegalArgumentException: Invalid pattern,
    is there is a anyway to fix it without altering the file structure.
    <servlet-mapping>
            <servlet-name>FacesServlet</servlet-name>
            <url-pattern>/jsf/*.jsf</url-pattern>
        </servlet-mapping>

    Wildcards(*) can be used either at the beginning or end of the pattern.You cannot specify wildcards in the middle of the pattern.
    So, only either of these will work
    <servlet-mapping>
       <servlet-name>FacesServlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>Or
    <servlet-mapping>
       <servlet-name>FacesServlet</servlet-name>
       <url-pattern>/jsf/*</url-pattern>
    </servlet-mapping>

  • How to run servlet in weblogic 8.1

    hi!
    i m new to weblogic.how to run servlet in weblogic8.1.i get lot of errors when i compile it in command prompt.but when i do the same thing in tomcat,i dont get errors & it runs successfully.help me out.how to compile servlets in weblogic 8.1.some say i have to create .jar file.pls tell me the procedure.i m new to j2ee.i have installed jdk1.5 .
    pls its urgent

    a lot of error....
    mmmm no sorry, i don't see
    it remembers me when i was dating sarah,it was very difficult... but now i'm dating anne it's really easier... any idea on what was going wrong with sarah?
    ok sorry for this allegory, just tired to ask always the same thing:
    WHAT ERRORS???

  • How shall i run servlets in weblogic 8.1 sp2

              can any one assist me for running servlets in weblogic8.1 sp2.
              thanking you,
              chandra sekhar
              

              -Copy servlet to the DefaultWebApp/classes directory.
              -Modify the web.xml
              <servlet>
              <servlet-name>
              myServlet
              </servlet-name>
              <servlet-class>
              package.name.myServlet
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              myServlet
              </servlet-name>
              <url-pattern>
              quickStartServlet
              </url-pattern>
              </servlet-mapping>
              -Call your servlet from a Web browser with the following URL:
              http://localhost:port/quickStartServlet
              "Chandrasekhar" <[email protected]> wrote:
              >
              >can any one assist me for running servlets in weblogic8.1 sp2.
              >
              >thanking you,
              >chandra sekhar
              

  • Debug a servlet

    Is my understanding correct you cannot debug a servlet in weblogic8.1 - or am I
    suffering from finger trouble?
    I have a servlet with breakpoints that are never actioned - even though I know
    I executing the code, I can edit, build and change its behaviour - but the breakpoints
    are ignored!
    If a project contains a runnable object like a xxx.jws file the debugger launches
    as expected.
    John

    You might try connecting to your running server with a standard JPDA debugger like
    NetBeans or Eclipse, with a project pointing to your source code. That works
    fine for me. I'm assuming by implication that you're trying to use WebLogic Workshop
    to do this.
    "john" <[email protected]> wrote:
    >
    Is my understanding correct you cannot debug a servlet in weblogic8.1
    - or am I
    suffering from finger trouble?
    I have a servlet with breakpoints that are never actioned - even though
    I know
    I executing the code, I can edit, build and change its behaviour - but
    the breakpoints
    are ignored!
    If a project contains a runnable object like a xxx.jws file the debugger
    launches
    as expected.
    John

  • WLS Servlet design question

    I have a WLS servlet that connects as a CORBA client to WLE. This servlet
              receives XML requests and calls remote CORBA objects in the WLE system.
              When WLS loads a servlet and invokes the servlet's init() method, does it
              make sense to have the init() method to establish the connection to WLE and
              allow the doPost()/service() method to just invoke the calls?
              For example:
              init() {
              initialize_orb();
              resolve_initial_references();
              narrow();
              FactoryFinders();
              myMgr = findManagers();
              doPost() {
              receive transaction;
              myMgr.remoteMethod();
              return response;
              The init() method would setup the connection and doPost() would handle the
              transactions and remote method calls.
              I've found that this design works very well as long as the WLE system stays
              up and available. If WLE is restarted, the WLS servlet remains in a state
              where the init() method already had a connection and the doPost() methods
              ultimately fail. The result is that I either restart WLS or the individual
              servlets that connect to WLE
              What design issues should I pursue to make the WLS client 'impervious' to
              WLE?
              Should I use connection pools?
              Should I do the connection setup and transaction processing in doPost()
              and leave init() alone?
              Any insights would be appreciated.
              Thanks
              Rob Mason
              

    Do you know of a reliable method to detect if my WLE connection is
              active/suspended - like the console reports?
              Once I developed a method, then I could structure my servlet as:
              init() {
              if(myClass.checkWLE()!=true)
              myClass.connectWLE();
              doPost() {
              init();
              do my processing steps here...
              checkWLE() {
              wave at WLE - does it wave back?
              connectWLE() {
              initialize_orb();
              resolve_initial_references();
              narrow();
              FactoryFinders();
              myMgr = findManagers();
              This makes much more sense - thanks for the guidance - I just need to know
              how to check to see if WLE is available...
              Thanks
              Rob
              "Xiang Rao" <[email protected]> wrote in message
              news:[email protected]...
              >
              > I think you need a method to detect the connections and create new
              connection if
              > old one is gone(be careful about synchronization).
              >
              > "Rob Mason" <[email protected]> wrote:
              > >I have a WLS servlet that connects as a CORBA client to WLE. This
              servlet
              > >receives XML requests and calls remote CORBA objects in the WLE system.
              > >When WLS loads a servlet and invokes the servlet's init() method, does
              > >it
              > >make sense to have the init() method to establish the connection to WLE
              > >and
              > >allow the doPost()/service() method to just invoke the calls?
              > >
              > >For example:
              > >
              > >init() {
              > > initialize_orb();
              > > resolve_initial_references();
              > > narrow();
              > > FactoryFinders();
              > > myMgr = findManagers();
              > >}
              > >
              > >doPost() {
              > >receive transaction;
              > >myMgr.remoteMethod();
              > >return response;
              > >}
              > >
              > >
              > >The init() method would setup the connection and doPost() would handle
              > >the
              > >transactions and remote method calls.
              > >I've found that this design works very well as long as the WLE system
              > >stays
              > >up and available. If WLE is restarted, the WLS servlet remains in a
              > >state
              > >where the init() method already had a connection and the doPost() methods
              > >ultimately fail. The result is that I either restart WLS or the
              individual
              > >servlets that connect to WLE
              > >
              > >What design issues should I pursue to make the WLS client 'impervious'
              > >to
              > >WLE?
              > >Should I use connection pools?
              > >Should I do the connection setup and transaction processing in doPost()
              > >and leave init() alone?
              > >
              > >Any insights would be appreciated.
              > >
              > >Thanks
              > >Rob Mason
              > >
              > >
              > >
              >
              

  • Servlet not compiling

    These are my 3 files
    package coreservlets.beans;
    class InsuranceInfo
         private String name = "No name specified";
         private String employeeID = "No ID specified";
         private int numChildren = 0;
         private boolean isMarried = false;
         public String getName()
              return(name);
         public void setName(String name)
              this.name = name;
         public String getEmployeeID()
              return(employeeID);
         public void setEmployeeID(String employeeID)
              this.employeeID = employeeID;
         public void setNumChildren(int numChildren)
              this.numChildren = numChildren;
         public int getNumChildren()
              return(numChildren);
         public boolean isMarried()
              return(isMarried);
         public void setMarried(boolean isMarried)
              this.isMarried = isMarried;
    package coreservlets.beans;
    import java.util.*;
    import javax.servlet.http.*;
    import org.apache.commons.beanutils.*;
    public class BeanUtilities
        public static void populateBean(Object formBean, HttpServletRequest request)
         populateBean(formBean, request.getParameterMap());
        public static void populateBean(Object bean, Map propertyMap)
         try
             BeanUtils.populate(bean, propertyMap);
         catch(Exception e)
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.apache.commons.beanutils.*;
    import coreservlets.beans.*;
    public class SubmitInsuranceInfo extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              InsuranceInfo info = new InsuranceInfo();
              BeanUtilities.populateBean(info,request);
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C HTML 4.0 " + "Transitional//EN\">\n";
              String title = "Insurance Info For " + info.getName();
              out.println(docType  + "<html>" + "<head><title>" + title + "</title></head>");
              out.println("<center><h1>" + title + "</h1><br>");
              out.println("<ul><li>Employee ID: " + info.getEmployeeID() + "<br><li>Number Of Children: " + info.getNumChildren());
              out.println("<li><br>Married: " + info.isMarried() + "</ul></center></body></html>");
    }i compile the file InsuranceInfo and BeanUtilities. Both compiled.I put both the classfiles inside coreservlets/beans.
    Now I tried to compile SubmitInsuranceInfo where I have import coreservlets.beans.;
    linux-9jc3:~/Development/Servlets # javac SubmitInsuranceInfo.java
    SubmitInsuranceInfo.java:11: cannot access InsuranceInfo
    bad class file: ./InsuranceInfo.java
    file does not contain class InsuranceInfo
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    InsuranceInfo info = new InsuranceInfo();
    ^
    1 error
    I can't understand the error because I have set the classpath to .
    I am compiling from a folder called Servlet
    The directory structure is
    Servlet
    |____SubmitInsuranceInfo.java
    |____coreservlet
    |
    |____beans
    |
    |____InsuranceInfo.class
    |____BeanUtilities.class

    Did that but still I am getting the same error
    SubmitInsuranceInfo.java:11: cannot access InsuranceInfo
    bad class file: ./InsuranceInfo.java
    file does not contain class InsuranceInfo
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    InsuranceInfo info = new InsuranceInfo();
    ^
    1 error
    linux-9jc3:~/Development/Servlets #
    It looks like a classpath issue
    I have the classpath as . and moreover I have put both the InsuranceInfo and BeanUtilities.class in coreservlets/beans/ folder. The coreservlets dir is in Servlets dir. I am compililing the SubmitInsuranceInfo.java file from the Servlets dir.

  • Unregistered servlets in weblogic5.1

    Hi
    1)In am calling from javascript file:
    parent.frames[1].hiddenfrm.action = "/servlet/login.AdminMainServlet";
    For this the entry in weblogic properties file is:
    weblogic.httpd.register./servlet/login.AdminMainServlet=login.AdminMainServlet
    This works fine.
    2) But now I am calling a servlet like this, from a javascript file:
    window.open("../../servlet/Sales.ProdResrvServlet?mode=addition&act=CustomerPopup&cmpcd="+cmpcd+"&finyr="+finyr+"&searchby=sname", "CustomerPopup", "width=725, height=200, top= 5, left=60");
    how can i call a unregistered servlet?..Even i commented for servletservlet, weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet
    My directory structure for servlets is:
    C:\weblogic\myserver\servletclasses\sales
    C:\weblogic\myserver\servletclasses\login
    But i am calling the servlets like above,because i am shifting from someother webserver to weblogic5.1
    Cheers

    Sample web.xml
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <servlet>
    <servlet-name>com.final1.servlets.LoginServlet</servlet-name>
    <servlet-class>com.final1.servlets.LoginServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>RouterServlet</servlet-name>
    <servlet-class>com.final1.servlets.RouterServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>com.final1.servlets.LoginServlet</servlet-name>
    <url-pattern>/com.final1.servlets.LoginServlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>RouterServlet</servlet-name>
    <url-pattern>/RouterServlet</url-pattern>
    </servlet-mapping>
    </web-app>

  • Unable to set configured property "/Initial.initialServices"

    Hi All,
    I am getting following error-
    05:21:52,006 INFO  [STDOUT] Unable to set configured property "/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /com/progiweb/fbconnect/pipeline/FacebookAuthStatusServlet
    05:21:52,013 INFO  [STDOUT] **** Error
    05:21:52,064 INFO  [STDOUT] Unable to set configured property "/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /com/progiweb/fbconnect/pipeline/FacebookProfileRequestServlet
    I have checked the config path of both components and the structure of servlet is as below-
    src/com/progiweb/fbconnect/pipeline/FacebookAuthStatusServlet.java  and  src/com/progiweb/fbconnect/pipeline/FacebookProfileRequestServlet.java.java
    And for the properties files I have created them under the path- config/atg/dynamo/servlet/dafpipeline  and  config/atg/dynamo/servlet/pipeline
    Inside these I am keeping the FacebookAuthStatusServlet.properties and FacebookProfileRequestServlet.properties files
    The path of Initial.properties is as below- config/atg/dynamo/servlet/Initial.properties
    The content of Initial.properties is -
    initialServices+=\
      /atg/dynamo/servlet/dafpipeline/FacebookAuthStatusServlet,\
      /atg/dynamo/servlet/dafpipeline/FacebookProfileRequestServlet
    Should I need to keep the both pipeline- dafpipeline and pipeline or only one of them?
    And my pipeline structure is correct or not?
    How to resolve the above error?
    Please help regarding this!
    Regards,
    Prateek

    The content of config/atg/dynamo/servlet/dafpipeline/FacebookAuthStatusServlet.properties is as below-
    $class=com.progiweb.fbconnect.pipeline.FacebookAuthStatusServlet
    $scope=global
    serviceInfo=This servlet handle facebook redirection if it's a new user.
    insertAfterServlet=/atg/dynamo/servlet/dafpipeline/FacebookProfileRequestServlet
    redirect=true
    redirectURI=register.jsp
    profileUpdater=/fbconnect/userprofiling/FacebookProfileUpdater
    loggingDebug=false
    And the content of config/atg/dynamo/servlet/pipeline/FacebookAuthStatusServlet.properties is as below-
    $class=com.progiweb.fbconnect.pipeline.FacebookAuthStatusServlet
    $scope=global
    serviceInfo=This servlet handle facebook redirection if it's a new user.
    insertAfterServlet=/atg/dynamo/servlet/pipeline/FacebookProfileRequestServlet
    redirect=true
    redirectURI=register.jsp
    profileUpdater=/fbconnect/userprofiling/FacebookProfileUpdater
    bypassExtensions=.css,.gif,.jpg,.swf
    loggingDebug=false
    I think this will clear the confusion.
    Regards,
    Prateek

  • Using bean methods within JSP declaration

    Is it true that bean methods will not work in JSP Methods ?
    For example:
    // get the bean
    <jsp:useBean id="FormValidate" scope="session" class="fsm.frontendCtr.FormValidate" />
    // build a new method in jsp
    <%!
    boolean validate(HttpServletRequest req, String submitFlag) {
    FormValidate.checkMandatory("ADRNACHNAME");
    %>ServletExec return:
    Undefined Variable or class name: FormValidate
    If i use the bean Methods outside the method it worx.
    Is there a trick with which I can use BeanMethods in a JSP Method?

    Is it true that bean methods will not work in JSP
    Methods ?
    For example:
    // get the bean
    <jsp:useBean id="FormValidate" scope="session"
    class="fsm.frontendCtr.FormValidate" />
    // build a new method in jsp
    <%!
    boolean validate(HttpServletRequest req, String
    submitFlag) {
    FormValidate.checkMandatory("ADRNACHNAME");
    %>ServletExec return:
    Undefined Variable or class name: FormValidate
    If i use the bean Methods outside the method it worx.
    Is there a trick with which I can use BeanMethods in a
    JSP Method?FormValidate is this Object. If you need others, pass them from parameters. Try to understand the structure of servlet generated by your JSP.
    <%!
    boolean validate(HttpServletRequest req, String submitFlag) {
    this.checkMandatory("ADRNACHNAME");
    %>
    hope this helps,
    yang

  • I know it is a silly question But unable to get HelloWorldServlet to work!

              Hello Everybody,
              I've downloaded the weblogic server today and thought of testing it with HelloWorld servlet. I made directory structure and copied under mydomain/applications/
              So finally my directory structure is mydomain/applications/myWebAPP/WEB-INF/classes/examples/servlets/HelloWorldServlet.class.
              Just onle one Hello World servlet and web.xml file which has the following entries.
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <display-name>Reliable Web Application</display-name>
              <servlet>
              <servlet-name>HelloWorldServlet</servlet-name>
              <servlet-class>examples.servlets.HelloWorldServlet</servlet- class>
              </servlet>
              <servlet-mapping>
              <servlet-name>HelloWorldServlet</servlet-name>
              <url-pattern>/HelloWorldServlet/*</url-pattern>
              </servlet-mapping>
              <mime-mapping>
              <extension>html</extension>
              <mime-type>text/html</mime-type>
              </mime-mapping>
              <mime-mapping>
              <extension>htm</extension>
              <mime-type>text/html</mime-type>
              </mime-mapping>
              </web-app>
              I have coded that HelloWorldServlet in my Jbuilder and copied it to that location. Then I started my default admin server, console, and opened a webpage and gave URL like this.....
              http://abcom1:7001/Reliable/HelloWorldServlet.
              Then it I saw the following errors on my default admin server window.
              <Nov 28, 2000 5:48:55 PM CST> <Error> <HTTP> <[WebAppServletContext(3232789,Reli
              able)] Error loading servlet: 'HelloWorldServlet'
              java.lang.NoClassDefFoundError: examples/servlets/HelloWorldServlet (wrong name:
              HelloWorldServlet)
              at java.lang.ClassLoader.defineClass0(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:426)
              at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
              ClassLoader.java:278)
              at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
              Loader.java:146)
              at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
              areClassLoader.java:41)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
              at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              mpl.java:530)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              java:293)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:1107)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:1482)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              <Nov 28, 2000 5:48:55 PM CST> <Error> <HTTP> <[WebAppServletContext(3232789,Reli
              able)] Servlet failed with ServletException
              javax.servlet.ServletException: Servlet class: 'examples.servlets.HelloWorldServ
              let' could not be resolved - a class upon which this class depends wasn't found
              at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              mpl.java:544)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              java:293)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:1107)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:1482)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              I don't why why it is unable to find my servlet. Any help in resolving this error is highly appreciated.
              Also if want to put package structure in place like myWebApp/WEB-INF/classes/com/company/servlets/*.class
              what changes I need to do for my web.xml file.
              Thanks so much,
              Sri.
              

              Thanks for helping me out Gary. It worked.
              Sri.
              Gary Keim <[email protected]> wrote:
              >
              >
              >When you coded it up in JBuilder, did you declare it to be in package
              >examples.servlets? The exception is indicating that the actual full
              >package name of your servlet is simply "HelloWorldServlet.class" as
              >opposed to the expected "examples.servlets.HelloWorldServlet.class."
              >
              >You should have the following line at the very top of
              >HelloWorldServlet.java:
              >
              >package examples.servlets;
              >
              >You can leave it in the "default package" but then you'll need to change
              >your directory structure and servlet declaration.
              >
              >-Gary
              >
              >sri wrote:
              >
              >> Hello Everybody,
              >> I've downloaded the weblogic server today and thought of testing it with HelloWorld servlet. I made directory structure and copied under mydomain/applications/
              >> So finally my directory structure is mydomain/applications/myWebAPP/WEB-INF/classes/examples/servlets/HelloWorldServlet.class.
              >> Just onle one Hello World servlet and web.xml file which has the following entries.
              >>
              >> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              >> <web-app>
              >> <display-name>Reliable Web Application</display-name>
              >> <servlet>
              >> <servlet-name>HelloWorldServlet</servlet-name>
              >> <servlet-class>examples.servlets.HelloWorldServlet</servlet- class>
              >> </servlet>
              >> <servlet-mapping>
              >> <servlet-name>HelloWorldServlet</servlet-name>
              >> <url-pattern>/HelloWorldServlet/*</url-pattern>
              >> </servlet-mapping>
              >> <mime-mapping>
              >> <extension>html</extension>
              >> <mime-type>text/html</mime-type>
              >> </mime-mapping>
              >> <mime-mapping>
              >> <extension>htm</extension>
              >> <mime-type>text/html</mime-type>
              >> </mime-mapping>
              >> </web-app>
              >>
              >> I have coded that HelloWorldServlet in my Jbuilder and copied it to that location. Then I started my default admin server, console, and opened a webpage and gave URL like this.....
              >> http://abcom1:7001/Reliable/HelloWorldServlet.
              >> Then it I saw the following errors on my default admin server window.
              >>
              >> <Nov 28, 2000 5:48:55 PM CST> <Error> <HTTP> <[WebAppServletContext(3232789,Reli
              >> able)] Error loading servlet: 'HelloWorldServlet'
              >> java.lang.NoClassDefFoundError: examples/servlets/HelloWorldServlet (wrong name:
              >> HelloWorldServlet)
              >> at java.lang.ClassLoader.defineClass0(Native Method)
              >> at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
              >> at java.lang.ClassLoader.defineClass(ClassLoader.java:426)
              >> at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
              >> ClassLoader.java:278)
              >> at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
              >> Loader.java:146)
              >> at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
              >> areClassLoader.java:41)
              >> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
              >> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
              >> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              >> mpl.java:530)
              >> at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              >> java:293)
              >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >> pl.java:200)
              >> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              >> rvletContext.java:1107)
              >> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              >> pl.java:1482)
              >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >>
              >> <Nov 28, 2000 5:48:55 PM CST> <Error> <HTTP> <[WebAppServletContext(3232789,Reli
              >> able)] Servlet failed with ServletException
              >> javax.servlet.ServletException: Servlet class: 'examples.servlets.HelloWorldServ
              >> let' could not be resolved - a class upon which this class depends wasn't found
              >> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              >> mpl.java:544)
              >> at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              >> java:293)
              >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              >> pl.java:200)
              >> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              >> rvletContext.java:1107)
              >> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              >> pl.java:1482)
              >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >>
              >>
              >> I don't why why it is unable to find my servlet. Any help in resolving this error is highly appreciated.
              >> Also if want to put package structure in place like myWebApp/WEB-INF/classes/com/company/servlets/*.class
              >> what changes I need to do for my web.xml file.
              >>
              >> Thanks so much,
              >> Sri.
              >>
              >>
              >>
              >>
              >>
              >>
              >>
              >
              >
              >
              ><html><head></head><body>When you coded it up in JBuilder, did you declare
              >it to be in package examples.servlets?  The exception is indicating that
              >the actual full package name of your servlet is simply "HelloWorldServlet.class"
              >as opposed to the expected "examples.servlets.HelloWorldServlet.class."<br>
              ><br>
              >You should have the following line at the very top of HelloWorldServlet.java:<br>
              ><br>
              >package examples.servlets;<br>
              ><br>
              >You can leave it in the "default package" but then you'll need to change your directory structure and servlet declaration.<br>
              ><br>
              >-Gary<br>
              ><br>
              >sri wrote:<br>
              ><blockquote type="cite" cite="mid:[email protected]"><pre wrap="">Hello Everybody,<br>I've downloaded the weblogic server today and thought of testing it with HelloWorld servlet. I made directory structure and copied under mydomain/applications/<br>So finally my directory structure is mydomain/applications/myWebAPP/WEB-INF/classes/examples/servlets/HelloWorldServlet.class. <br>Just onle one Hello World servlet and web.xml file which has the following entries.<br><br><!DOCTYPE web-app
              >PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" <a class="moz-txt-link-rfc2396E" href="http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"</a>><br><web-app><br> <display-name>Reliable Web Application</display-name><br> <servlet><br> <servlet-name>HelloWorldServlet</servlet-name><br> <servlet-class>examples.servlets.HelloWorldServlet</servlet- class><br> </servlet><br> <servlet-mapping><br>
              > <servlet-name>HelloWorldServlet</servlet-name><br> <url-pattern>/HelloWorldServlet/*</url-pattern><br> </servlet-mapping><br> <mime-mapping><br> <extension>html</extension><br> <mime-type>text/html</mime-type><br> </mime-mapping><br> <mime-mapping><br> <extension>htm</extension><br> <mime-type>text/html</mime-type><br> </mime-mapping><br></web-app><br><br>I have coded
              >that HelloWorldServlet in my Jbuilder and copied it to that location. Then I started my default admin server, console, and opened a webpage and gave URL like this.....<br><a class="moz-txt-link-freetext" href="http://abcom1:7001/Reliable/HelloWorldServlet">http://abcom1:7001/Reliable/HelloWorldServlet</a>.<br>Then it I saw the following errors on my default admin server window.<br><br><Nov 28, 2000 5:48:55 PM CST> <Error> <HTTP> <[WebAppServletContext(3232789,Reli<br>able)]
              >Error loading servlet: 'HelloWorldServlet'<br>java.lang.NoClassDefFoundError: examples/servlets/HelloWorldServlet (wrong name:<br> HelloWorldServlet)<br> at java.lang.ClassLoader.defineClass0(Native Method)<br> at java.lang.ClassLoader.defineClass(ClassLoader.java:486)<br> at java.lang.ClassLoader.defineClass(ClassLoader.java:426)<br> at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic<br>ClassLoader.java:278)<br> at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass<br>Loader.java:146)<br>
              > at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw<br>areClassLoader.java:41)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:297)<br> at java.lang.ClassLoader.loadClass(ClassLoader.java:253)<br> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI<br>mpl.java:530)<br> at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.<br>java:293)<br> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm<br>pl.java:200)<br>
              > at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe<br>rvletContext.java:1107)<br> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm<br>pl.java:1482)<br> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)<br> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)<br></pre>
              > <pre wrap=""><!----><Nov 28, 2000 5:48:55 PM CST> <Error> <HTTP> <[WebAppServletContext(3232789,Reli<br>able)] Servlet failed with ServletException<br>javax.servlet.ServletException: Servlet class: 'examples.servlets.HelloWorldServ<br>let' could not be resolved - a class upon which this class depends wasn't found<br> at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI<br>mpl.java:544)<br> at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.<br>java:293)<br>
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm<br>pl.java:200)<br> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe<br>rvletContext.java:1107)<br> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm<br>pl.java:1482)<br> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)<br> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)<br></pre>
              > <pre wrap=""><!----><br>I don't why why it is unable to find my servlet. Any help in resolving this error is highly appreciated. <br>Also if want to put package structure in place like myWebApp/WEB-INF/classes/com/company/servlets/*.class<br>what changes I need to do for my web.xml file. <br><br>Thanks so much,<br>Sri.<br><br><br><br><br><br><br><br></pre>
              > </blockquote>
              > <br>
              ></body></html>
              >
              

Maybe you are looking for