Frasso, Anthony wrote the following on 7/5/2005 5:34 PM:
Hello, and thanks in advance for your help.

I am a newbie with respect to struts, and for that matter web development in 
general.  I am attempting to design a simple jsp page (using the struts 
framework) to print a table of values that are read from a bean.  For now, I'll 
stick to trying to generate the table, and worry about any additional response 
from the user later.

The following is code from my jsp, surrounded only by the opening <HTML> and 
<BODY> tags:

-- Start JSP Code

<%
    ProjectsBean projectsBean = new ProjectsBean();
    projectsBean.populate();
%>

Typically you won't want to do any logic like the above in scriplets. In other words it's better to do the above in a Servlet (ie Strut's Action) and put your 'projects' list in scope there....

ProjectsBean projectsBean = new ProjectsBean();
projectsBean.populate();
request.setAttribute("projects", projects);

However, your code will probably work if you put your projectsBean in pageContext...

<%
     ProjectsBean projectsBean = new ProjectsBean();
     projectsBean.populate();
     pageContext.setAttribute("pojectsBean", projectsBean);
%>


--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to