Where do i save my beans in tomcat?

hi
I'm learning java beans and i'm relatively new to it. My jsp code is
<jsp:useBean id= "stringBean"  class = "example.StringBean">
<jsp:setProperty name="stringBean" property="message" value="messg"/>
</jsp:useBean>
<html>
<head><title>Using Java Beans in  a JSP page </title></head>
<body bgcolor = "blue">
<h3>The msg obtained by using a bean component is :</h3>
<font size = "5"><jsp:getProperty name="stringBean"  property="message" />
</body>and the bean StringBean.java is
package example;
public class StringBean {
     private String message = " No message " ;
     public String getMessage() {
          return (message);
     public void setMessage(String message)
          this.message = message;
}Whenver i run the jsp page i get an error as follows
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /beans.jsp(1,1) The value for the useBean class attribute example.StringBean is invalid.
     org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
     org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
     org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
     org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
     org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
     org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
     org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     org.apache.jasper.compiler.Generator.generate(Generator.java:3284)
     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Can someone please help as to where do i save my class file in tomcat??

I've also had this problem (sorry for resurrecting an old question) and I put my class in the classes folder last night (within a folder appropriately named for the package it's in) and I got the same message as above, even after restarting the web application. Do I need to restart anything else or tell Tomcat where the bean is?
Cheers
-- Kev
Just searched for different terms and found that my class needs a public default constructor. Seem to have missed that part ;�)
Message was edited by:
KevDGill

Similar Messages

  • Where to save the java bean in Tomcat?

    hi,
    im using a bean in a jsp. my coding of jsp is:
    <html>
    <head>
    <title> JSP BEAN EXAMPLE </title>
    </head>
    <body>
    <%@ page language="java" import="Counter" %>
    <jsp:useBean id="counter" scope="session" class="Counter" />
    <jsp:setProperty name="counter" property="count" param="count" />
    <% out.println("Count from scriplet code:" + counter.getCounter() + "<br>"); %>
    Count from jsp:getProperty:
    <jsp:getProperty name="counter" property="count"/>
    <br>
    </body>
    </html>
    the bean is:
    public class Counter
    int count=0;
    public Counter()
    public int getCounter()
    count++;
    return this.count;
    public void setCounter(int c)
    this.count=count;
    please tell me the correct location where i should save my bean file?
    my jsp is saved at :Tomcat 4.1\webapps\ROOT
    im getting an error such as
    2005-02-19 14:11:31 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Cannot find any information on property 'count' in a bean of type 'Counter'
         at org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:704)
         at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:694)
         at org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:552)
         at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
         at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070)
         at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076)
         at org.apache.jasper.compiler.Node$Root.accept(Node.java:232)
         at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028)
         at org.apache.jasper.compiler.Generator.generate(Generator.java:1917)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:242)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         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:256)
         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:2415)
         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:171)
         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:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)
    will some one please help me??

    hi
    first use package to store ur bean class. and change ur mutator and accessor methods like this
    setCount() and getCount()
    ur jsp code is here
    <html>
    <head>
    <title> JSP BEAN EXAMPLE </title>
    </head>
    <body>
    <%@ page language="java" import="SampleLib.Counter" %>
    <jsp:useBean id="counter"class="SampleLib.Counter" />
    <jsp:setProperty name="counter" property="count" param="count"/>
    <% out.println("Count from scriplet code:" + counter.getCount() + "<br>"); %>
    Count from jsp:getProperty:
    <jsp:getProperty name="counter" property="count"/>
    <br>
    </body>
    </html>
    ur bean is herepackage SampleLib; // i have added package statement here
    public class Counter
    int count=0;
    public Counter()
    public int getCount()
    count++;
    return this.count;
    public void setCount(int c)
    this.count=count;
    Bye for now
    sat

  • Where I should put the bean class?

    Hello,
    I am learning JSP. I want to know where I should put the bean class? Which directory should I put the bean class?
    note that I am using Tomcat 4.1
    johnwen
    24-12-2005

    I can't tell if you've got everything you need or not, but what you've shown looks right so far. Let me run down the necessities:
    In your JSP file:
    <%@ page import="aos.*" %>
    <%-- imports all of the classes in the "aos" package --%>
    In your Java file:
    package aos; // tells Java this is a package (you probably have this)
    Then, of course, you put the class file into the directories that you mentioned, ie, $CATALINA_HOME/ROOT/WEB-INF/classes/aos (forgive me if I use Unix-styled slashes; old habit, and shouldn't make any difference.)
    You may need to restart Tomcat. You have to restart it when you add certain directories, although I'm not sure exactly which ones. But it never hurts to just restart it anyway.

  • Can I create separate folders to save media on my Airport Time Capsule? Issue is I have a 256GB HDD Mac Pro Retina which is almost full. TC will only take backup of my HDD. So where would I save my photos and videos from my iPhone and iPad?

    Can I create separate folders to save media on my Airport Time Capsule? Issue is I have a 256GB HDD Mac Pro Retina which is almost full. TC will only take backup of my HDD. So where would I save my photos and videos from my iPhone and iPad?

    It is a hard one.. laptops with small drives are a pain.
    What you need is a home media server.
    Some people use a PC running itunes for cost.. but that is nothing like as good as using a Mac mini.. they make great little HTPC device.. you can plug in large hard disks and store all your files and media. And share it with the network.. Read up apple's instructions on home sharing.
    https://www.apple.com/au/support/homesharing/
    For cost you can buy a mini from 2011 or 2012.. I would not recommend earlier ones.. the advantage of 2012 is they have USB3 ports. But you will pay more for them.. new mini is not as useful.. they have soldered in memory and you cannot upgrade.. the old mini was the most easily modified mac in the whole range. Uses little power and can be bought for a $300US for a good one second hand.. maybe less.

  • I game online and have problems with games working after updating firefox. I use an older version but am concerned about security. Two questions: can I be sure that Firefox 4 will work on my system (vista) and where do I save the file at?

    I have had a problem with the compatibility of Firefox running with the games I play online. I don't want to attempt an upgrade again, only to have to turn around and degrade so my activities can work. Furthermore, I'm not sure where to save the Firefox file in my system, since for some reason it doesn't take me right to where it should save.

    This issue can be caused by the Yahoo! Toolbar extension
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Where shall i save the jar file when i'm using a parser(JDOM) in jwsdp

    I'm using jwsdp These errors are coming
    when i compile.where shall i save the jdom.jar file?
    do i have to change the server.xml file in jwsdp-1_0\conf directory ?
    import org.w3c.dom.*;
    ^
    MetaBuilder.java:4: cannot resolve symbol
    symbol : class DocumentImpl
    location: package dom
    import org.apache.xerces.dom.DocumentImpl;
    ^
    MetaBuilder.java:5: cannot resolve symbol
    symbol : class DOMImplementationImpl
    location: package dom
    import org.apache.xerces.dom.DOMImplementationI
    ^
    MetaBuilder.java:6: cannot resolve symbol
    symbol : class Document
    location: package dom
    import org.w3c.dom.Document;
    ^
    MetaBuilder.java:7: cannot resolve symbol
    symbol : class OutputFormat
    location: package serialize
    import org.apache.xml.serialize.OutputFormat;
    ^
    MetaBuilder.java:8: cannot resolve symbol
    symbol : class Serializer
    location: package serialize
    import org.apache.xml.serialize.Serializer;
    ^
    MetaBuilder.java:9: cannot resolve symbol

    Hello,
    the *.jar file thing is a common problem in Java. One simple solution to the problem is by saving the *.jar file in the C:\j2sdk1.4.0\jre\lib\ext\ folder. This directory is an extension to the regular java files and by doing this, java will look in this directory if you import some other files not included in the java package. This does not work if you are using JBuilder, couse JBuilder installs its own jsdk, which is uses, probably under the JBuilder folder.
    TheLaw

  • Where did the "save as" feature go?

    I just opened up a Pages document, after my Lion upgrade.  I want to use the orginal document, make changes and save as a new document.  However, when I clicked on "File" to go to the "Save As," I discovered it is no longer there.  Where is the "Save As" feature now.  This is, obviously, a crucial need.

    Pondini wrote:
    In most cases, though, you don't need a separate file.  Just make a Version with Cmd+S.
    Much faster, and takes up much less space, since it only saves the changes, not the whole document.
    As a work machine processing files, folders, and graphics, in many cases I do, everyday.
    Changing file name and format and still have the original to work with.
    Seems crazy to me.
    Message was edited by: leroydouglas
    update:  I was successfiul to create a keyboard shortcut for Duplicate not Export (my preferred.)

  • The Where in the save as dialog box

    The Where in the save as dialog box is frustratingly limiting is there a way to change this so I can browse to the folder I want?

    I recommend you get Default Folder.   I've considered it a must have utility for my systems since OS9 Classic days.  It greatly helps in navigation for the ever deficient file dialogs in OSX (and OS9).

  • Where is my Save As in Lion?

    Perhaps this only applies to Preview, but I went to do something I do all the time: convert a screenshot from .png to .jpg just in case some Windows user couldn't read it, when I suddenly realised Preview no longer has Save As and it's stupid "Save a version" means the same as the old "Save", which means it's in the same format. Where has my Save As gone? How can I do something similar?

    Depending on what you want to wind up with, you'll need to use either 'duplicate' which will give you two copies - one png, one jpg - or export the png; you can change the format during that process. It's a new feature in lion,

  • Using an iPad wi-fi 3G. How do I save received email documents in the my device? Really hate having to go through my emails to find a document. And where do I save it?

    Using an iPad wi-fi 3G. How do I save received email documents in the my device? Really hate having to go through my emails to find a document. And where do I save it?

    triplembm wrote:
    I downloaded a PDF from an email and have been trying to save the file in my document file.  When using Snow Leopard I used to hit Command S and it would ask me where I wanted to save the document.  i just got an iMac with Lion and when I hit Command S I get nothing.
    Welcome to Lion's new feature: Versions
    How do I save a document using Lion? 
    To save a NEW copy in Preview:
         File->Export
    You said that you d/l'd a PDF in Mail, so why not just click the "Save" button in Mail?
    (Make sure that you click the "Details" button in Mail)
    In Mail:
    BTW, I'm very happy with Lion.  (In regard to all the negative Lion posts, ask yourself if you're more likely post a comment here telling us how happy you are with features of Lion, or to complain about something that's changed).

  • Where do I save other ICC Profiles so I can use them in softproofing in Lightroom 4?

    I am starting to use an online photo printing service and the photos are not an accurate representation of what I see on the screen so I want to download their color profiles which are specific to their printers and various papers. Where do I save the files so Lightroom4 can access them in softproofing?

    On a mac, it's Library/ColorSync/Profiles either in the root or user level (under 10.7, that folder is hidden)**
    **In the Finder, choose Go > Go To Folder.
    In the Go To Folder dialog, type Sudo ~/Library Click Go.
    OR
    This method makes the user library folder permanently visible but requires the use of Terminal (not for the novice user):
    Launch Terminal from the Utilities folder.
    In Terminal type the following command and type Return key:
      1. chflags nohidden ~/Library
    Enter administrator password and then type Return key.
    Type Exit and quit Terminal.

  • Where should I save my Dreamweaver Widgets?

    Hi, everyone.
    I downloaded a Lightbox widget. Clearly, I made a mistake in saving the widget, because this is the address in my header information for the CSS file!
    C|/Users/Alex/AppData/Roaming/Adobe/Dreamweaver CS4/en_US/Configuration/Temp/Assets/eam6DA9.tmp/css/lightbox.css
    I am downloading the widget again, and it is asking for my destination folder. Where should I save the widget so that I can pop the CSS and JS files right into the head data?
    Thanks a lot, Community -

    Hello Queenoid,
    It does not matter where you save the widget although you probably want to save it into something  like your "My Documents" or "Downloads" folder for easy access. When you save the Lightbox widget, 1 file (LightBox Gallery Widget_default.html) & 3 folders (css, images, scripts) are saved in the location you specified. If you want to use your own pictures, go into the images folder & replace the images there with your own.
    When done, upload the file & folders to your site & everything should work.

  • Where is my save game ?

    i want to ask where is my save game saved? in game centre or in my ipad ?
    because i want to reset my gamesuch my clinic,contract killer and the others but i can't ..
    Anyone can help? please
    thx...

    I believe the games themselves are saved in the apps themselves, on the iPad, but the scores in the game center.

  • Where do I save .doc file on an ipad

    I understand that by using pages app that I can open and modify a microsoft word document. But how and where can I save the file as .doc file????

    Hi
    I have been using Pages Only on my iPad, but need to save files as .doc regularly... Whenever I want to make a .doc file I use the "Save As . . ." option and choose .doc in the format box.
    The document itself is kept with my other Pages documents, which I believe may be what you originally asked.
    As far as I can tell, on the iPad there is no way to "organize" them, like there is on the iMac or other desktop/laptop. As far as my understanding, the iPad was not intended to be a full laptop - but maybe that has changed as they have added more functionality to the iPad 2.
    You can, as others mentioned, email the .doc files to anyone you choose from within Pages.
    I hope this helps

  • Can you use Easynews to download movies etc to IMac and how and where do you save the files?

    Can you useEasynews to download movies etc to IMac and how and where do you save the files?

    From your Apple menu at the left end of the menubar, select "About this Mac." You get a window similar to this:
    1) The Mac OS version is just under the big "MAC OS X" line. Post what that says.
    2) We can start to figure out what iMac you have if you post what that the "Processor" line says.
    We need to find out because Apple's poor labling choices for this forum, intended for iMacs made before 2006, causes people with newer and much more capable Macs to post here by mistake.
    Without some info from you, it's much like your calling an auto mechanic and asking if you can use a certain part without telling him the make, model, or year of your car. Quess what his first question will be? Works the same here.

Maybe you are looking for

  • Issue with macro

    I have a macro that updates a key figure . The macro checks certain conditions and if the result is true sets the value of the key figure to 1 and changes the key figure value to 0  if the conditions return a value of false. I executed the macro in a

  • Screen problems, need info

    A horizontal grey bar has appeared in the center of my ipod that spans nearly the entire length of the screen. The bar is visible even when the ipod is off but it is not lit up so it is harder to see. I have observed it grow in size and shrink little

  • How can i get Apple icon next to my uploads on FB through Macbook ?

    I know Apple icon only comes while using Iphone or Ipad But please find some way out so i can have Apple icon next to my uploads on FB while using Macbook !! Developers do something .

  • Opportunities in CRM Technical

    Hi, would like to know about opportunities in CRM Technical. Regards, Sandesh.

  • Personal domain redirect worked great - now both are down???

    Please, someone maybe here is having this problem? I used iweb/mobile me to publish to my personal domain www.fashionthathappened.com. Had that all set up great with no issues. A week later, bought a name domain for my resume & tacked that on the bac