But, how to send the Query processed into Servlet to a Bean.
My servlet has many complex logical and I think its hard to
convert all the code to a Bean.
> Edilmar,
> What you need to do is create a Bean to hold your "query" data and then
> add it to the session, the request, or the ServletConfig in order to give
> it session, request, or application scope. Then you can reference the
> bean via <jsp:useBean id="beanname" class="beanClass"
> scope="session/page/request/application" /> and
> <jsp:getProperty name="beanname" property="beanProperty"/>
> hope this helps
> Matt
>
> Edilmar Alves wrote:
>
> > Hi,
> >
> > I have used JBuilder + JDK 1.3 + JSDK 2.2 + Tomcat 3.2.1
> > to build only servlets. However, the web designer would
> > like more easily to format the HTML page. Then, I thought
> > about using JSP+servlets.
> >
> > Look at this simple example:
> >
> > I have a servlet that receives a request and needs to
> > run a SQL like:
> > "Select Name,Address From Client Order By Name"
> > Then, it returns a HTML page with this code:
> > HTMLRet = "<table border=0>" +
> > "<tr><td>Name</td><td>Address</td></tr>";
> > Query.first();
> > for (i = 0; i < Query.rowCount(); i++) {
> > HTMLRet += "<tr><td>" + Query.getString("Name") + "</td>" +
> > "<td>" + Query.getString("Address") + "</td></tr>"
> > Query.next();
> > }
> > HTMLRet += "</table>"
> > // now the normal code to return HTMLRet using out...
> >
> > The code is something more complex from above, because there is
> > many places where the HTML code to return is linked to some business
> > logical, what makes using only JSP very complicated.
> >
> > Then, imagine webdesigner tells me about changing the font face/size
> > of "Name" column and font color of "Address". I need to recompile the
> > code to do this.
> >
> > I would like to write all business logical into a servlet and send
> > the "Query" variable to JSP. Then, at JSP, the webdesigner would do
> > anything into layout. Is it possible to send the Query to JSP ???
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]