New to Beans and Apache Tomcat - 1st Bean problem !

Hello all. Just to give you some background, I know basic Java and I am more than happy to have a go at something I know nothing about.
I am developing a system - for my own personal use (and friends) that will have an Oracle back end and a web browser and mobile phone front end, connectivity to DB via JDBC.
I'm using JSPs and, I was debating whether to use Servlets too. I reads a few documents and, for what I want, Java Beans seem spot on. So I am running through a tutorial trying to get the basics of it.
This is the error I am getting:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 5 in the jsp file: /showUserBean.jsp
Generated servlet error:
UserBean cannot be resolved to a type
I should be passing the variables to the bean through the url in this example but the book does not show how to do it, so I left the url with just http://localhost/showUserBean.jsp
The error is refering to a UserBean type, it seems that when the JSP is compiled the system does not know "what" class UserBean is or where to find it. Any pointers would be greatly appreciated. the UserBean.class file is in the apache install dir default webapps/root/web-inf/classes folder.
The JSP is in the apache default install dir webapps/root folder.
The code for the bean is:
// first attempt at a Bean
public class UserBean implements java.io.Serializable
protected int userId;
protected String userName;
protected String location;
public UserBean(){}
public int getUserId() { return userId; }
public void setUserId(int aUserId)
{ userId = aUserId; }
public String getUserName() { return userName; }
public void setUserName(String aUserName)
{ userName = aUserName; }
public String getLocation() { return location; }
public void setLocation(String aLocation)
{ location = aLocation; }
The code for the JSP is:
<html>
<body>
<%-- Create an instance of the bean --%>
<jsp:useBean id="userBean" class="UserBean"/>
<%--Copy the parameters into the bean --%>
<jsp:setProperty name="userBean" property="*"/>
The bean values are:,br>
User ID: <jsp:getProperty name="userBean" property="userId"/><br>
Username: <jsp:getProperty name="userBean" property="userName"/><br>
Location: <jsp:getProperty name="userBean" property="location"/><br>
</body>
</html>

JavaBeans seems they are more focused for visual interfacesRead the specification: http://java.sun.com/products/javabeans/docs/spec.html
I want to simply create some objects from classes and manipulate the data held by themLike struct in C? JavaBean technology helps you

Similar Messages

  • [svn:bz-trunk] 18538: Remove apache-tomcat-6.0.14 and apache-tomcat-6.0. 26 versions from trunk

    Revision: 18538
    Revision: 18538
    Author:   [email protected]
    Date:     2010-11-11 09:59:23 -0800 (Thu, 11 Nov 2010)
    Log Message:
    Remove apache-tomcat-6.0.14 and apache-tomcat-6.0.26 versions from trunk
    checkintests: passed
    Ticket Links:
        http://bugs.adobe.com/jira/browse/tomcat-6
        http://bugs.adobe.com/jira/browse/tomcat-6
    Removed Paths:
        blazeds/trunk/servers/apache-tomcat-6.0.14/
        blazeds/trunk/servers/apache-tomcat-6.0.26/

    I haven't studied your problem in detail and don't actually use Tomcat 6, but in earlier versions of Tomcat the handling of JNDI leaves a lot to be desired. If you search this forum for posts about Tomcat and JNDI, you will find some useful information.
    One thing I found was that you really need to use the context.xml file in your Meta-inf directory, putting the datasource anywhere else gets into one kind of trouble or another. I tried using server.xml, a context file for the application and the web-inf file.

  • I updated to the new software today and now in having several problems! Lost all my contacts. Anytime I try and back up to iCloud it says it can't be complete and now I get a cannot connect to store message. Help!

    I updated to the new software today and now in having several problems! Lost all my contacts. Anytime I try and back up to iCloud it says it can't be complete and now I get a cannot connect to store message. Help!

    Something in your backup may be corrupt. Try wiping it and setting it up as a new device, then sync your apps, data and media back to it from iTunes. DO NOT resotre from your backup. If the problem is contained in the backup, it will bring it right back again if you restore.

  • Tomcat and Apache/Tomcat is the same?

    Hello,
    I�m new to jsp and somedays ago I asked here a question and the solution was about installing Apache or Apache/Tomcat.
    Now, my question is the following.
    When I started to learn jsp , what I did were to install Tomcat. After reading some questions in these forums I do not know what is the difference between the installation of Tomcat and the installation of Apache/Tomcat.
    What I have done for the moment is to have a server with Apache and another server for my jsp pages with Tomcat....
    Does it means that it is possible to integrate two installations in only one server and to run all the pages in the same server? Where can I find information about that?
    Thanks a lot and regards,
    Patty

    Tomcat has an HTTP listener built in, so you don't necessarily need Apache to run Tomcat and serve up HTML, JSP, and servlets.
    But if you want to have Apache handle static HTML and forward servlet/JSP requests to Tomcat, there are docs at the Tomcat site to tell you how to bolt Tomcat onto Apache.
    The Wrox book "Professional Apache Tomcat" has good instructions, too. I've done it successfully many times. - MOD

  • IBM WebSphere Studio and Apache Tomcat Server

    Hi all of you , my question is Can I add Apache TomCat web server to my IBM WebSphere Dev. Studio 5.0. ? If it's so, How can I do ? If you hurry up,I'll be really appreciated.
    Thanks in advance.
    Ergin

    When I do an add server from WSAD 5.1.2 I see the option of Tomcat 3.2, 4.0 & 4.1. I don't know if 5.0 has them.
    You can always run tomcat outside of WSAD and point it at your webapp root in WSAD. Doesn't provide all the nice integration but works OK.
    -- Frank

  • OAS and Apache Tomcat on same machine

    Hi guys,
    I have a server for "Business objects XI/MS SQL server" which uses Apache TomCat 5.
    I want to install RDBMS 10g and Oracle Application server on this machine. Is there any conflict possible?
    What measures I may take to keep both applications running on same machine.?
    thnks in advance

    Besides the obvious things like memory and CPU (load), just make sure that you don't get any port conflicts and you will be ok. (at least, you will be on unix. I don't know much about Windows, so can't help you with that one).

  • How to integrate Apache Web Server and Apache Tomcat 4.0 ?

    <pre>
    Hi All,
    Can anyone give me a detailed description(or url that tells so) of how to install the Apache Web Server, Apache Tomcat Server4.0 and Integrate both of them.
    Still now I am using Apache Tomcat 4.0 as a standalone application and now I want to learn how to install,use Apache Web Server and integrate this with Apache Tomcat.
    Please point me to exact location,url to download the recent Apache Web Server and,
    Can I use my existing Standalone Apache Tomcat 4.0 to integrate this with Apache Web Server that I am going to download.
    A detailed explanation of how to integrate both is very helpful.
    Thanks in advance.
    <pre>

    The way to integrate Apache Web Server & Apache is very easy. The first step is download the library to connect both servers. This library can be download from http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0/bin/webapp-module-1.0-tc40-windows.zip.
    Copy the files to APACHE_HOME\modules and open httpd.conf to change any lines:
    You find the section "LoadModule" and you add the next lines:
    LoadModule webapp_module modules/mod_webapp.so
    AddModule mod_webapp.c
    And the end of the file you must add these lines:
    WebAppConnection conexion warp localhost:8008
    WebAppDeploy examples conexion /examples
    The first parameter -2nd line- (examples) is the URL name application, the second is the connection's name and the last parameter is the application's name. This name is the same which in servlet.xml.
    At last you can add one more lines to check the module's configuration:
    WebAppInfo /webapp-info
    If you visit http://<yoor_host>/webapp-info you can see the configuration.

  • Clientgen and Apache Tomcat

    Is it possible to invoke a webservice deployed on Apache Tomcat from a client that
    uses the proxy classes generated by weblogic's clientgen task.
    1. We are successful if the datatypes passed are simple datatypes like String,
    long, int etc.
    2. Fails when we use User defined types like
    class MyClass {
    Any insight would be appreciated.
    Thanks,
    -Sridhar

    Tomcat has an HTTP listener built in, so you don't necessarily need Apache to run Tomcat and serve up HTML, JSP, and servlets.
    But if you want to have Apache handle static HTML and forward servlet/JSP requests to Tomcat, there are docs at the Tomcat site to tell you how to bolt Tomcat onto Apache.
    The Wrox book "Professional Apache Tomcat" has good instructions, too. I've done it successfully many times. - MOD

  • HTTPS and Apache tomcat

    When i install apache tomcat,all operation is default!!
    But when I call https://127.0.0.1:8443 ,it don't work~~
    Please tell me fix this bug !!

    i remove comment
    <!--  Define a SSL HTTP/1.1 Connector on port 8443
      -->
    - <!--
        <Connector port="8443" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" disableUploadTimeout="true"
                   acceptCount="100" scheme="https" secure="true"
                   clientAuth="false" sslProtocol="TLS" />
      --> and then,one part of server.xml like that
    <!--  Define a SSL HTTP/1.1 Connector on port 8443 -->
    <Connector port="8443" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                   enableLookups="false" disableUploadTimeout="true"
                   acceptCount="100" scheme="https" secure="true"
                   clientAuth="false" sslProtocol="TLS" />

  • SSL and Apache Tomcat 5.5.20

    Hi
    Maybe java forum is not right place where to put this post, but it is worth a try...
    im using tomcat 5.5.20 and i have read tomcat-docs how to configure server for ssl... i have done everything (checked so many times...), restart my server too, but still ssl does not work...
    when i try to open https://localhost:8443 but it takes so much time "loading the page" and then fails...
    when i try http://localhost:8443 it work but with no ssl... :(
    my server.xml config file :
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
         <Connector port="8443" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    any help?

    i have found the cause of problem, but i cent solve it....
    problem is because i use winxp for server (apache). On winxp there is no default enviromental variable for USER_HOME or sth like that...
    the server.xml use home variable where .keystore is stored... and on linux where home variable is explicitly defined and it works...
    when i was try to move .keystroe file to another directory and rename it to tomcat.keystore and in server.xml use the following parameter inside Connector tag, keystoreFile="path-to-file\tomcat.keystore" in it does not work any more...

  • Webacc and apache/tomcat source code install

    hi all:
    im try GW2012+SLES11SP1,install webacc,im want custom install apache2.x and tomcat 6.x,im installed it,but how install webacc?install tip install apache's rpm and tomcat 's rpm,pls help me ,thanks.

    SeamanMei,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://forums.novell.com/

  • Difference between Eclipse and Apache Tomcat?

    Can anyone let me know difference between these two? or give me a website link where i can find comparison of the two?I want to work on JAVA+Web services, so what is best bet for me to work with?

    eat your pizza then getinto car.or get into car ,
    reach the moon and then eat your pizza there.you see
    both are usefull somehow.well i asked as i dint know
    much about this stuff, so instead of making fun you
    could have helped me a bit. no?MAybe you could have just taken the sarcasm as what it was and yould have tried to find out what to use Eclipse and what to use Tomcat for... if you can't tell the terms "deleopment environment" and "servlet container" apart, writing servlets might still be too big a task for your present state of knowledge.

  • SetAttribute in JSP page and Apache tomcat server

    Hello all gurus: I have created a JSP using JDeveloper. It works fine within the web server installed with JDeveloper, but when I upload the application to apache tomocat server, it does not seem to work correctly.
    I am using setAttribute property of the session object, to save data. Listed below is a section of the code. Not sure if it is a cookie issue or what.
    <%
    int i_count = 0;
    if(session.getAttribute("create_user_first_time") == "") {
    session.setAttribute("create_user_first_time","FIRSTTIME");
    else {
    System.out.println("SECOND TIME DUDE.");
    System.out.println(request.getParameter("username").toString().trim());
    i_count = createuser (
    request.getParameter("username").toString().trim(),
    request.getParameter("password").toString().trim(),
    request.getParameter("Email").toString().trim(),
    request.getParameter("DOB").toString().trim(),
    request.getParameter("securityQ").toString().trim(),
    request.getParameter("securityA").toString().trim(),
    request.getParameter("Phone").toString().trim()
    System.out.println("after create user");
    System.out.println("i_count="+i_count);
    if (i_count == 3) {
    session.setAttribute("err_msg_create_user", "USER ALREADY EXISTS!");
    System.out.println("err_msg_create_user: USER ALREADY EXISTS!");
    else {
    session.setAttribute("err_msg_create_user", "Congratulations " + request.getParameter("username").toString().trim() + "!!Please proceed to login at the following URL: <a href=Login.jsp target='_blank'> Login </a>");
    System.out.println("CONGRATULATIONS!");
    %>

    Abder-Rahman wrote:
    I noticed the problem.The "Hello.jsp" file was still in "Notepad" format.Huh? What is it, the "Notepad" format?
    Do you mean that it is saved as hello.jsp.txt? Just rename the file then.
    It might be helpful to disable the setting "hide extensions for known file types" in the Windows Explorer options.

  • I'm new to Mac and I'm having a problem trying to transfer photos from Iphoto onto a external hard drive?

    My hard drive says it's locked and I don't know how to unlock it. Also i tried exporting photos but that didn't work either. Thanks so much

    No idea - you actaully have to share details
    What version of iPhoto and of the OS?
    What format is the external hard drive? What is the exact error message you get?what didn't work about exporting?  What exactly are you trying to accomplish?
    If you want the iPhoto library to operate on an external drive the way is
    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • APACHE Tomcat server startup problem

    When i'm trying to start Apache from Eclipse IDE, then accessing http://localhost:8080 , i got a Error 404 - The requested resource not available.
    why is this?
    when i'm starting from command line, everything it's ok, it's displaying the welcome screen
    please help
    Thanks

    If you want to access the Tomcat root, then you need to let eclipse take over the full control of Tomcat. Doubleclick the Tomcat instance in the Servers dialogue, under the 'Server Locations' choose 'Use Tomcat installation' instead of the default 'Use workspace metadata'.

Maybe you are looking for

  • I can't cut and paste text from online and then transfer it to a word document

    Sometimes when I highlight text in a hotmail e-mail, then try to paste it as a word document, it won't paste. The page is left blank. There are times it works and times it doesn't. This is extremely frustrating. I feel like I need to update something

  • Error while opening the jspx page

    Hi all I am creating a test application that application i am utilizing jheadstart API it is working fine but if I delete my application form my jdeveloper IDE nest time I am loading the same application my jspx page is not showing in code editor it

  • Report vendor GL account line item display (help needed)

    hi all, how r u there? i have one scenario that depending on HKONT which is on my selection screen i should not get that HKONt in my display and want to display all the offsetiing entries of that HKONT of different fisical year. main thing is that ho

  • Need to create a PDF with submit button for Wordpress Website.

    I need to create a restaurant's employment application in PDF form with fields that user can fill out and a submit button to send the form to a specified email. I then need to put this PDF online on client's website. Is this possible with ID?

  • MM-1 (Bower&Wilkins) USB speakers problems with OS Mavericks

    Hi, I use USB speakers, rather fine ones. MM-1 (Bower&Wilkins) With Mountain Lion, everything was good. Ever since I switched to Mavericks, I have all sorts of problem with them. In lin- in mode, everything is ok, but in USB mode: I loose all audio s