JSP: Beans from factories?

From: Kai Grossjohann (kai_at_emptydomain.de)
Date: 12/17/03

  • Next message: Matthew Zimmer: "Re: System.loadLibrary problem"
    Date: Wed, 17 Dec 2003 14:31:50 +0000
    
    

    I have an object which has a factory method which returns objects that
    I would like to use as beans in JSPs.

    <jsp:useBean id="foo" class="blarfl"/> will call the constructor of
    the blarfl class, though, so that's not what I want.

    I can use a scriptlet along the lines of

        <% Factory fact = new Factory();
           Blarfl b = fact.findBlarfl(); %>

    But then I don't know how to make b into a bean such that I can use
    <jsp:setProperty/> and friends on it.

    Maybe it works to use <c:set/>? How to do that?

    Kai


  • Next message: Matthew Zimmer: "Re: System.loadLibrary problem"

    Relevant Pages

    • Re: JSP: Beans from factories?
      ... > I have an object which has a factory method which returns objects that ... > I would like to use as beans in JSPs. ... > the blarfl class, though, so that's not what I want. ...
      (comp.lang.java.programmer)
    • Re: EJB + number crunching
      ... Entity beans are used to represent data in a database. ... You do not need to implement all the things that go with a server, like threading, polling, security, etc. (Do not be fooled -- writing a server is hard. ... JSPs allow for the definition of output pages with Java code and JSP tags interspersed. ... Many applications only require the web technology portion of J2EE and some servers supply only that. ...
      (comp.lang.java.programmer)
    • Tomcat help: Java Beans and servlets not working in user directories with UserConfig, jsp is
      ... I have configured in web.xml the UserConfig class as such ... any jsps in home directories are working but servlets and beans that ... from jsps are not. ... I however can use a jsp that does not use any beans in the ...
      (comp.lang.java.softwaretools)