JSP & JavaBean: setProperty="*" problems!

this is my bean:
package my.mine;
public class myBean{
  private String sito;
  private String chiave; 
  private int start;
  private int stop;
  public void setSito(String s){
    System.out.println("sito " + s);
    if(s!=null || !s.equals(""))
      sito = s;
    else
      sito = ""; 
  public String getSito(){       
    return sito;
  public void setChiavi(String s){
    System.out.println("chiave " + s);     
    if(s!=null || !s.equals(""))
      chiave = s;
    else
      chiave = ""; 
  public String getChiavi(){       
    return chiave;
  public void setStart(String s){
    System.out.println("start " + s);   
    if(s!=null || !s.equals(""))
      start = Integer.parseInt(s);
    else
      start = 0;       
  public int getStart(){       
    return start;
  public void setStop(String s){
    System.out.println("stop " + s);   
    if(s!=null || !s.equals(""))
      stop = Integer.parseInt(s);
    else
      stop = 0;       
  public int getStop(){       
    return stop;
}this is my JSP Test page:
<jsp:useBean id="testBean" scope="request" class="my.mine.myBean" />
<jsp:setProperty name="testBean" property="*"/>
<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <form method="post" name="myForm" action="Test1.jsp">
    <table>
      <tr>
        <td align="center"> 
          <input type="text" name="start" size="50" maxlength="50" value="10">
          <br>
          <input type="text" name="stop" size="50" maxlength="50" value="20">     
          <br>
          <input type="text" name="chiavi" size="50" maxlength="50" value="chiavi">
          <br>
          <input type="text" name="sito" size="50" maxlength="50" value="sito">
          <br>
          <input type="submit" value="search" name="searchB">                     
        </td>
      </tr>
    </table>
    </form>
  </body>
</html>      and this is my problem:
I can correctely set the values of sito e chiavi fields and can right get all' the bean values. I had tried to change the value of the return statement of getStop ande getStart and this two methods can return the values I assigned them.
The trouble is that I can't set the start and stop variables with the values in the form...does anybody say me why?
I don't understand!

solved in this way:
public void setInizio(int i s[){
  System.out.println("start " + s);     
  start = i;

Similar Messages

  • JSP, Javabean charset problem

    I have some JSP pages where I try to dynamically present some drop-down
    menus for the users to select values. I use a simple bean to manage it.
    The problem is that those values are in non-iso8859-1 charset and I only
    get ?????? rendered in the select box. I define an array (inline in the
    JSP page as code scriptlet), write all possible (String) options for the
    drop-down menu there and in the bean I do some calculations and render
    the drop-down menu.
    String label[]={"something in iso-8859-7 encoding in here","something in
    iso-8859-7 encoding in here","something in iso-8859-7 encoding in here"};
    and in the bean I have a for-loop to access this.
    The page directive is set to iso-8859-7.
    I think there is some kind of transparent translation, that has to do
    with Java language, and after the rendering I only get ???? instead of
    the correct iso-8859-7 value in the browser.
    Any help appreciated.
    (Tomcat, Apache web server, JDK 1.3,)
    PS: This JSP page is used to submit some data in an Oracle database
    (according to the selection of the user in the drop-down box), so I also
    use JDBC 1.3, but I don't think that's relevant at all with my problem...
    null

    I have some JSP pages where I try to dynamically present some drop-down
    menus for the users to select values. I use a simple bean to manage it.
    The problem is that those values are in non-iso8859-1 charset and I only
    get ?????? rendered in the select box. I define an array (inline in the
    JSP page as code scriptlet), write all possible (String) options for the
    drop-down menu there and in the bean I do some calculations and render
    the drop-down menu.
    String label[]={"something in iso-8859-7 encoding in here","something in
    iso-8859-7 encoding in here","something in iso-8859-7 encoding in here"};
    and in the bean I have a for-loop to access this.
    The page directive is set to iso-8859-7.
    I think there is some kind of transparent translation, that has to do
    with Java language, and after the rendering I only get ???? instead of
    the correct iso-8859-7 value in the browser.
    Any help appreciated.
    (Tomcat, Apache web server, JDK 1.3,)
    PS: This JSP page is used to submit some data in an Oracle database
    (according to the selection of the user in the drop-down box), so I also
    use JDBC 1.3, but I don't think that's relevant at all with my problem...
    null

  • JSP usebean setProperty property is not working ??

    I am new to this forum so not sure whether I put my concern in correct category or not.
    I have the following piece of code in my JSP
    <jsp:useBean id="bean" class="com.cdr.settlement.bean.MassUpdateUtilityBean" scope="request">
    <jsp:setProperty name="bean" property="*"/>
    </jsp:useBean>
    <form name="massUpdateForm" id="massUpdateForm" action="massUpdateUtilityAction" method="Post">
    When I try to get the value of bean in my controller (massUpdateUtilityAction) its coming as null (bean value).
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    bean = (MassUpdateUtilityBean)request.getAttribute("bean");
    Any help would be highly appreciated....!!! Thanks

    I want to get the bean values in my controller....!!!
    I am posting my code once again here...!!!
    My jsp Code is:--
    <jsp:useBean id="bean" class="com.cdr.settlement.bean.MassUpdateUtilityBean" scope="request"/>
    <jsp:useBean id="addressBean" class="com.cdr.settlement.bean.AddressBean" scope="request" />
    <form name="massUpdateForm" id="massUpdateForm" action="MassUpdateUtilitySave.jsp" method="Post">
    My controller code is:--
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    bean = (MassUpdateUtilityBean)request.getAttribute("bean");
    bean.getUserName();
    now this bean value is coming null though I am setting all the values of this bean in jsp using setProperty...!!!

  • JSP, JavaBeans and iPlanet 4.1-  Unable to load JavaBean

    I get the following error when trying to access a JavaBean from a JSP page. I have tried just about everything including using the <@page import /> in the JSP page.
    I can get it to run perfectly in Tomcat 3.2 but it must run in iPlanet 4.1. I think the solution should be fairly simple I just can't find it.
    Any help would be greatly appreciated.
    Thanks.
    The exception is as follows (thrown on running the generatePage.jsp linked from index.jsp).
    [29/Nov/2001:16:50:23] info ( 1364): Internal Info: loading servlet /TechCom/generatePage.jsp
    [29/Nov/2001:16:50:23] info ( 1364): JSP: JSP1x compiler threw exception
    org.apache.jasper.JasperException: Unable to load class JspPageLoader
         at org.apache.jasper.compiler.BeanRepository.getBeanType(BeanRepository.java:183)
         at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:97)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:728)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:190)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:159)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:141)
         at com.netscape.server.http.servlet.NSServletEntity.load(NSServletEntity.java:214)
         at com.netscape.server.http.servlet.NSServletEntity.(NSServletEntity.java:104)
         at com.netscape.server.http.servlet.NSServletRunner.loadServlet(NSServletRunner.java:607)
         at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:357)
    [29/Nov/2001:16:50:23] warning ( 1364): Unable to locate class: D:\Netscape\Server4\docs\TechCom (java.lang.ClassNotFoundException: D:\Netscape\Server4\docs\TechCom)
    [29/Nov/2001:16:50:23] warning ( 1364): Internal error: Failed to load servlet (servlet=/TechCom/generatePage.jsp)

    To solve this problem you have to:
    include <@page import /> tags importing the JavaBean to be used.
    In the classpath of iPlanet include the directory in which your JavaBeans are placed.
    Also in the classpath of iPlanet include the root directory of you web site containing the JSP's. this should then solve the problem.

  • Jsp-servlet-bean problem

    Please help!
    I have a servlet controller, a javabean for the data and a jsp for the view.
    I cannot get the jsp using
    <jsp:useBean id="pList" class="bbs.PostListCommand" scope="request" />
    to access the bean data
    However, when I access the bean in this way
    <%@ page import="bbs.PostListCommand" %>
    // html
    <% bbs.PostListCommand postList = null;
    synchronized(session){
         postList = (bbs.PostListCommand) session.getAttribute("PostListCommand");
         if (postList == null){ %>
              <H1>Nothing in request scope to retrieve ....</H1>
              <P>
    <%     }
         else{  %>
              <TABLE border="1">
    // etc
    � it works
    Does anyone know why the <jsp:useBean> tag does not find the bean
    I have installed tomcat 4.18 and set the environmental variables etc.
    Directory structure is
    E:\Tomcat41\webapps\examples\WEB-INF\jsp          for jsp�s
    E:\Tomcat41\webapps\examples\WEB-INF\classes\bbs     for bean and servlets
    Thanks in advance for any help.
    Chris

    GrayMan - Thanks for your help.
    Let me explain my problem in more detail ...
    Background:
    I have some servlet experience, but I am new to jsp - so sorry if this seems trivial to you ...
    I have a book called bitter java by bruce tate from manning.com . I am trying to get the chapter 3 examples to work
    There are three files
    PostListCommand          the bean
    PostListController     the servlet
    PostListResults          jsp
    And a new test file � PostListResults version 2 with scriptlet code to access the bean.
    There are a couple of typos in the downloaded source files, but nothing that causes the main problem of not being able to access the bean data.
    Program flow
    Servlet instantiates new bean
    Bean � gets data from db
    Servlet passes bean to jsp with a forward
    Jsp outputs data
    I have put the files in the directories �
    E:\Tomcat41\webapps\examples\WEB-INF\jsp          for jsp�s
    E:\Tomcat41\webapps\examples\WEB-INF\classes\bbs     for bean and servlets
    The complete source code for each file is given below.
    1 I have checked the db access � that�s ok
    2 I have also checked reading the bean data back in from the request scope and printing out the results from within the servlet.- ok
    3 I can access the data through a scriptlet (PostListResults version 2), but not with the original PostListResults which uses <jsp:useBean>
    thanks in advance, chris
    PostListController.java
    package bbs;
    // Imports
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    // Import for commands used by this class
    import bbs.PostListCommand;
    public class PostListController
    extends javax.servlet.http.HttpServlet
    implements Serializable {
    * DoGet
    * Pass get requests through to PerformTask
    public void doGet(
    HttpServletRequest request,
    HttpServletResponse response)
    throws javax.servlet.ServletException, java.io.IOException {
    performTask(request, response);
    public void performTask(
    HttpServletRequest request,
    HttpServletResponse response) {
    try {
    PostListCommand postList = (bbs.PostListCommand) java.beans.Beans.instantiate(getClass().getClassLoader(),"bbs.PostListCommand");
    postList.initialize();
    postList.execute();
    request.setAttribute("PostListCommand", postList);
    ServletContext sc = this.getServletContext();
    RequestDispatcher rd =
    sc.getRequestDispatcher("/jsp/PostListResults.jsp");
    rd.forward(request, response);
    } catch (Throwable theException) {
    theException.printStackTrace();
    PostListCommand.java
    package bbs;
    import java.io.*;
    import java.sql.*;
    //import COM.ibm.db2.jdbc.*;
    import java.util.*;
    * Insert the type's description here.
    * Creation date: (07/17/2001 5:07:55 PM)
    * @author: Administrator
    public class PostListCommand {
    // Field indexes for command properties     
    private static final int SUBJECT_COLUMN = 1;
    private static final int AUTHOR_COLUMN = 2;
    private static final int BOARD_COLUMN = 3;
    protected Vector author = new Vector();
    protected Vector subject = new Vector();
    protected Vector board = new Vector();
    // SQL result set
    protected ResultSet result;
    protected Connection connection = null;
    * execute
    * This is the work horse method for the command.
    * It will execute the query and get the result set.
    public void execute()
    throws
    java.lang.Exception,
    java.io.IOException {
    try {
    // retrieve data from the database
    Statement statement = connection.createStatement();
    result =
    statement.executeQuery("SELECT subject, author, board from posts");
    while (result.next()) {
    subject.addElement(result.getString(SUBJECT_COLUMN));
    author.addElement(result.getString(AUTHOR_COLUMN));
    board.addElement(result.getString(BOARD_COLUMN));
    result.close();
    statement.close();
    } catch (Throwable theException) {
    theException.printStackTrace();
    * getAuthor
    * This method will get the author property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getAuthor(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) author.elementAt(index);
    * getBoard
    * This method will get the board property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getBoard(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) board.elementAt(index);
    * getSubject
    * This method will get the subject property.
    * Since the SQL statement returns a result set,
    * we will index the result.
    public String getSubject(int index)
    throws
    java.lang.IndexOutOfBoundsException,
    java.lang.ArrayIndexOutOfBoundsException {
    return (String) subject.elementAt(index);
    * initialize
    * This method will connect to the database.
    public void initialize()
    throws java.io.IOException {
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    // URL is jdbc:db2:dbname
    String url = "jdbc:db2:board";
    // URL is jdbc:odbc:bitter3board
    String url = "jdbc:odbc:bitter3board";
    // connect with default id/password
    connection = DriverManager.getConnection(url);
    } catch (Throwable theException) {
    theException.printStackTrace();
    * Insert the method's description here.
    * Creation date: (07/17/2001 11:38:44 PM)
    * @return int
    * @exception java.lang.IndexOutOfBoundsException The exception description.
    public int getSize() {
    return author.size();
    PostListResults.jsp
    <HTML>
    <HEAD>
    <TITLE>Message Board Posts</TITLE>
    </HEAD>
    <BODY BGCOLOR=#C0C0C0>
    <H1>All Messages</H1>
    <P>
    <jsp:useBean id="postList" class="bbs.PostListCommand" scope="request"></jsp:useBean>
    <TABLE border="1">
    <TR>
    <TD>Subject</TD>
    <TD>Author</TD>
    <TD>Board</TD>
    </TR>
    <% for (int i=0; i < postList.getSize(); _i++) { %>
    <TR> <TD><%=postList.getSubject(_i) %></TD>
    <TD><%=postList.getAuthor(_i) %></TD>
    <TD><%=postList.getBoard(_i) %></TD>
    </TR>
    <% } %>
    </TABLE>
    <P>
    </BODY>
    </HTML>
    PostListResults.jsp version 2 � with scriplet code instead of useBean
    <HTML>
    <%@ page import="bbs.PostListCommand" %>
    <!-- This file was generated by the chris -->
    <HEAD>
    <TITLE>Message Board Posts</TITLE>
    </HEAD>
    <BODY BGCOLOR=#C0C0C0>
    <% bbs.PostListCommand postList = null;
    synchronized(request){
         postList = (bbs.PostListCommand) request.getAttribute("PostListCommand");
         if (postList == null){ %>
              <H1>Nothing in request scope to retrieve ....</H1>
              <P>
    <%     }
         else{  %>
              <TABLE border="1">
              <TR>
              <TD>Subject</TD>
              <TD>Author</TD>
              <TD>Board</TD>
              </TR>
         <% for (int i=0; i < postList.getSize(); _i++) { %>
                   <TR> <TD><%=postList.getSubject(_i) %></TD>
              <TD><%=postList.getAuthor(_i) %></TD>
              <TD><%=postList.getBoard(_i) %></TD>
              </TR>
         <% } %>
              </TABLE>
    <%     }
    }%>
    <P>
    goodnight
    </BODY>
    </HTML>

  • Jsp bean:setvalue problem

    i use bean in my jsp page.but the problem is that i didn't get the value.i doubt whether the value actully passed to data.my bean is follows:
    package abc;
    public class hai
    private int a;
    public void sethai(int x)
    a=x;
    public int gethai()
         return a;
    my files are as follows
    1) simple.html
    <html>
    <head>
    </head>
    <body>
    <form action="simple1.jsp" method="post" name="form1" target="_self">
    Number:<input name="num" type="text"><br>
    <input name="sub" type="submit" value="sub"></form>
    </body>
    </html>
    2)simple1.jsp
    <html>
    <head></head>
    <%@ page import="abc.*" errorPage="" %>
    <jsp:useBean id="obj" class="abc.hai" scope="session">
    <jsp:setProperty name="obj" property="*"/>
    </jsp:useBean>
    <% out.println(request.getParameter("num"));%>
    <body>number:
    <jsp:getProperty name="obj" property="hai" />
    </body>
    </html>
    the output i got is the value 0
    pls replay me

    Hi Marty,
    Here is my portalapp.xml file:
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
        <property name="SharingReference" value="htmlb"/>
      </application-config>
      <components>
        <component name="DynPageOne">
          <component-config>
            <property name="ClassName" value="com.mycompany.basicexample.DynPageOne"/>
            <property name="SecurityZone" value="com.mycompany.basicexample.DynPageOne/low_safety"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
            <property name="com.sap.portal.reserved.iview.IsolationMode" value="URL"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    I also created a getter method in my bean to return a static value and that value is returned correctly.  Any more ideas?

  • Newbie jsp/javabean

    Hello,
    I'm trying to do my first web app. First I must log a user from a server database. I thought using JSP to display html pages and javabean to contain logic and functions. In my first page there are a login form with a submit button. How can I call a javabean after pressing button and then read a validate property value from it to login again or pass to next form? To call logic procedures must call setproperty method and do anything inside?
    Thanks,
    Julian.

    You do realize that Java runs on the server don't you? So it you want use java to validate, you would have to do this:
    1) submit username + password to a JSP or servlet
    2) inside that JSP or servlet, read the values from the request and validate them using your bean
    3a) if correct, go on
    3b) if not correct, display error message and show login form again
    How to call the javabean depends on what you are using. If you are using scriptlets, simply call the method as if it were a regular java class. If you are using JSTL, you should read up on that right now because learning that by just coding away is far to difficult. Check out the book you can download for free on this website.
    http://www.coreservlets.com

  • Jsp parameters - url problem

    hello,
    I have a problem with the maximum length of an url.
    I have to submit a parameter (which is a list of elements) from a jsp to a servlet. But, for IE, there's a maximum length of the url and it doesn't allow a such longer parameter (for netscape, it's ok).
    I would like to have a button on my jsp which open another jsp which use the parameter of the first jsp. I have thought to use javabeans but I don't know how to keep a same javabean in several JSPs...
    Can you give me some ideas please ?

    // JSP 1
    <form name=fastaForm action=/EHTDb_interface/servlet/EXHServlet>
    <input type=hidden name=clNames value=<%=clNames%>>
    <!-- clNames is a String of 1 to several hundreds of characters long-->
    </form>
    // SERVLET (/EHTDb_interface/servlet/EXHServlet)
    String clNames = (String) request.getParameter("clNames");
    String redirect = "/result/fasta.jsp";
    Fasta f = new Fasta (clNames);
    request.setAttribute("fasta", f.getFasta());
    RequestDispatcher dispatcher;
    dispatcher=getServletConfig().getServletContext().getRequestDispatcher(redirect);
    dispatcher.forward(request, response);
    //JSP 2
    <% HashMap hmFasta =(HashMap) request.getAttribute ("fasta"); %>

  • JSP + Javabeans

    When i use a javabean in my jsp it doesnt find my class, I need to put anything in web.xml?? Im using Tomcat 4.0
    I have beans.jsp:
    <jsp:useBean id="languageBean" scope="page" class="LanguageBean">
         <jsp:setProperty name="languageBean" property="*"/>
    </jsp:useBean>
    <html>
         <head>
              <title>useBean action test result</title>
    And LanguageBeans.class in web-inf/classes/LanguageBean.class
    what must I put in web.xml?
    Thanks,
    Daniel

    Actually Tomcat can found the three files, but Im getting an error, and I think the code is good, because is an example from a book.
    I have 3 files:
         - beans.html          -->Root
         - beans.jsp     -->Root
              This the first part of the file:
                   <jsp:useBean id="languageBean" scope="page" class="LanguageBean">
                        <jsp:setProperty name="languageBean" property="*"/>
                   </jsp:useBean>
                   <html>
                        <head>
         - LanguageBean.class -->WEB-INF/classes/
    This is the error I'm getting:
    Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 1 in the jsp file: /beans.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\beans$jsp.java:56: Class org.apache.jsp.LanguageBean not found.
    LanguageBean languageBean = null;
    ^
    An error occurred at line: 1 in the jsp file: /beans.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\beans$jsp.java:59: Class org.apache.jsp.LanguageBean not found.
    languageBean= (LanguageBean)
    ^
    An error occurred at line: 1 in the jsp file: /beans.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\beans$jsp.java:64: Class org.apache.jsp.LanguageBean not found.
    languageBean = (LanguageBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "LanguageBean");
    ^
    An error occurred at line: 12 in the jsp file: /beans.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\beans$jsp.java:94: Class org.apache.jsp.LanguageBean not found.
    out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribute("languageBean")).getName())));
    ^
    An error occurred at line: 15 in the jsp file: /beans.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\beans$jsp.java:101: Class org.apache.jsp.LanguageBean not found.
    out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribute("languageBean")).getLanguage())));
    ^
    An error occurred at line: 18 in the jsp file: /beans.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\_\beans$jsp.java:108: Class org.apache.jsp.LanguageBean not found.
    out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribute("languageBean")).getLanguageComments())));
    ^
    6 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:176)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:188)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:536)
    Thanks

  • Strange thing with tomcat+jsp+javabean

    I use javabean in jsp with tomcat container.if I put the javabean file in a package,then it works well.But if I don't, I means,there are no package clause in my javabean file.then it complaint that org.apache.jsp. error:class not found.
    It is very strange.Of course place the class file I put is right.Do anyone encounter the same problem.I use tomcat4.0.4

    Did you import the classfile? Even if it is not there in a package, you need to import it.
    For example, if you have a Test.java (Test.class) in your web-inf\\classes with out any package statement, then you need to code this in your jsp,
    <%@ page import="Test" %> (I don't exactly remember whether you need to import 'Test' or 'Test.class'). Just give a try.
    Sudha

  • Javabean Refresh Problem

    HiHi,
    I have got a problem of refreshing a modified java program.
    I have created a javabean before, there are three fields are defined as float type.
    However, I have got some problem of using float, so I made a change on it to double.
    At the same time, there is a jsp program using this java program. After I compiled the
    java program and put it into the server side (weblogic). I found that there is a probelm
    "NoSuchMethodError" every time when I call the jsp. Then I press space of that jsp
    program and actually made no change of it. And put it into the server
    side again, since there is always a refreshing problem of both java and jsp program
    in weblogic. But I still failed, so I rename both the java and jsp program and try it. Finally the
    same problem still happens.
    So I dunno that it is really a refreshing problem or something I have done wrongly.
    Could anyone help me? Thank you very much!
    Betty

    restart you server and see ...
    when ever you change your javabean you have to restart the server, bcoz the class gets loaded in to the server, once you start it, so, if you change it, it is not going to be changed in the server where the class gets loaded, so, it still has the old copy, so, you have to restart the server for it to reflect the changes ....

  • Error - '.' expected - while database insert thru JSP & javabeans & JDBC

    I get the following error when i try to compile the below mentioned code in JDEVELOPER 10.1.2
    Error : '.' expected
    ===================
    have error in my code. I am trying to do a simple database insert program using javabeans and jsp. I get a value to be inserted in database through the jsp page in a text box and would like to be inserted into database using beans The connection to database and mysql query are in java file.
    Here is the code.
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page language="Java" import="java.sql.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <html>
    <head>
    </head>
    <body>
    <form name="form1" action="beancode" method="POST">
    Emp ID: <input type="text" name ="emplid"> <br><br><br>
    <input type = "submit" value="Submit">
    <jsp:useBean id="sampl" class="beancode" scope="page">
    <jsp:setProperty name="sampl" property="*"/>
    </jsp:useBean>
    </form>
    </body>
    </html>
    I know i might have made a mistake here in using the bean. Here is the java code which does the insert part.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    * @author Trainees
    public class beancode
    private String employid;
    private Connection con = null;
    private ResultSet rs = null;
    private PreparedStatement st = null;
    /** Creates a new instance of beancode */
    public beancode()
    try
              Class.forName("org.gjt.mm.mysql.Driver");
              Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
    catch(Exception e)
              System.out.println(e.getMessage());
    public void setemployid(String empid)
              employid = empid;
         public String getemployid()
              return (employid);
    public void insert()
    try
    String s1="insert into samp values('"+employid+"')";
    st = con.prepareStatement(s1);
    st.executeUpdate();
    st.clearParameters();
    st.close();
    catch(Exception m)
    }

    It's pretty hard to spot any errors the way it's currently formatted. But, you're trying to call the beancode when submitting your form, but the beancode isn't a servlet. Try to find a working example, run it, and then change it to implement your requirements.
    The following example shows you have to use the jstl sql tags: http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jsps/jstlsql.html. If you want to do an insert when a user submits a form, you need 2 pages. The first will contain your form, the second will insert the record.
    (once you've got that running, look for some examples using an mvc framework, and how to use bind variables with jdbc)

  • Repost, since no answer in JSP-JSP/CascadingStyleSheet/Javascript problem

    Hello, I've got a JSP page that has included a Javascript (JS).
    In that JS, a Cascading Style Sheet (CSS) is included. Also on the JSP page, I have some code that makes use of the JS to create a Windows-style combobox, which is not available through raw HTML. The code is as follows:
    <BODY>
    <SCRIPT language="javascript" src="ComboBox.js"></SCRIPT>
    <SCRIPT language="javascript">
    dm=new ComboBox("dm")
    dm.add(
           new ComboBoxItem("barge",1),
           new ComboBoxItem("benluc",2),
           new ComboBoxItem("benlieeeeck",3),
           new ComboBoxItem("taco",4)
    </SCRIPT>
    <CENTER><H2>Choose Project S/O</H2><CENTER>
    <FORM METHOD=POST ACTION="">
    <% //DB connection to populate the combo box %>
    <% // Database Connection Parameters
        String DB = "dbname",
        query = "",
        HOST = "jdbc:postgresql://URL:5432/",
        ACCOUNT = "username",
        PASSWORD = "pwd",
        DRIVER = "org.postgresql.Driver";
        // authentication properties
        Properties props = new Properties();
        props.setProperty("user", ACCOUNT);
        props.setProperty("password", PASSWORD);
        // load driver and prepare to access
        Class.forName(DRIVER).newInstance();
        Connection con = DriverManager.getConnection(HOST + DB, props);
        Statement stmt = con.createStatement();
        try{
        query= "SELECT * FROM Projects ORDER BY Name";
        ResultSet rs = stmt.executeQuery(query);
    %>
    Project S/O:
    <SELECT NAME=projso>
    <option value="dummy">Choose one...</option>
    <% while (rs.next() ) { %>
    <OPTION VALUE="<%=rs.getString("Name") %>">
    <%=rs.getString("Name")%> ,   <%=rs.getString("Desc")%>
    </OPTION>
    <% } %>
    </SELECT>The problem I am experiencing is that if I move the 2nd SCRIPT tag anywhere but where it is, it makes IE bomb and takes me to an error page. The error message is as follows:
    "Internet Explorer cannot open site http://myURL. Operation aborted."
    Any ideas?
    Haig

    I tried making it static HTML with the same result.
    I took out all the JSP code before doing so, obviously.
    I think it has to do with my code and the HTML FORM tag.
    Anyway, here's the requested code, ComboBox.js
    *     ComboBox
    *     By Jared Nuzzolillo
    *     Updated by Erik Arvidsson
    *     http://webfx.eae.net/contact.html#erik
    *     2002-06-13     Fixed Mozilla support and improved build performance
    Global_run_event_hook = true;
    Global_combo_array    = new Array();
    Array.prototype.remove=function(dx)
        if(isNaN(dx)||dx>this.length){self.status='Array_remove:invalid request-'+dx;return false}
        for(var i=0,n=0;i<this.length;i++)
            if(this!=this[dx])
    this[n++]=this[i]
    this.length-=1
    function ComboBox_make()
    var bt,nm;
    nm = this.name+"txt";
    this.txtview = document.createElement("INPUT")
    this.txtview.type = "text";
    this.txtview.name = nm;
    this.txtview.id = nm;
    this.txtview.className = "combo-input"
    this.view.appendChild(this.txtview);
    this.valcon = document.createElement("INPUT");
    this.valcon.type = "hidden";
    this.view.appendChild(this.valcon)
    var tmp = document.createElement("IMG");
    tmp.src = "___";
    tmp.style.width = "1px";
    tmp.style.height = "0";
    this.view.appendChild(tmp);
    var tmp = document.createElement("BUTTON");
    tmp.appendChild(document.createTextNode(6));
    tmp.className = "combo-button";
         this.view.appendChild(tmp);
         tmp.onfocus = function () { this.blur(); };
         tmp.onclick = new Function ("", this.name + ".toggle()");
    function ComboBox_choose(realval,txtval)
    this.value = realval;
    var samstring = this.name+".view.childNodes[0].value='"+txtval+"'"
    window.setTimeout(samstring,1)
    this.valcon.value = realval;
    function ComboBox_mouseDown(e)
    var obj,len,el,i;
    el = e.target ? e.target : e.srcElement;
    while (el.nodeType != 1) el = el.parentNode;
    var elcl = el.className;
    if(elcl.indexOf("combo-")!=0)
    len=Global_combo_array.length
    for(i=0;i<len;i++)
    curobj = Global_combo_array[i]
    if(curobj.opslist)
    curobj.opslist.style.display='none'
    function ComboBox_handleKey(e)
    var key,obj,eobj,el,strname;
    eobj = e;
    key = eobj.keyCode;
    el = e.target ? e.target : e.srcElement;
    while (el.nodeType != 1) el = el.parentNode;
    elcl = el.className
    if(elcl.indexOf("combo-")==0)
    if(elcl.split("-")[1]=="input")
    strname = el.id.split("txt")[0]
    obj = window[strname];
    obj.expops.length=0
    obj.update();
    obj.build(obj.expops);
    if(obj.expops.length==1&&obj.expops[0].text=="(No matches)"){}//empty
    else{obj.opslist.style.display='block';}
    obj.value = el.value;
    obj.valcon.value = el.value;
    function ComboBox_update()
    var opart,astr,alen,opln,i,boo;
    boo=false;
    opln = this.options.length
    astr = this.txtview.value.toLowerCase();
    alen = astr.length
    if(alen==0)
    for(i=0;i<opln;i++)
    this.expops[this.expops.length]=this.options[i];boo=true;
    else
    for(i=0;i<opln;i++)
    opart=this.options[i].text.toLowerCase().substring(0,alen)
    if(astr==opart)
    this.expops[this.expops.length]=this.options[i];boo=true;
    if(!boo){this.expops[0]=new ComboBoxItem("(No matches)","")}
    function ComboBox_remove(index)
    this.options.remove(index)
    function ComboBox_add()
    var i,arglen;
    arglen=arguments.length
    for(i=0;i<arglen;i++)
    this.options[this.options.length]=arguments[i]
    function ComboBox_build(arr)
    var str,arrlen
    arrlen=arr.length;
    str = '<table class="combo-list-width" cellpadding=0 cellspacing=0>';
    var strs = new Array(arrlen);
    for(var i=0;i<arrlen;i++)
    strs[i] = '<tr>' +
                   '<td class="combo-item" onClick="'+this.name+'.choose(\''+arr[i].value+'\',\''+arr[i].text+'\');'+this.name+'.opslist.style.display=\'none\';"' +
                   'onMouseOver="this.className=\'combo-hilite\';" onMouseOut="this.className=\'combo-item\'" > '+arr[i].text+' </td>' +
                   '</tr>';
    str = str + strs.join("") + '</table>'
    if(this.opslist){this.view.removeChild(this.opslist);}
    this.opslist = document.createElement("DIV")
    this.opslist.innerHTML=str;
    this.opslist.style.display='none';
    this.opslist.className = "combo-list";
    this.opslist.onselectstart=returnFalse;
    this.view.appendChild(this.opslist);
    function ComboBox_toggle()
    if(this.opslist)
    if(this.opslist.style.display=="block")
    this.opslist.style.display="none"
    else
    this.update();
    this.build(this.options);
    this.view.style.zIndex = ++ComboBox.prototype.COMBOBOXZINDEX
    this.opslist.style.display="block"
    else
    this.update();
    this.build(this.options);
    this.view.style.zIndex = ++ComboBox.prototype.COMBOBOXZINDEX
    this.opslist.style.display="block"
    function ComboBox()
    if(arguments.length==0)
    self.status="ComboBox invalid - no name arg"
    this.name = arguments[0];
    this.par = arguments[1]||document.body
    this.view = document.createElement("DIV");
    this.view.style.position='absolute';
    this.options = new Array();
    this.expops = new Array();
    this.value = ""
    this.build = ComboBox_build
    this.make = ComboBox_make;
    this.choose = ComboBox_choose;
    this.add = ComboBox_add;
    this.toggle = ComboBox_toggle;
    this.update = ComboBox_update;
    this.remove = ComboBox_remove;
    this.make()
    this.txtview = this.view.childNodes[0]
    this.valcon = this.view.childNodes[1]
    this.par.appendChild(this.view)
    Global_combo_array[Global_combo_array.length]=this;
    if(Global_run_event_hook){ComboBox_init()}
    ComboBox.prototype.COMBOBOXZINDEX = 1000 //change this if you must
    function ComboBox_init()
         if (document.addEventListener) {
              document.addEventListener("keyup", ComboBox_handleKey, false );
              document.addEventListener("mousedown", ComboBox_mouseDown, false );
         else if (document.attachEvent) {
              document.attachEvent("onkeyup", function () { ComboBox_handleKey(window.event); } );
              document.attachEvent("onmousedown", function () { ComboBox_mouseDown(window.event); } );
    Global_run_event_hook = false;
    function returnFalse(){return false}
    function ComboBoxItem(text,value)
    this.text = text;
    this.value = value;
    document.write('<link rel="STYLESHEET" type="text/css" href="ComboBox.css">');
    If you would like me to post the code for the CSS, let me know.

  • Tomcat 4.0.x and JSP / JSTL performance problems.

    Hello everyone,
    I've got a web application where some of my JSP pages are rendering quite slowly. As an example I'll use a JSP page that I wrote for browsing through a user database. It uses two beans...
    1. jobBean - Ensures that all of the required (and correct) beans that will be used for processing the request have been loaded.
    2. browserBean - A basic JavaBean that holds a set of UserBean(s) and other information pertinent to database queries (start, limit, order).
    I'm using Apache Struts to map requests to the appropriate processing modules. Now the problem I'm having is that each request is taking between 1 and 2 seconds to execute. As you can imagine that's not going to allow for very many simaltaneous users. I've tracked the problem down to something JSP related. All of my code executes fairly quickly (I think). It takes about 20-30ms for my code to identify the request, load the requested data from the database, and convert it into a usable format (the browserBean). Here's my code...
    <%@ page contentType="text/html"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META http-equiv="Cache-Control" content="no-cache">
    <title>
    Browse Users
    </title>
    </head>
    <body>
    <!-- Set up the OrganizationBeans for use -->
    <jsp:useBean id="jobBean" class="com.vacode.jobs.generic.JobBean" scope="session" />
    <jsp:useBean id="browserBean" class="com.vacode.mqdb.beansets.user.UserBrowserBean" scope="session" />
    <!---------------------------->
    <!-- Start Time Logged Here -->
    <!---------------------------->
    <c:if test="${jobBean.currentJob.name != 'BrowseUserJob'}">
         <!-- This page was accessed before everything was properly initialized -->
         <c:url var="browseUser" value="manageUsers.do">
              <c:param name="action" value="browse" />
         </c:url>
         <c:redirect url="${browseUser}" />
    </c:if>
    <form action="manageUsers.do" method="get">
         <input type="hidden" name="action" value="browse">
         <input type="hidden" name="start" value="<c:out value="${browserBean.dummyStart}" />">
         <input type="hidden" name="order" value="<c:out value="${browserBean.order}" />">
         I would like to view
         <select name="limit">
              <c:forEach begin="1" end="5" var="current">
                   <option value="<c:out value="${current*5}" />"
                        <c:if test="${browserBean.dummyLimit == current*5}">
                        selected
                        </c:if>
                   >
                    <c:out value="${current*5}" />
                   </option>
              </c:forEach>
         </select>
         results per page.
         <input type="submit" action="submit">
    </form>
    <c:url var="id" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_ID" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="name" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="firstName" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_FIRST_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="lastName" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_LAST_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="email" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_EMAIL_ADDRESS" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="organization" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_ORGANIZATION_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="status" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="USER_STATUS_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <c:url var="role" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="0" />
         <c:param name="order" value="ROLE_NAME" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
    </c:url>
    <table>
         <tr>
              <td><a href="<c:out value="${id}" />">Id</a></td>
              <td><a href="<c:out value="${name}" />">User Name</a></td>
              <td><a href="<c:out value="${firstName}" />">First Name</a></td>
              <td><a href="<c:out value="${lastName}" />">Last Name</a></td>
              <td><a href="<c:out value="${email}" />">E-Mail</a></td>
              <td><a href="<c:out value="${organization}" />">Organization</a></td>
              <td><a href="<c:out value="${status}" />">Status</a></td>
              <td><a href="<c:out value="${role}" />">User Type</a></td>
         </tr>
    <c:forEach items="${browserBean.beans}" var="bean">
         <tr>
              <c:url var="manage" value="manageUsers.do">
                   <c:param name="action" value="modify" />
                   <c:param name="beanId" value="${bean.userId}" />
              </c:url>
              <td><a href="<c:out value="${manage}" />"><c:out value="${bean.userId}" /></a></td>
              <td><c:out value="${bean.userName}" /></td>
              <td><c:out value="${bean.firstName}" /></td>
              <td><c:out value="${bean.firstName}" /></td>
              <td><c:out value="${bean.email}" /></td>
              <td><c:out value="${bean.organizationName}" /></td>
              <td><c:out value="${bean.statusName}" /></td>
              <td><c:out value="${bean.roleName}" /></td>
         </tr>
    </c:forEach>
    <!-------------------------->
    <!-- End Time Logged Here -->
    <!-------------------------->
    </table>
    <c:url var="next" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="${browserBean.nextPageStart}" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
         <c:param name="order" value="${browserBean.order}" />
    </c:url>
    <c:url var="previous" value="manageUsers.do">
         <c:param name="action" value="browse" />
         <c:param name="start" value="${browserBean.previousPageStart}" />
         <c:param name="limit" value="${browserBean.dummyLimit}" />
         <c:param name="order" value="${browserBean.order}" />
    </c:url>
    <c:if test="${browserBean.previousPageStart>-1}">
         <a href="<c:out value="${previous}" escapeXml="false" />">previous</a>
    </c:if>
    <c:if test="${browserBean.nextPageStart>-1}">
         <a href="<c:out value="${next}" escapeXml="false" />">next</a>
    </c:if>
    <br>
    <br>
    Quick Jump To Page:
    <c:forEach varStatus="loopTag" items="${browserBean.pageStartValues}" var="current">
    <c:choose>
         <c:when test="${loopTag.index+1==browserBean.currentPageNumber}">
              <c:out value="${loopTag.index+1}" />
         </c:when>
         <c:otherwise>
         <c:url var="thisPage" value="manageUsers.do">
              <c:param name="action" value="browse" />
              <c:param name="start" value="${current}" />
              <c:param name="limit" value="${browserBean.dummyLimit}" />
              <c:param name="order" value="${browserBean.order}" />
         </c:url>
         <a href="<c:out value="${thisPage}" />"><c:out value="${loopTag.index+1}" /></a>
         </c:otherwise>
    </c:choose>
    </c:forEach>
    <br>
    <br>
    Max Possible Pages: <c:out value="${browserBean.maxNumberOfPages}" />
    <br>
    Current Page: <c:out value="${browserBean.currentPageNumber}" />
    </body>
    </html>I've added comments where I timed my code from (by writing new Date().getTime() to the console). It usually takes between 1 and 2 seconds for that block of JSP to execute. I wrote a test class that should be very similar to the process (iterating over the forEach loop mainly) and it usually executed in 10ms to 20ms.
    I had a look at the servlets that were generated by Tomcat and I noticed that for each <c:url> I used there's about 300 lines of code (with several syncronized() methods). Could this have anything to do with it? If so, what could I do to improve the performance?
    Worth mentioning... The machine I am using is an AMD Athlon 1GHZ with 768MB RAM, 7200 RPM UDMA100 IDE HDD.
    I'm also using Tomcat integrated with a development environment (IntelliJ IDEA).
    Any help that anyone could offer is much appreciated.
    Thanks,
    Ryan

    Can you get acceptable performance if you hack out everything except the browserBean forEach loop? Maybe you are trying to do too much runtime EL evaluation on the page.
    If performance improves, you may want to push the URL construction and startValue computations to a Struts Action and put a bunch of objects on the requestScope (like "id_url", "name_url", "pageStartValue").
    Putting these computations in the Action would avoid having JSTL parse each of the ${} arguments, evaluating the expressions, and using costly reflection to turn ${browserBean.order} into browserBean.getOrder().

  • JSP import statement problem

    Hey, I got confused with all import statement with jsp.
    Here is my problem.
    Folder structure:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\webapps\ROOT\WEB\S\A
    This folder contains a.jsp.
    JSP code:
    <%@ page
         language="java"
         import="java.sql.*, MyPackage.DataBase"
         errorPage=". . ."
         contentType="text/html; charset=windows-1251"
    %>
    <%
           Connection connection = null;
         Statement statement = null;
           DataBase dataBase = new DataBase( connection, statement );
    %>
    ...Error message that I get:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\work\Catalina\localhost\_\org\apache\jsp\WEB\S\A\a_jsp.java:7: package MyPackage does not exist
    import MyPackage.DataBase;
                       ^
    An error occurred at line: 104 in the jsp file: /WEB/S/A/a.jsp
    Generated servlet error:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\work\Catalina\localhost\_\org\apache\jsp\WEB\S\A\a100_jsp.java:147: cannot resolve symbol
    symbol  : class DataBase
    location: class org.apache.jsp.WEB.S.A.a_jsp
           DataBase dataBase = new DataBase( connection, statement );
            ^
    ...How do I import that class so I can use it?
    Do I need to use useBean?
    What do I need to do?
    Thanks

    DataBase class does not extend java.sql.
    I put this into my jsp page
         import="java.sql.*;"
         import="MyPackage.DataBase;" Here is the error message
    Generated servlet error:
    C:\Program Files\netbeans-4.1\enterprise1\jakarta-tomcat-5.5.7\work\Catalina\localhost\_\org\apache\jsp\WEB\S\A\a_jsp.java:7: 'class' or 'interface' expected
    import MyPackage.DataBase;;
    ^
    1 error
    ...

Maybe you are looking for

  • Is there a way to import a Power Point presentation without adding click boxes?

    I want the user to navigate through the Power Point portion of my training by hitting one of two buttons.  Unfortunatley, in order for me to restrict the users options to these possibilities, I have to delete every click box from the slide that is ad

  • I cant download itunes on my laptop

    Help I cant download itunes and just bought an ipad that i cant use because I need to sync my iphone through my laptop to my ipad

  • Top Tip #4 - How to use Search in the community

    Why should I use the search in the community? It’s a quick and easy way to get help with your problem – other people may have had the same or similar issue in the past, so if you can use search to find the answer then you will save yourself time wait

  • Cenvat reversal

    Hi, I want to do reversal of cenvat utilization; how is it possible? regards, Shruti

  • RESTORE_VIEW call 2 times

    I am using Jdeveloper and I created PhaseListener as follow: public class PageLoadListener implements PhaseListener { public void afterPhase(PhaseEvent phaseEvent) { System.out.println("after phase"); public void beforePhase(PhaseEvent phaseEvent) {