Help with JSP/Weblogic/Tomcat Discrepencies

Hi,
          I have something very strange happening. I recently did some JSP stuff on
          WLS60SP1 and all went quite well. I then took those same JSP pages and tried
          them out on the latest release of TOMCAT. I was really impressed that
          everything seemed to be completely transparent and working just fine until
          the following situation:
          When I reference, within a JSP page, an object that has previously been
          added to the request scope that has just been created, but not messed with
          in anyway...meaning all the attributes in this bean have their default
          values set...and they are all Strings with the exception of one Integer
          using this format:
          <%= custVal.getCustomerNumber() %>
          - In WLS, what shows in the text field on the form is nothing, because
          customer number in the custVal object is null (default for a String)..this
          is what I want.
          - In Tomcat, what shows it the word "null".
          ...here is the weird part, by changing from scriptlet references to the
          <jsp:getProperty....> format such as....
          <jsp:getProperty name="custVal" property="customerNumber"/>
          -In WLS, he is still a happy camper and works just fine regardless of how I
          reference the bean
          -In Tomcat, I also get the correct results that I want.
          So, unlike most postings, I found out how to fix it but I would like to know
          why...any ideas?
          Thanks in advance,
          Paul Reed
          www.jacksonreed.com
          object training and mentoring
          Jackson-Reed, Inc. 888-598-8615
          www.jacksonreed.com
          Author of "Developing Applications with Visual Basic and UML"
          http://www.amazon.com/exec/obidos/ASIN/0201615797/jackreedinc/104-0083168-31
          95939
          Author of "Developing Applications with Java
          

          Try http://localhost:7001/HelloWorld.jsp
          "b. patel" <[email protected]> wrote:
          >
          >I need help with running a simple JSP. I created a WLS domain using the
          >WebLogic
          >Configuration Wizard. I am trying to access HelloWorld.jsp which is
          >located under
          >C:\bea\user_projects\wlsdomainex\applications\DefaultWebApp.
          >I type
          >http://localhost:7001/DefaultWebApp/HelloWorld.jsp. I get 404 - Page
          >Not Found
          >Error. The weblogic server starts Succesfully. I am trying this in Win
          >2K environment.
          >
          >I am new to WebLogic. Thanks for your Help in advance.
          >
          

Similar Messages

  • What  kind of classes I can use with JSP in tomcat? Please Help

    Hi people, I tried use the classes that I did for others application and it throw this exception :
    "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
    D:\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\matriculaOnLine\valide_jsp.java:14: cannot access matriculaOnLine.Connect
    bad class file: D:\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes\matriculaOnLine\Connect.class
    class file contains wrong class: Conexao
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    private Connect conn = new Connect(driver,url,login,password);
    ^
    1 error"
    I used the Connect class with java apps and it work but with JSP on TomCat4.1.27
    Can someone help me, please?
    Tiago - [email protected]

    Hi Tiago,
    I have some problems in my mind.
    Which databse you are using? and Which database driver you are using for connecting database?
    Also can you please give a code snapet that you written for connecting databse?
    ----------Milind

  • URGENT help with JSP

    Any help with this will be really appreciated. I'm new to programming.
    If I search for an ssn in a database, I want to view all records relating to that ssn. However, I am getting all the records in the table.
    eg.
    at the prompt for ssn, let's say I enter 111111111
    I would like to see
    111111111 abc xyz etc
    111111111 pdg ppp etc
    however, I am getting
    000000000 utt tui etc
    111111111 tug etg etc
    How do I make limit the search to the ssn I want?
    The related code is below.
    Thanks.
    Java Code
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    if (checkLoginSessionPresent(request, response)) {
    loadTable("/esoladm/TaxView.jsp", request, response);
    else {
    checkLoginSessionRedirect("/esoladm/ESOLAdminMain.jsp", request, response);
    JSP Code
    <% while (MyTaxSuppress != null) { %>             
    <% String sPlanCode = MyTaxSuppress.getPlanCode(); %>
    <% String sSSN = MyTaxSuppress.getSSN(); %>
    <% String sTaxYear = MyTaxSuppress.getTaxYear(); %>
    <% String sDistCode = MyTaxSuppress.getDistCode(); %>
    <% double sGrAmount = MyTaxSuppress.getGrAmount(); %>
    <% String sStmtType = MyTaxSuppress.getStmtType(); %>
    <% boolean bNewSuppress = MyTaxSuppress.getNewSuppress(); %>
    <% String rowID = sPlanCode; %>
    <% rowID += sSSN; %>
    <% rowID += sTaxYear; %>
    <% rowID += sDistCode; %>
    <% rowID += sStmtType; %>
    <% rowID += sGrAmount; %>
    <% System.out.println( "Do While lp exiti" + rowID);%
    <% if (bNewSuppress) { %>
    <% out.println( "<TD> %>
    <% <img BORDER='0' SRC='/esoladm/ESOLNew2.gif' %>
    <% ALT='' WIDTH='50' HEIGHT='20'> </TD >"); %>
    <% } else { %>
    <% out.println( "<TD></TD>"); %>
    <% } %>
    <TD><%= sPlanCode %></TD>
    <TD><%= sSSN %></TD>
    <TD><%= sTaxYear %></TD>
    <TD><%= sDistCode %></TD>
    <TD><%= sGrAmount %></TD>
    <TD><%= sStmyType %></TD>
    <TD><input TYPE="checkbox" name="<%=rowID %>" ></TD>
    <% MyTaxSuppress = MySuppressTaxList.getNext(); %>
    <% } // end of while loop %>

    I don't see anywhere in your code where you conditionally output a tuple from your database. You seem to be outputting everything.
    Maybe you need:
    <% if (sSSN==input_value){ %>
    <TD><input TYPE="checkbox" name="<%=rowID %>" ></TD>
    <% } %>

  • Help with JSP and logic:iterate

    I have some queries hope someone can help me.
    I have a jsp page call request.jsp:
    ====================================
    <%@ page import="java.util.*" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html>
    <body>
       <%@ page import="RequestData" %>
       <jsp:useBean id="RD" class="RequestData" />
       <%Iterator data = (Iterator)request.getAttribute("Data");%>
       <logic:iterate id="element" name="RD" collection="<%=data%>">
          <jsp:getProperty name="RD" property="requestID" />
          <%=element%><br>
       </logic:iterate>
    </body>
    </html>
    And I have the RequestData.java file:
    ======================================
    private int requestID = 1234;
    public int getRequestID() { return requestID; }
    The jsp page display:
    ======================
    0 RequestData@590510
    0 RequestData@5b6d00
    0 RequestData@514f7f
    0 RequestData@3a5a9c
    0 RequestData@12d7ae
    0 RequestData@e1666
    Seems like the requestID is not returned. Does anybody know this?
    I have done the exact one using JSP and servlets, trying to learn using JSP and custom tags. The one with JSP and servlet looks like:
    ============================================
    <%@ page import="RequestData" %>
    <%Iterator data = (Iterator)request.getAttribute("Data");
    while (data.hasNext()) {
       RequestData RD = (RequestData)data.next();
       out.println(RD.getRequestID() );
    }%>

    Oh think I got it...
    but one thing I'm not sure is...
    If I use "<jsp:useBean id="RD" class="RequestData" />", do I still need "<%@ page import="RequestData" %>"?
    I tried without and it gives me error...

  • Help with jsp beans

    Hi ,
    I'm new to beans .Please help me on this. I have 2 jsp pages -trial.jsp and trial2.jsp and a bean class-UserInfo.java
    I'm setting the bean values from trial.jsp and trying to retrieve from trial2.jsp. But the values are coming as null. Can you please help me on this.
    Code of Trial.jsp
    <html>
    <body>
    <form name="beanTest" method="get" action="trial2.jsp">
    <table width="60%">
      <tr>
        <td width="44%">Name</td>
        <td width="56%"><label>
          <input type="text" name="name" id="name">
        </label></td>
      </tr>
      <tr>
        <td>Age</td>
        <td><input type="text" name="age" id="age"></td>
      </tr>
      <tr>
        <td>Occupation</td>
        <td><input type="text" name="occupation" id="occupation"></td>
      </tr>
      <tr>
        <td><label>                
        <jsp:useBean id="person" class="javaUtil.UserInfo" scope="request"/>
    <jsp:setProperty property="*" name="person"/>
    <input type="submit" value="Test the Bean">
    </form>
    </body>
    </html>
    Trial2.jsp
    <form>
    <jsp:useBean id="person" class="javaUtil.UserInfo" scope="request"/>
    Name<jsp:getProperty property="name" name="person"/><br>
    age:<jsp:getProperty property="age" name="person"/><br>
    job:<jsp:getProperty property="occupation" name="person"/><br>
    </form>
    UserInfo.java
    package javaUtil;
    import java.io.Serializable;
    public class UserInfo implements Serializable{
         private static final long serialVersionUID = 1L;
         private String name;
         private int age;
         private String occupation;
         public String getName()
              return this.name;
         public void setName(String name)
              this.name=name;
         public int getAge()
              return this.age;
         public void setAge(int age)
              this.age=age;
         public String getOccupation()
              return this.occupation;
         public void setOccupation(String occupation)
              this.occupation=occupation;
    Please help me.....

    Actually you're probably off on a false trail with jsp:useBean. The more up to date methods use tag libraries (typically JSTL) and access bean attributes using EL, bean expression language. E.g. you put your initial form data into a request attribute called "data" and you put:
    <input type="text" name="property1" value="${data.property1}" ....useBean is no use for binding returned fields from a form. Always remember that your JSP generates HTML and once that HTML is sent to the browser that's it, the JSP has done it's job and finished. Only with JSF, at present, does what you write in your JSP affect the processing of received form data. When you get the form data back you need to "bind" the values from the request back to the bean. A framework like Spring will do this stuff for you, but in a raw Servlet/JSP environment it's up to you.

  • Help with JSP Forward !!!

    I have 3 pages ...1) index.jsp 2) Forward.jsp 3) welcome.jsp
    I have 2 fields in the index.jsp once upon filling & hit submit it has to to go Forward.jsp page...in the Forward.jsp..i have coded only one tag with
    <jsp:forward page="welcome.jsp" />
    I have one question...once the page comes to Forward page...will it display the contents of the Welcome .jsp in the same page itself...or it will go to Welcome.jsp page..
    As i saw it will display the contents of Welcome.jsp page in itself...
    Please let me know...
    Regards
    Gnanesh

    I understand your question only because I have a set up totally identical to yours. The thread Matt suggested does explain the situation (i.e. the server passed control to another page but the client doesn't know that), but doesn't necessarily give a good solution a problem that you may have, and that I do have:
    If the user sees the welcome page, and for some reason decides to "reload", the forward page is re-executed, even though it has done its job. This could be a problem for session management if you specifically don't want that job being done twice in a session. Now you could hack around that, but I'd really rather see a neat solution. Is there one?

  • Help with jsp and javaBean in eclipse/Tomcat

    Hi,
    I am new to JSP and JavaBean. I am going through tutorial for a jsp page that uses a javaBean. I am using eclipse to create jsp page and the java bean.
    My eclipse project "Date" has five package as under:-
    1. Deployment Descriptor
    2. Java Resources: src
    3. build
    4. WebContent
    I have my data.jsp page in WebContent/WEB-INF/ folder. When I just run date.jsp in a browser as: http://localhost:8080/Date/date.jsp, it gets launched into the browser correctly. But when I add a JavaBean "TimeFormatterBean.java" in the Java Resources:src folder and use it in date.jsp page, I get errors as under:-
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 5 in the jsp file: /date.jsp
    TimeFormatterBean cannot be resolved to a type
    2: pageEncoding="ISO-8859-1"%>
    3: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    4:
    5: <jsp:useBean id="formatter" class="TimeFormatterBean"/>
    6:
    7: <html>
    8: <head>
    The data.jsp page is as under:-
    <jsp:useBean id="formatter" class="TimeFormatterBean"/>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
         <h1> Date JSP </h1>
         <p> The  current time is:
         <%= new java.util.Date() %>
         <jsp:getProperty name="formatter" property="name"/>
         </p>
    </body>
    </html>I can see "TimeFormatterBean.class" in build/classes folder.
    If anyone could please help me out with this, it would be very helpful
    Thanks a lot!

    You probably should place TimeFormatterBean inside a package, or maybe you could try importing it , even if it�s in the default package, with something like this <%@ page import="TimeFormatterBean" %> at the top

  • Help with jsp session validation

    i've build up a page that only users wil 'administrator' as the session is variable can access. if they don't they will be directed to the login page.
    However, I'm getting a null pointer exception.
    my code is as follows:
    <%@ page import="java.io.*"%>
    <%
         if (session.getAttribute("id").equals(null) || !(session.getAttribute("id").equals("administrator")))
              response.sendRedirect("adminlogin.htm");
    %>
    Error Message:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
    root cause
    java.lang.NullPointerException
    any pros please help? i know it's something to do with my jsp session validation. thanks in advance.

    one more thing, with regrads to the solution evnafets provided. I tried it out on all my pages that requires administrator rights and found that the code only redirects when it's not expecting any parameters. Else, it just display an error message there. Is there a way around this? Or I should let let my end user suffer?
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         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:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:534)
    root cause
    java.lang.NullPointerException
         at org.apache.jsp.view_jsp._jspService(view_jsp.java:177)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         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:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:534)

  • Help with JSP:GetProperty Tag

    Howdy all,
    I have a
    <jsp:getProperty name='input' property='code01'/>
    tag and would like to be able to put a variable in the property field so that I can increment from code01 to code02 to code 03 by concatenating strings
    Is this possible?

    Thanks for your input on the forum, but I tried with no sucess to put it into action:
    <% String colname="code02"; %>
    <jsp:getProperty name='Input' property='<%=colname%>' />
    Produced this:
    Internal Servlet Error:
    org.apache.jasper.JasperException: Cannot find any information on property '' in a bean of type 'com.infomed.InputBean'
         at org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:616)
         at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:101)
         at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(JspParseEventListener.java:771)
         at org.apache.jasper.compiler.JspParseEventListener.generateAll(JspParseEventListener.java:220)
         at org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseEventListener.java:175)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
         at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
         at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Any Help you can give would be greatly appreciated, what I need to do is cycle through code01, code02....code15
    and use the string to do it, but use a counter integer to create the string, ie..'code0' + i and then use the sting to access
    on of the member properties in the been...(Code01, Code02) ertc.

  • Help with jsp and servlets(litterature)

    I'm planning on converting a asp website to jsp and I need to figure out the following:
    1: servlet that gives out connection objects from a pool and manages "lost" connections to a mysql db
    2: a bean that has getConnection and closeConnection that is used on every jsp page.
    3: servlet/bean that can check size/dimesions/filetype on a remote url image
    4: Figure out what users are logged in at every given moment. result: x users are on, these are user1, user2, user3. automatic removal when session runs out. probably need a servlet for this.
    I got these books:
    deitel java how to program 3rd edition
    deitel advanced java 2 platform how to program
    The last book has a servlet and jsp section ut I suspect that java has evolved since then so thats why I'm asking if you have any other suggestions that offer more than 2 chapters. Its really basic the stuff i have :)
    Its been 3 years since I've touched java so i hope you guys can recomend jsp/servlet books that can answer these questions for me and help me get started with this project?
    Thanks :)

    1. apache dbcp commons library.
    http://jakarta.apache.org/commons/dbcp/
    2. tomcat DataSource, which already has the dbpc logic incorporated into it.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    3. no idea, google may help
    4. HttpSessionBindingListener. This allows you to monitor when a bean (such as a User bean) is added to the session and when it is removed from the session. This way you can track yourself which users are online.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionBindingListener.html

  • Help with JSP Tag Libraries

    Could someone please help me with the setup process of tag libraries? I've looked on the Internet and found some instructions, but they are all for Tomcat. I'm using Jserv, and I'm not sure how to setup my environment to work with custom/tag libraries. Could someone help me by giving me some instructions or sending me to an article that could help me?
    Thanks in advance!
    -PV

    Hi pvongboupha
    The best source for getting to know how to set up tag libraries is the JSP specification. You can download this from :
    http://java.sun.com/products/jsp/download.html
    See the chapter on Tag libraries. Any J2EE compliant server will conform to these rules.
    You can also see a chapter from Core Servlets & JSP by Marty Hall. This chapter is on Tag Libraries
    http://developer.java.sun.com/developer/Books/javaserverpages/cservletsjsp/
    Keep me posted on your progress.
    Good Luck!
    Eshwar R
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • Help with JSP and LUCENE -

    I downloaded Lucene (apache product) and put the jar files in the /webapps/lucene/WEB-INF/lib directory. I created a simple jsp file:
    test.jsp
    <%@ page import = "org.apache.lucene.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import = "java.util.Date" %>
    Test
    <%
    Date start = new Date();
    IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
    %>
    Started <%=start %>
    When pulling it up I get:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred between lines: 7 and 12 in the jsp file: /test.jsp
    Generated servlet error:
    /home/tpleasan/cots/jakarta/jakarta-tomcat-4.0.6/work/Standalone/localhost/lucene/test$jsp.java:73: Class org.apache.jsp.IndexWriter not found.
    IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
    ^
    An error occurred between lines: 7 and 12 in the jsp file: /test.jsp
    Generated servlet error:
    /home/tpleasan/cots/jakarta/jakarta-tomcat-4.0.6/work/Standalone/localhost/lucene/test$jsp.java:73: Class org.apache.jsp.IndexWriter not found.
    IndexWriter writer = new IndexWriter("index", new StandardAnalyzer(), true);
    ^
    2 errors
    I don't know what is wrong. The classpath I thought was set correctly to my jar files, but that doesn't seem to work. There isn't much documention on how to use JSP with Lucene. I got the basic examples they have working, but can't seem to get it working when I create my own stuff.
    PLEASE HELP!!!!!!!!!!!!!!!!!

    Apparently I have to set the classpath EACH TIME.
    How can I program this into the jsp so I don't have to do that? I thought that it would automatically find it if it was in the correct directory.
    Also I am following the directions of lucene but it won't search correctly. Nothing gets returned in the example search. What gives???

  • Problem with jsp and tomcat

    Hi ,
    I am trying to retrieve data from mysql server using Tomcat webserver of java web services developers pack. i wrote an html page that sends the account_no and password of my program to a JSP page which retrieve data from MySQL server to check whether the account no and password is valid or not . but when i start tomcat and run the html page and submit the onformation the Tomcat gives an error. i am attaching my full programs here. please someone help me.
    mybank.html:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> My Bank </TITLE>
    </HEAD>
    <BODY>
    <h1>Please Enter Your Account Number and Password</h1>
    <form action="mybank.jsp" method="post">
    <h2>Account Number:</h2>
    <input type="text" name="accno" maxlength="10" size="10"></br>
    <h2>Password:</h2>
    <input type="text" name="pass" maxlength="8" size="8"></br>
    <input type="submit" value="SUBMIT YOUR INFO">
    </form>
    </body>
    </html>
    mybank.jsp:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD>
    <TITLE> My Bank JSP </TITLE>
    </HEAD>
    <BODY>
    <% int acc_no = request.getParameter("accno");
    String password=request.getParameter("pass");
    class.forName(com.mysql.jdbc.Driver);
    Connection con= DriveManager.getConnection("jdbc:mysql:///password","root", "firehouse" );
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT account_no, password FROM pass WHERE password ='password' && account_no='acc_no' ");
    while(rs.next())
    int account=rs.getInt(1);
              String passw=rs.getString(2);
    if(rs!=null)
    rs.close();
    if(stmt!=null)
    stmt.close();
    if(con!=null)
    con.close();
    %>
    <h2>Accountno:<%= account %></h2>
    <h2>Password:<%= passw %></h2>
    </BODY>
    </HTML>
    i am getting this error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    No Java compiler was found to compile the generated source for the JSP.
    This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
    to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
    If using an alternate Java compiler, please check its installation and access path.
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:128)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:348)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:455)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:300)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    but i already set up the java compiler though i m getting this error. please help me.

    You say you have set up the environment variables, but it is not working. You may have them set to the wrong thing. One common mistake is to point JAVA_HOME at the java/bin directory rather than just the /java directory.
    Another set of eyes finds small mistakes in the variables that you might not spot yourself.
    So please, post:
    The values of these environment variables
    The path to where the products are installed on your system (ie is it c:\java or c:\j2se1_4_2 or c:\program files?
    I would take another close look at that JAVA_HOME variable to make sure of it :-)
    Good luck,
    evnafets

  • Cookie Problem  With JSP and Tomcat

    I have a tiny web application developed for my project thing.
    I am facing a problem while maintaining sessions with Cookie. I use Tomcat 3.2.1 Web Server and JSP 1.2 Specifications for my web application.
    I have created a page which creates a cookie and stores it in the client's PC, so when the same client visits the site, he can be remembered. Now while surfing the site in the same session, the site remembers the client. But once the client closes the browser and tries connecting to the site, he cannot be remembered. So I took a look into Temporary Internet Files of the client PC and found no cookie there. So where the cookie gets created and why does it disappears with the session. I have set a time limit of 1 year in the cookie.
    Now is that a Problem with Tomcat or with the configuration settings of IE in the client PC?? Or something else???
    Reply me Soon...

    Thanks for your reply.
    following is the code for how do i create a cookie...
    <%
         String custno = custBean.createPreferred();
         Cookie c = new Cookie("pc", custno);
         c.setVersion(1);
         c.setPath("/");
         c.setComment("PreferredCustomer");
         c.setDomain("think_machine");
    //think_machine is the name of the Web Server(Tomcat)
         c.setMaxAge(365*24*60*60);
         response.addCookie(c);
    %>
    And the code to read a cookie is..
         String custID = null;
         Cookie[] cookies = request.getCookies();
         for(int i = 0; i < cookies.length; i++)
              if(cookies.getName().equals("pc"))
                   custID = cookies[i].getValue();
                   break;
    One more thing I would like to let you know, that i access this from the same PC on which the Web Server is installed. Means the Server and the client are both one and the same PC.

  • Need help with JSP - Session Bean scenario

    I have massive problems with a simple JSP <--> Statefull Session Bean scenario with Server Platform Edition 8.2 (build b06-fcs)
    What I do is generating a Collection in session bean returning it to JSP
    and giving the List back to Session Bean.
    A weird exception happens when giving the List back to Session Bean
    (see Exception details below)
    The same code runs without any trouble on Jboss Application Server 4.0.3
    Any help would be great!
    Please see code below
    Statefull Session Bean
    <code>
    package ejb;
    import data.Produkt;
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Iterator;
    import javax.ejb.*;
    * This is the bean class for the WarenkorbBean enterprise bean.
    * Created 17.03.2006 09:53:25
    * @author Administrator
    public class WarenkorbBean implements SessionBean, WarenkorbRemoteBusiness, WarenkorbLocalBusiness {
    private SessionContext context;
    // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">
    // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
    // TODO Add business methods or web service operations
    * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
    public void setSessionContext(SessionContext aContext) {
    context = aContext;
    * @see javax.ejb.SessionBean#ejbActivate()
    public void ejbActivate() {
    * @see javax.ejb.SessionBean#ejbPassivate()
    public void ejbPassivate() {
    * @see javax.ejb.SessionBean#ejbRemove()
    public void ejbRemove() {
    // </editor-fold>
    * See section 7.10.3 of the EJB 2.0 specification
    * See section 7.11.3 of the EJB 2.1 specification
    public void ejbCreate() {
    // TODO implement ejbCreate if necessary, acquire resources
    // This method has access to the JNDI context so resource aquisition
    // spanning all methods can be performed here such as home interfaces
    // and data sources.
    // Add business logic below. (Right-click in editor and choose
    // "EJB Methods > Add Business Method" or "Web Service > Add Operation")
    public Collection erzeugeWarenkorb() {
    //TODO implement erzeugeWarenkorb
    ArrayList myList = new ArrayList();
    for (int i=0;i<10;i++)
    Produkt prod = new Produkt();
    prod.setID(i);
    prod.setName("Produkt"+i);
    myList.add(prod);
    return myList;
    public void leseWarenkorb(Collection Liste) {
    //TODO implement leseWarenkorb
    Iterator listIt = Liste.iterator();
    while(listIt.hasNext())
    Produkt p = (Produkt)listIt.next();
    System.out.println("Name des Produktes {0} "+p.getName());
    </code>
    <code>
    package data;
    import java.io.Serializable;
    * @author Administrator
    public class Produkt implements Serializable {
    private int ID;
    private String Name;
    /** Creates a new instance of Produkt */
    public Produkt() {
    public int getID() {
    return ID;
    public void setID(int ID) {
    this.ID = ID;
    public String getName() {
    return Name;
    public void setName(String Name) {
    this.Name = Name;
    </code>
    <code>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.util.*"%>
    <%@page import="data.*"%>
    <%@page import="javax.naming.*"%>
    <%@page import="javax.rmi.PortableRemoteObject"%>
    <%@page import="ejb.*"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>Online Shop Warenkorb Test</h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    <%
    Context myEnv = null;
    WarenkorbRemote wr = null;
    // Context initialisation
    try
    myEnv = (Context)new javax.naming.InitialContext();
    /*Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    //env.put(Context.PROVIDER_URL, "jnp://wotan.activenet.at:1099");
    env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    myEnv = new InitialContext(env);*/
    catch (Exception ex)
    System.err.println("Fehler beim initialisieren des Context: " + ex.getMessage());
    // now lets work
    try
    Object ref = myEnv.lookup("ejb/WarenkorbBean");
    //Object ref = myEnv.lookup("WarenkorbBean");
    WarenkorbRemoteHome warenkorbrhome = (WarenkorbRemoteHome)
    PortableRemoteObject.narrow(ref, WarenkorbRemoteHome.class);
    wr = warenkorbrhome.create();
    ArrayList myList = (ArrayList)wr.erzeugeWarenkorb();
    Iterator it = myList.iterator();
    while(it.hasNext())
    Produkt p = (Produkt)it.next();
    %>
    ProduktID: <%=p.getID()%><br></br>Produktbezeichnung:
    <%=p.getName()%><br></br><%
    wr.leseWarenkorb(myList);
    catch(Exception ex)
    %><p style="color:red">Onlineshop nicht erreichbar</p><%=ex.getMessage()%>
    <% }
    %>
    </body>
    </html>
    </code>
    the exception
    CORBA MARSHAL 1398079745 Maybe; nested exception is: org.omg.CORBA.MARSHAL: ----------BEGIN server-side stack trace---------- org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:8101) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:873) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:863) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:275) at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:363) at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:526) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:333) at java.util.ArrayList.readObject(ArrayList.java:591) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sun.corba.ee.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694) at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1212) at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330) at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296) at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034) at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:333) at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readArguments(DynamicMethodMarshallerImpl.java:393) at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:648) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:192) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1709) at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:155) at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:184) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129) at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:150) at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source) at ejb._WarenkorbRemote_DynamicStub.leseWarenkorb(_WarenkorbRemote_DynamicStub.java) at org.apache.jsp.index_jsp._jspService(index_jsp.java:122) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:297) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:247) at javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257) at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55) at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604) at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475) at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371) at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281) at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83) Caused by: java.lang.ClassNotFoundException ... 69 more ----------END server-side stack trace---------- vmcid: SUN minor code: 257 completed: Maybe

    Hi,
    I have found a way out by passing the reference of my EJB in the HttpSession object and using it inside the javabean..

Maybe you are looking for

  • IPod Mini Problems Please Help

    This is my second post of the type... no one replied to that so im hoping someone could help me. Problems: -Wont Update or Load Songs -It starts loading, gets to around the 5th song (out of well over 600) and says "Ipod Update Complete, OK To Disconn

  • Need help with creating template. Changes are not going through to index.html page

    Hi all, I have an issue with my template that I am creating and also a question about creating template Regions (Repeating and Editable). Somehow my changes to my index.dwt are not changing my index.html page. Also my other question is: For my top na

  • Captivate 8 drag and drop interaction not working

    Hi, I am working with Captivate 8 and created a drag and drop interaction using the drag and drop wizard. For some reason when I preview the interaction some of my drag sources work and others do not. I have searched high and low for what I may be do

  • The Sims 2, SimCity 4?

    Hello. I have just recently bought a 2.0 GHz C2D Macbook with 2GB of RAM. and i should recieve it by fedex tomorrow. i don't play computer games all that much but there are two that i absolutly love: The Sims 2 and SimCity 4 is the macbook capable of

  • Troubled Connection with WRT150N Router

    I  have purchased a WRT150N Linksys wireless router. I am able to connect to it most of the time, however, it loses connection MANY times. The connection seems unstable, because it can never stay connected for an extended period of time. Is there any