facebook

JSP tag [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #225223 Reply

    imm102
    Member

    hi,

    I was just wondering if I define a helper bean and add it to the src directory of a web project and then use it in a jsp via the <jsp:useBean> tag do i need to add any XDoclet annotations to the class. What deployment descriptor information is required if any? I can’t seem to find any examples not involving jsf and searching for java beans tends to bring up EJB stuff. Any help would be great.

    Ian

    #225228 Reply

    Riyad Kalla
    Member

    Ian,
    You don’t need to do anything, just create the class, jsp:useBean it and you are done, now you can use it. If you are new to Java web development, the term “Bean” is thrown around *everywhere*, so when you see someone say “Oh yea just write a Bean to do that” bean means “A collection of properties (get/set) and business logic”… now depending on the context (a JSF app, a J2EE app, a Tapestry app, etc.) the actual “Bean” itself will mean different things.

    JSF is actually a good example of Beans, there is no super class or special interface to extend or implement like EJB, it is just a class that has a bunch of properties on it, and some methods that do stuff with the info.

    When people say “POJO” when describing beans, they usually mean just a class with a bunch of properties (get/setters) used to store/retrieve info.

    #225239 Reply

    imm102
    Member

    cool! I had noticed the discontinuity between the various uses of Beans. Thanks for clearing that up.

    🙂

    #225247 Reply

    Riyad Kalla
    Member

    No problem, glad it helped.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: JSP tag [Closed]

You must be logged in to post in the forum log in