Ohhh my god! It works. thanks a lot. Do you think it's a good practice?
On Thu, 07 Oct 2004 09:26:50 -0400, Jeff Beal <[EMAIL PROTECTED]> wrote: > I don't see where 'p' is initialized to a Map in your Java code. > Somewhere, you need to have Map p = new java.util.HashMap(). > > > > M. Onur Tokan wrote: > > Sorry for double posting. Jeff It didn't work. It causes Null pointer > > exception. I hava a bean named BolgeDTO with a property parameters > > (java.util.Map) > > > > And the code is ; > > > > ============================ > > <html:link page="/edit.do" > > name="b" > > property="parameters"> > > Düzenle > > </html:link> > > ============================ > > while (rs.next()) > > { > > Map p=null; > > BolgeDTO bolge = new BolgeDTO(); > > bolge.setBolge(rs.getString(1)); > > bolge.setBolge_kodu_s(rs.getString(2)); > > bolge.setBolge_kodu_t(rs.getString(3)); > > bolge.setBolge_adi(rs.getString(4)); > > p.put("bolge",rs.getString(1)); > > p.put("bolge_adi",rs.getString(4)); > > bolge.setParameters(p); > > list.add(bolge); > > > > } > > if (list.size() > 0) > > request.getSession().setAttribute("bolgeler", list); > > > > > > > > On Thu, 07 Oct 2004 08:35:37 -0400, Jeff Beal <[EMAIL PROTECTED]> wrote: > > > >>For this to work, 'b' would have to be the name of a java.util.Map > >>object; instead, it is a BolgeDTO. Use the second method discussed in > >>the <html:link/> documentation: > >> > >> "Specify both name and property attributes - The specified property > >> > >> getter method will be called on the bean identified by the name (and > >> optional scope) attributes, in order to return the java.util.Map > >> containing the parameters." > >> > >>So, if you created a getMap() method on BolgeDTO, the following would work: > >> > >> <html:link action="edit" > >> name="b" property="map"> > >> Düzenle > >> </html:link> > >> > >>-- Jeff > >> > >> > >> > >>M. Onur Tokan wrote: > >> > >>>hi, > >>> > >>>I have a arraylist of BolgeDTO in request scope. I am iterating this > >>>arraylist in the code below. The problem is I want to add a "edit" > >>>button on the column. And I want to pass the whole properties to the > >>>next form so The form will contain the data from the selected row. I > >>>look at the html:link doc. It says that: > >>> > >>>"If you prefer to specify a java.util.Map that contains all of the > >>>request parameters to be added to the hyperlink, use one of the > >>>following techniques:Specify only the name attribute - The named JSP > >>>bean (optionally scoped by the value of the scope attribute) must > >>>identify a java.util.Map containing the parameters." > >>> > >>>I tried this method by adding a Map property to the DTO and set it > >>>from its constructor. But it didn't work. Any suggestions please? > >>> > >>><logic:iterate id="b" name="bolgeler"> > >>> <tr> > >>> <td> > >>> <bean:write name="b" property="bolge"/> > >>> </td> > >>> <td> > >>> <bean:write name="b" property="bolge_kodu_s"/> > >>> </td> > >>> <td> > >>> <bean:write name="b" property="bolge_kodu_t"/> > >>> </td> > >>> <td> > >>> <bean:write name="b" property="bolge_adi"/> > >>> </td> > >>> <td> > >>> <html:link action="edit" > >>> name="b"> > >>> Düzenle > >>> </html:link> > >>> </td> > >>> </tr> > >>></logic:iterate> > >>>-- > >>>Regards, > >>>M. Onur Tokan > >>> > >>> > >> > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Regards, M. Onur Tokan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]