Turgay,

I've just tried that but get the following exception:

javax.servlet.jsp.JspException: Cannot find bean contributorEditForm in
scope session 

I've removed all useBean tags from my jsp and have added the following in my
action class:

ContributorEditForm contributorEditForm =
(ContributorEditForm)session.getAttribute( "contributorEditForm" );

if ( contributorEditForm == null )
{
        contributorEditForm = new ContributorEditForm();
      session.setAttribute("contributorEditForm", contributorEditForm );
}

My JSP contains code like: <struts_logic:iterate id="rows"
name="contributorEditForm" property="data" scope="session">

Have I done something wrong?

As for debugging, I haven't really been able to so far, I've just been
putting System.out's in my Action class.  I'm about to install JBuilder
Enterprise (I normally use the Foundation version ) as this supports JSP
debugging, so I'll let you know if it's any good. 

Richard.

-----Original Message-----
From: Turgay Zengin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 10, 2001 2:05 PM
To: [EMAIL PROTECTED]
Subject: RE: How do you use indexed properties with html:input?


Richard,
I put my bean in session scope when I create it in an action class:

OracleConnBean dbconn=null;
dbconn = (OracleConnBean)session.getAttribute("dbconnection");
if(dbconn == null) {
    dbconn = new OracleConnBean();
    session.setAttribute("dbconnection", dbconn);
}

Then, I can access the object from my jsp pages without using jsp:useBean.

I am not exactly sure because I am not very much experienced with 
jsp/servlets, but this may be the reason for those 3 beans created. By the 
way, how did you find that out? How do you debug? (This may be a more 
general question as what is the best way to debug jsp/servlets? I don't 
debug yet, but I want to. I am using Forte CE. I heard about debugging in 
Tomcat using IBM VAJ, do I need to get that?)

When you don't use jsp:useBean, you better use the "type" attribute in your 
iterate tag, to get the correct object type:

<struts_logic:iterate id="element" name="testGridForm" property="data"
type="type_of_your_data_element" >

HTH,
Turgay
-----------------------------------

From: Richard Murray
Subject: RE: How do you use indexed properties with html:input?
Date: Thu, 10 May 2001 02:44:02 -0700

----------------------------------------------------------------------------
----

Hi,

I made the following changes in my Action class and got my save to work.

HttpSession session = request.getSession();
TestGridForm testGridForm = (TestGridForm)session.getAttribute(
"testGridForm" );

However, while trying to debug my problem I found I get 3 ActionForm Beans
created when I only expected 1.

In my jsp I have the following:

<jsp:useBean id="testGridForm" class="com.qspgroup.utc.TestGridForm"
scope="session" />

I have added scope="session to the logic:iterate tag e.g.
<struts_logic:iterate id="element" name="testGridForm" property="data"
scope="session" >

On the page where I display the results I also have:
<jsp:useBean id="testGridForm" class="com.qspgroup.utc.TestGridForm"
scope="session" />

I expected all the above to refer to the session scoped bean "testGridForm",
so why are 3 beans created?

Richard.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager at [EMAIL PROTECTED]

This footnote also confirms that this email message has been swept by
for the presence of computer viruses.

http://www.qspgroup.com
**********************************************************************

Reply via email to