JSP implementation class for a JSP Page

Hello,
It is very important for me to know ...
- Do you consider that a JSP developer should know that each JSP Page becomes at run-time a Java Servlet ? And int the way that the Java code you have wrote in the JSP Page is dispatched in the declaration of this servlet ?
He should know how the Java code generated by the server looks like ?
Thank you all for your answers.
Adriana

Everybody's going to have their own opinion on this - here's my 2 cents.
Theoretically, there are at least two roles here.
#1. An expert in HTML, graphic layout, user interface etc.
#2. A programmer who understands the technical infrastructure - Java, beans, servlets, database connections etc.
In the perfect world, Role #1 would build JSPs and would not need to understand Java or the technical architecture. The JSPs would act as templates and not contain any Java code (e.g. scriptlets). Role #2 would build custom tags and beans for use in the JSPs.
To answer your question, Role #1 should not understand how JSPs are translated to servlets, but Role #2 should.
In reality, the two roles are often filled by the same person, usually a programmer who may introduce Java elements into the JSP. Once this occurs, then the JSP has become a program rather than a template and knowledge of its translation to servlets is necessary for debugging.

Similar Messages

  • ServletContextProvider Implementation class for Apache Struts Bridge in OAS

    Hello,
    I am using Apache Struts Bridge to create JSR-168 portlets, based on Struts.
    But I am stuck in one point... i.e. maybe oracle doesnot provide a implementaion for the ServletContextProvider interface, which is required by the struts bridge, inorder to get the servlet context.
    Other Portal Servers like, Pluto, etc... provide a implementation class for this.
    I have heard that, if a Implementation class can be written for this, then the problem will be solved.
    Have any one faced any such situation? Have any one implemented the ServletContextProvider interface for OC4J....
    Any Help would be highly appreciated.
    Thanks
    Sam...

    I was able to find that class by downloading the Oracle Portlet Container 10.1.2.0.2 and following the instructions for extracting it into my OC4J. When you do that it will give you a file called ${OC4J_HOME}/shared-lib/oracle.wsrp/1.0/wsrp-container.jar. That jar file contains the class you need.
    Oracle Portlet Container 10.1.2.0.2: http://download.oracle.com/otndocs/tech/ias/portal/files/portlet-container.zip
    PDK Page: http://www.oracle.com/technology/products/ias/portal/pdk.html

  • Missing implementation class for new BSP

    Hi,
    I am creating a new BSP and I get strange error.
    After having created the BSP, I want to change the implementation class for the BSP. I doubleclick on the implementation class, but I get this message:
    Object type ZL_ZCPSWIZA_BSPWDCOMPONEN_IMPL does not exist
    Message no. OO003
    Nothing happens. The package is new, but it is not flagged as a main package so that should be OK.
    Peter

    This is the wrong forum, but I'll answer your question anyway.
    There is a default constructor for MyImplementor that is compiler generated. It looks like this:
    public MyImplementor() {
      super();
      textArea = new JTextArea();
    }MyAbstractPanel() calls jbInit(), which you've overriden in MyImplementor.
    See the problem?
    As a trivia note, C++ handles this by not dispatching method calls virtually during object construction. Less flexible, but safer.
    God bless,
    -Toby Reyelts

  • Importing classes for a jsp

    Hi,
    I'm trying to get a jsp working. This is part of the code of test.jsp:
    <%@page import="First, Second" %>
    <HTML>
    <HEAD>
    <TITLE>JSP Example 3</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFCC">
    <CENTER>
    <H2>Date and Time</H2>
    First.hello() is: <% First.hello(); %>
    Second.hi() is:  <% Second.hi(); %>
    </CENTER>
    </BODY>
    </HTML>This is the output of the compilation in Tomcat:
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the generated java file
    The import First cannot be resolved
    An error occurred at line: 7 in the generated java file
    The import Second cannot be resolved
    An error occurred at line: 9 in the jsp file: /date3.jsp
    First cannot be resolved
    6: <BODY BGCOLOR="#FFFFCC">
    7: <CENTER>
    8: <H2>Date and Time</H2>
    9: First.hello() is: <% First.hello(); %>
    10: Second.hi() is:  <% Second.hi(); %>
    11: </CENTER>
    12: </BODY>First.class and Second.class are the two files who share the directory with test.jsp
    I'm flabergasted with this error. As I am using very basic code for this example you would think it works (or is this error one of the NullPointerException kind?).
    Abel
    Edited by: Abel on Dec 12, 2007 6:21 AM
    Changed to a more basic type of example

    I found the answer myself ~:-).
    Add the files you want to import to a jar file
    * To be more precise, in the directory I have the jsp, I created first a directory WEB-INF, and in that directory created a directory lib, and finally created a directory test. I moved the two Java files to the test directory. I changed the Java files (added a package statement). So the configuration is now:
    <%@page import="test.*" %>
    <HTML>
    <HEAD>
    <TITLE>JSP Example 3</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFCC">
    <CENTER>
    <H2>Date and Time</H2>
    <%
       First first = new First();
       out.println ("First says: " + first.hello());
    %>
    </CENTER>
    </BODY>
    </HTML>And the two java files:
    package test;
    public class First {
         public String hello() {
              return ("Hello from First");
    package test;
    public class Second {
         public String hi() {
              return ("Hi from Second");
    }And finally I added the two classes I got after compilation to a jar file in the WEB-INF\lib directory:
    jar -cvf test.jar test\First.class test\Second.classI just explain what I did wrong, as I saw many comparable posts without an answer. And this basic problem can keep you away from the real work.
    Abel.

  • OAAM web services implementation class for WebSphere 6.1

    Hi All,
    My client is running OAAM 10.1.4.5 and looking to migrate to WebSphere 6.1. I'd like to replace the (default) Apache Axis web services implementation class with a custom-built WebSphere 6.1 implementation class. Does anyone have any code they'd been willing to share?
    Regards,
    Steven

    It is may be because BO is not ready for Java 2 and you can find more info about readyness of applications at
    http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/csec_rsecmgr2.html
    I am not sure if BO is prepared for the very fine-grain access control programming model that Java 2 security is capable of enforcing.
    May be some one from PG should be able to answer readyness of BO with Java2.
    -Gokul.

  • How to delete customize Implementing Class for CL_EXM_IM_FI_DOCUMNT_CHECK

    Hi All,
    I used se19 to create Enhancement Spot : ARC_FI_DOCUMNT to ZARC_FI_DOCUMNT, and I created a BAdI ZFI_DOCUMNT_CHECK from FI_DOCUMNT_CHECK in ZARC_FI_DOCUMNT, then I implemented a Implementing Class ZCL_EXM_IM_FI_DOCUMNT_CHECK for method IF_EX_FI_DOCUMNT_CHECK~CHECK_FOR_ARCHIVING.
    Finally, I deleted ZARC_FI_DOCUMNT and recreate ZARC_FI_DOCUMNT by T-Code SE19 for testing, i found Implementing Class ZCL_EXM_IM_FI_DOCUMNT_CHECK program still in the SAP, but I can't delete this Implementing Class & Program.
    How can I delete program & customize Implementing class ZCL_EXM_IM_FI_DOCUMNT_CHECK In SAP?
    Best regards,
    Eric

    Hi Eric,
    Proceed as follows.
    1. Goto T-Code SE24
    2. enter your class name
    3. click delete button
    Or you can also delete classes from SE80.
    You can find class under your Package Name->Class Library->Classes
    Regards
    Ahsan
    Edited by: Ahsan Majeed on Feb 3, 2010 12:05 PM

  • Implementing Badi for additional tab page & creating views in cProjects 3.1

    Hi,
    I am implementing DPR_ADD_SAP_TAB_I for adding new tab page in Cprojects 3.1.
    Please tell me whether we have to create any veiw?
    if it is please tell me the procedure & steps

    Hi...
    Implement the BAdI DPR_ADD_SAP_TAB_I
    and write following code in its method GET_ADD_TAB_DATA
    method IF_EX_DPR_ADD_SAP_TAB_I~GET_ADD_TAB_DATA .
      field-symbols: <tab_data> type DPR_TS_SAP_TAB_CTRL.
      data: lt_tab_data type DPR_TT_SAP_TAB_CTRL.
      constants: lc_pre_ctrl   type string value 'CTRL_TAB_',
                         lc_suff_ctrl  type string value '.DO'.
      lt_tab_data = ct_comp_ctrl.
      loop at lt_tab_data assigning <tab_data>.
        case <tab_data>-obj_type.
       project definition
          when CL_DPR_CO=>SC_OT_PROJECT.
            <tab_data>-tab_title = 'otr(zotr_cust_txt/proj_txt)'.
            concatenate lc_pre_ctrl CL_DPR_CO=>SC_OT_PROJECT lc_suff_ctrl
    into <tab_data>-controller.
        endcase.
      endloop.
      ct_comp_ctrl = lt_tab_data.
      EV_BSP_APPL = 'CST_ADD'.
    endmethod.
    Regards,
    Reema.

  • How to create two different implementation class for a Control

    Hi,
    I am a newbie to beehieve. I want to know that is it possible to create two different 'Impl' classes for a Control. If yes then how do we instantiate them ? How can we chain them (something like calling one 'Impl' from the other one? Thanks in Advance!!!
    Regards,
    Abhishek

    You are sure you are in the right forum?
    This is the JDeveloper and ADF forum...
    Timo

  • How to keep the generated java classes for compiled jsp in WL9.2 Workshop

    Hi all,
              <p>
              It should be a very simple question for most of you, however, it seems a bit tricky to me: how to configure the Weblogic 9.2 workshop so that we could keep the generated java files for the compiled jsp when we ran the application within WL 9.2 workshop?
              <p>
              I try some configurations, but not working. Also, where are the generated java files stored?
              <p>
              Thanks for the help!
              <p>
              Agnes
              Edited by wingagnes at 03/21/2008 7:51 AM

    Hi yzeng,
              <p>
              Thanks for the reply. If I change the jsp-descriptor into the following:
              <p>
              <jsp-descriptor>
              <p>
              <keepgenerated>true</keepgenerated>
              <p>
              <working-dir>D:\temp\golGenerated</working-dir>
              <p>
              <debug>true</debug>
              <p>
              </jsp-descriptor>
              <p>
              I will get the following error message:
              <p>
              cvs-complex-type.2.3.d:Invalid content was found starting with element 'precompile'. No child element is expected at this point.
              <p>
              Thanks,
              <p>
              Agnes

  • Toy Store Best Practice: How to implement 'cancel' for register user page

    Let's say user wants to register or (even edit) his/her account. But when forwards to register(edit) account page, he/she decides not to do it. I would like to implement 'cancel' button and return the user whereever he/she was before comming to this page.
    What is the best practice?
    Even worse, if user gets to this page and never saves the entry. The model would be dirty. And then let's say that user wants to commit something in DB, it may commit incorrect(blank) entry for created row. What I am up to, is what is the best practice to keep track if the model gets dirty and delete invalid rows in general?

    You might want to read this thread:
    Cancel operation followed by refresh raises JBO-33035
    (very similar discussion I was having with Steve)

  • JNDI returns a different class for different applications

    Hello,
    I have a WebSphere server that runs a JNDI service, in which I defined an entry for a ConnectionFactory declared on a remote server. On the server I run an EJB application which connects the JNDI and gets the ConnectionFactory. I also have a stand-alone Java application which gets the ConnectionFactory from the JNDI on the server.
    The problem is that the implementation class for the ConnectionFactory I get is different between the EJB and the stand-alone applications. The stand-alone application recieves a MQXAQueueConnectionFactory, which is just fine because I want to use XA transactions, but the EJB application receives a JMSQueueConnectionFactoryHandle!
    What can be the reason for that? How does the JNDI service determine which implementation class to return?
    (I suppose that is a specific behavior for Websphere...) How can I control that, if at all?
    Thanks!

    I have a similar situation occurring. Was therre any resolution found?

  • Exception Handling for many bean objects of a container class in a JSP page

    Hello,
    I have on container bean class. In this container class, there are several others class objects and the getter methods to get these objects out to the JSP pages.
    I have one JSP page which will use different objects in the container class object through the getter methods of the container class.
    My question is how to implement the exception handler for all the objects in the container so that the JSP page can handle all exceptions if occurrs in any object in the container?
    Please give me some suggestions. Thanks
    Tu

    Thanks for your reply.
    Since the container is the accessor class, I have no other super class for this container class, I think I will try the try catch block in the getter methods.

  • Unable to compile class for JSP

    Please can anyone help me to solve this.
    Actually,this is the condition.
    In my db,there is a table called UserPassword, which has 4
    fields(empNo,UserName,password,level). Now I want to do these things:
    When the user submits the data to create a new account via HTML form, it submits the data to the file called CreateAcc.jsp. In this file it perform some logic,here are they.
    1)To check the empNo,if it is already exist in the DB,
         if empNo =exist then display error.(record already exist)
         if empNo =notexist then do task 2).
    2)check the UserName,if it is already exist in the db,
         if UserName=exist then display error.(because it's a primary key)
         if UserName=notexist then do task 3).
    3)Create a new user account and save it to the db.
    To do these tasks,I never create a new objects for the tasks 1) and 2).
    only for task 3)create an object.
    Is it the right way?
    Here is the file CreateAcc.jsp
    <%@ page language="java" %>
    <%@ page import="core.UserAccManager" %>
    <%@ page import="data.UserPassword" %>
    <jsp:useBean id="UserAccManager" class="core.UserAccManager" scope="session"/>
    <jsp:setProperty name="UserAccManager" property="*"/>
    <jsp:useBean id="UserPassword" class="data.UserPassword" scope="session"/>
    <jsp:setProperty name="UserPassword" property="*"/>
    <%
    String nextPage ="MainForm.jsp";
    if(UserPassword.verifyEmpno()){
         if(UserPassword.verifyUsername()){
              if(UserPassword.createAcc()) nextPage ="MsgAcc.jsp";
          }else{
               nextPage="UserNameExist.jsp";
          else{
              nextPage="UserAccError.jsp";
    %>
    <jsp:forward page="<%=nextPage%>"/>The directory structure:
    UserPassword.java- F:/Project/core/data/UserPassword.java
    UserAccManager.java - F:/Project/core/UserAccManager.java
    Now both are compiling.I put the class files into the TOMCAT,as follows.
    UserAccManager.class - webapps/mySystemName/WEB-INF/classes/core/
    UserPassword.class - webapps/mySystemName/WEB-INF/classes/core/data/
    Here is the full code of the file UserAccManager.java.
    package core;               //Is this right?
    import data.UserPassword;     //Is this right?
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public final class UserAccManager{
       private static final String DRIVER = "com.mysql.jdbc.Driver";
       private static final String URL = "jdbc:mysql://localhost:3306/superfine";
       private static Connection connection;
       private static PreparedStatement pstmt1;
       private static PreparedStatement pstmt2;     
       private static PreparedStatement pstmt3;     
       private UserAccManager(){
       // Initializes the connection and statements
       public static void initConnection() {
          if (connection == null) {
             try {
                String sql;
                // Open the database
                Class.forName(DRIVER).newInstance();
                connection = DriverManager.getConnection(URL);
                // Prepare the statements
               sql = "SELECT * FROM UserPassword where empNo= ?";
               pstmt1 = connection.prepareStatement(sql);
                sql = "SELECT UserName FROM UserPassword where UserName= ?";
                pstmt2 = connection.prepareStatement(sql);
             sql ="INSERT INTO UserPassword VALUES(?,?,?,?)";
             pstmt3 = connection.prepareStatement(sql);
             catch (Exception ex) {
                System.err.println(ex.getMessage());
       // Closes the connection and statements
       // Method to be called by main class when finished with DB
       public  void closeConnection() {
          //same as previous
       public static boolean verifyEmpno(int empno) {
          boolean emp_no_select_ok = false;
          int emp = -1;
          initConnection();
         try {
          pstmt1.setInt(1, empno);
             ResultSet rs1 = pstmt1.executeQuery();
         while(rs1.next()){
              emp=rs1.getInt("empNo");
         if(emp>0)
              emp_no_select_ok = false;
         } else{
              emp_no_select_ok = true;     
            rs1.close();
         pstmt1.close();     
          catch (Exception ex) {
             System.err.println(ex.getMessage());
          return emp_no_select_ok;
       public static boolean verifyUsername(String username) {
          boolean user_name_select_ok = false;
          String user = "xxxx";
          initConnection();
          try {
          pstmt2.setString(1, username);
             ResultSet rs2 = pstmt2.executeQuery();
            while(rs2.next()){
              user=rs2.getString("UserName");
               if(!user.equals("xxxx"))
              user_name_select_ok = false;
            } else{
              user_name_select_ok = true;     
           rs2.close();
          catch (Exception ex) {
             System.err.println(ex.getMessage());
          return user_name_select_ok;
         public static boolean createAcc(int empno, String username, String password, int
    level){
              boolean create_acc_ok = false;
              initConnection();
              try{
                      //create a new object,from the UserPassword table.
                   UserPassword useraccount = new UserPassword();
                   useraccount.setEmpno(empno);
                   useraccount.setUsername(username);
                   useraccount.setPassword(password);
                   useraccount.setLevel(level);
                   //assign value for ???
                   pstmt3.setInt(1, useraccount.getEmpno());
                   pstmt3.setString(2, useraccount.getUsername());
                   pstmt3.setString(3, useraccount.getPassword());
                   pstmt3.setInt(4, useraccount.getLevel());          
                   if(pstmt3.executeUpdate()==1) create_acc_ok=true;
                   pstmt3.close();
                           //con.close();
                catch(SQLException e2){
                           System.err.println(e2.getMessage());
              return create_acc_ok;
    }here is the bean (part of it)
    package data;               //is it right?
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class UserPassword
         private int empno;
         private String username;
         private String password;
         private int level;
         // Constructor
         public UserPassword()
              this.empno = empno;
              this.username = username;
              this.password = password;
              this.level = level;
         // setters and getters are here.
    //     public boolean verifyEmpno() {
    //               return UserAccManager.verifyEmpno(empno);
    //       public boolean verifyUsername(String username) {
    //            return UserAccManager.verifyUsername(username);
         // These 2 methods not compile with or without para's.So I leave that job for the      
         //controll class UserAccManager.java.
    Now my problem is this: When I submit data, there is an error;org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:8:
    cannot access core.data.UserPassword
    bad class file: C:\Program Files\Apache Group\Tomcat
    4.1\webapps\HRM\WEB-INF\classes\core\data\UserPassword.class
    class file contains wrong class: data.UserPassword
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import core.data.UserPassword;
    ^
    1 error
    Are there any mistakes? If so tell me where is it and how to change them.Please help.

    I try it that way, but it don't compile.
    Error:core\data\UserPassword.java:package javax.servlet does not exist
    import javax.servlet.*;
    core\data\UserPassword.java:package javax.servlet.http does not exist
    import javax.servlet.http.*;
    So,I comment them only in the UserPassword.java file,and compile it again.
    Then it compile well.I goto the directory to get the .class files.
    But there is only UserPassword.class inside the data folder. There is not
    UserAccManager.class in the core folder.
    Then I try this way,I put my 2 java files in to a new folder,
    F:\SystemName\com
    When I try it that way, but it don't compile.
    javac -classpath . -d . com\*.javaError:com\UserPassword.java:package javax.servlet does not exist
    import javax.servlet.*;
    com\UserPassword.java:package javax.servlet.http does not exist
    import javax.servlet.http.*;
    So,I comment them only in the UserPassword.java file,and compile it again.
    Now both are compiling well.There was 2 class files.
    I put them in to the WEB-INF/classes/com directory.
    Start the server.But it gave errors:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
    if(UserPassword.verifyEmpno(empno)){
                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
         if(UserAccManager.verifyUsername(username)){
                                             ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: non-static method
    verifyUsername(java.lang.String) cannot be referenced from a static context
         if(UserAccManager.verifyUsername(username)){
                             ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                       ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable password
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable level
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                         ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: non-static method
    createAcc(int,java.lang.String,java.lang.String,int) cannot be referenced from a static
    context
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                     ^
    8 errorsTo solve the problem non-static method,I goto the UserAccManager.java file and do these
    things.
    package com;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    //import javax.servlet.*;               //otherwise it tells an error.(package           
                                  //javax.servlet does not exist)
    //import javax.servlet.http.*;
    public  class UserAccManager {
       private static final String DRIVER = "com.mysql.jdbc.Driver";
       private static final String URL = "jdbc:mysql://localhost:3306/superfine";
       private static Connection connection;
       private static PreparedStatement pstmt1;
        private static PreparedStatement pstmt2;
          private static PreparedStatement pstmt3;
       private UserAccManager() {
       // Initializes the connection and statements
       private static void initConnection() {
             //same
       // Closes the connection and statements
       // Method to be called by main class when finished with DB
       public static void closeConnection() {
         //same
       public static boolean verifyEmpno(int empno) {
          // same.
       public static boolean verifyUsername(String username) {
         //same.
         public static boolean createAcc(int empno, String username, String password, int      
    level){
              //same
    package com;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    //import javax.servlet.*;
    //import javax.servlet.http.*;
    public class UserPassword {
         // same
    Again compile those files and put .class filses into the WEB-INF/classes/com directory.
    When i submits the data via the form it generates an error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
        [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
    if(UserAccManager.verifyEmpno(empno)){
                                  ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
         if(UserAccManager.verifyUsername(username)){
                                             ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                       ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable password
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable level
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                         ^
    6 errorshere is the CreateAcc.jsp file
    <%@ page language="java" %>
    <%@ page import="com.UserAccManager" %>
    <%@ page import="com.UserPassword" %>
    <jsp:useBean id="userPassword" class="com.UserPassword" scope="request"/>
    <jsp:setProperty name="userPassword" property="*" />
    <%
    String nextPage ="MainForm.jsp";
    if(UserAccManager.verifyEmpno(empno)){
         if(UserAccManager.verifyUsername(username)){
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
          }else{
               nextPage="UserNameExist.jsp";
          else{
              nextPage="UserAccError.jsp";
    %>
    <jsp:forward page="<%=nextPage%>"/>Please, anyone know how to send these parameters to the java file.
    Thanks.

  • How to Generate a Java file for a JSP Page

    Hi ,
    I am using weblogic11 .
    I am working on a JSP page which nearly consists of 4000 lines of code.
    I need to debug the file , but weblogic server is not generating the java file for the JSP pages .
    Please let me know how can i genertae Java file for the jsp pages ??

    JSPs are compiled into servlets automatically and those classes are stored in WEB-INF/classes folder. Servlet engine handles servlets.

  • How to use self-defined class in a jsp page

    Hello:
    I defined a class for displaying purpose, which is in the different folder(WEB-INF/classes) from my JSP page.
    In my JSP page, I want to create an instance of my class and display something, while I get the following error: "
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /htmls/templateIntro.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/templateIntro_jsp.java:72: cannot resolve symbol
    symbol : class Display
    location: class org.apache.jsp.templateIntro_jsp
    Display display=new Display(out);"
    How can I solve this problem? Should I redefine my classpath or there are some other actions I should take.
    T.I.A.
    Oriental Spirit

    Here is what I have done:
    1) in Display.java, add one line "package tools;" on the top, and compile it to
    create Display.class.
    2) create a new folder at
    /home/jiao/jsp_webserver/tomcat/webapps/syllabus/WEB-INF/classes
    named tools and then put the Display.class into the newly created folder.
    3) in my jsp page, add " import="tools.*"
    But it still doesn't work.
    Any ideas? T.I.A.

Maybe you are looking for