You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by alexj <al...@freesurf.ch> on 2003/02/20 14:43:37 UTC
fill value from database
Hi all,
I got a trouble what's the best to do for my project :
I need to add student from an addstudent view page who
have a StudentForm bean associated.
In my view page I need to fill some datas who cames
from a database (some field like formationSelected and
durationSelected).
I want to use these datas retrieved from a database to fill a
<html:select>. But I don't know what's the best to do.
Thanks for your advice.
<--
Alexandre Jaquet
-->
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
DyanActionForm and , tags
Posted by Anand M S <an...@hotmail.com>.
Hi,
If I use DyanActionForm, how should I populate dropdown box using
<html:options> tag? we would declare all the form attributes in
struts-config.xml, how should I initialize the collection and where?
Thanks,
Anand
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: fill value from database
Posted by alexj <al...@freesurf.ch>.
> I'm a bit confused. May I used <parameter> to add a specific action to be
> used
> when a page load.
>
Like I can fill my <html:options> with an action who cam not from my
StudentForm bean and not from addstudent?
>
> May I use a case like that
>
> <action
>
> attribute="studentForm"
>
> input="/form/addstudent.jsp"
>
> name="studentForm"
>
> path="/student"
>
> type="soft.ibmss.struts.action.StudentAction">
>
> parameter="soft.ibmss.struts.formation.getFormation">
>
> <set-property property="secure" value="false" />
>
> <forward name="success" path="/form/addstudent.jsp" />
>
> </action>
>
> And then in my jsp page do something like :
>
> <html:form action="/addstudent">
>
> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
> collapse" bordercolor="#111111" width="49%" id="AutoNumber1">
>
> <tr>
>
> ....
>
> <td width="33%"><bean:message key='app.personFormationSelected'/></td>
>
> <td width="67%">
>
> <p align="center"><html:select property="formationSelected"
> size="20"/><html:options name="formations"><html:errors
> property="errors.formationSelectedRequired"></td>
>
> </tr>
>
> Where the formations came from my getFormation method ?
>
> ----- Original Message -----
> From: "alexj" <al...@freesurf.ch>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, February 20, 2003 3:46 PM
> Subject: Re: <html:select> fill value from database
>
>
> > I explain more my problem in my addstudent jsp page I got
> > some field like name, firstName, birthDate etc..
> >
> > I got some fields who needs to be filled (values from a db) when
> > a user view the page load. (in asp.net I do that with Page_Load and the
I
> > fill
> > my datas from db).
> >
> > From: "alexj" <al...@freesurf.ch>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, February 20, 2003 3:37 PM
> > Subject: Re: <html:select> fill value from database
> >
> >
> > > Wich preceding action I only got an addstudent action who receive
values
> > > from my view ?
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Affan Qureshi" <qu...@etilize.com>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > Sent: Thursday, February 20, 2003 3:29 PM
> > > Subject: Re: <html:select> fill value from database
> > >
> > >
> > > > In the preceding Action just put the values for the <select>
drop-down
> > in
> > > a
> > > > collection and set it in th erequest-scope (or the form-bean). On
the
> > JSP
> > > > use the <html:options > or <html:collection> tag to populate the
list
> > from
> > > > that collection.
> > > >
> > > > See the taglib API for details.
> > > >
> > > > Affan
> > > >
> > > > ----- Original Message -----
> > > > From: "alexj" <al...@freesurf.ch>
> > > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > > Sent: Thursday, February 20, 2003 6:43 PM
> > > > Subject: <html:select> fill value from database
> > > >
> > > >
> > > > > Hi all,
> > > > >
> > > > > I got a trouble what's the best to do for my project :
> > > > >
> > > > > I need to add student from an addstudent view page who
> > > > > have a StudentForm bean associated.
> > > > >
> > > > > In my view page I need to fill some datas who cames
> > > > > from a database (some field like formationSelected and
> > > > > durationSelected).
> > > > >
> > > > > I want to use these datas retrieved from a database to fill a
> > > > > <html:select>. But I don't know what's the best to do.
> > > > >
> > > > > Thanks for your advice.
> > > > >
> > > > > <--
> > > > > Alexandre Jaquet
> > > > > -->
> > > > >
> > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
struts-user-help@jakarta.apache.org
> > > > >
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: fill value from database
Posted by alexj <al...@freesurf.ch>.
I'm a bit confused. May I used <parameter> to add a specific action to be
used
when a page load.
Like I can fill my <html:options> with an action who can not from my
StudentForm bean ?
May I use a case like that
<action
attribute="studentForm"
input="/form/addstudent.jsp"
name="studentForm"
path="/student"
type="soft.ibmss.struts.action.StudentAction">
parameter="soft.ibmss.struts.formation.getFormation">
<set-property property="secure" value="false" />
<forward name="success" path="/form/addstudent.jsp" />
</action>
And then in my jsp page do something like :
<html:form action="/addstudent">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111" width="49%" id="AutoNumber1">
<tr>
....
<td width="33%"><bean:message key='app.personFormationSelected'/></td>
<td width="67%">
<p align="center"><html:select property="formationSelected"
size="20"/><html:options name="formations"><html:errors
property="errors.formationSelectedRequired"></td>
</tr>
Where the formations came from my getFormation method ?
----- Original Message -----
From: "alexj" <al...@freesurf.ch>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, February 20, 2003 3:46 PM
Subject: Re: <html:select> fill value from database
> I explain more my problem in my addstudent jsp page I got
> some field like name, firstName, birthDate etc..
>
> I got some fields who needs to be filled (values from a db) when
> a user view the page load. (in asp.net I do that with Page_Load and the I
> fill
> my datas from db).
>
> From: "alexj" <al...@freesurf.ch>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, February 20, 2003 3:37 PM
> Subject: Re: <html:select> fill value from database
>
>
> > Wich preceding action I only got an addstudent action who receive values
> > from my view ?
> >
> >
> >
> > ----- Original Message -----
> > From: "Affan Qureshi" <qu...@etilize.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, February 20, 2003 3:29 PM
> > Subject: Re: <html:select> fill value from database
> >
> >
> > > In the preceding Action just put the values for the <select> drop-down
> in
> > a
> > > collection and set it in th erequest-scope (or the form-bean). On the
> JSP
> > > use the <html:options > or <html:collection> tag to populate the list
> from
> > > that collection.
> > >
> > > See the taglib API for details.
> > >
> > > Affan
> > >
> > > ----- Original Message -----
> > > From: "alexj" <al...@freesurf.ch>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > Sent: Thursday, February 20, 2003 6:43 PM
> > > Subject: <html:select> fill value from database
> > >
> > >
> > > > Hi all,
> > > >
> > > > I got a trouble what's the best to do for my project :
> > > >
> > > > I need to add student from an addstudent view page who
> > > > have a StudentForm bean associated.
> > > >
> > > > In my view page I need to fill some datas who cames
> > > > from a database (some field like formationSelected and
> > > > durationSelected).
> > > >
> > > > I want to use these datas retrieved from a database to fill a
> > > > <html:select>. But I don't know what's the best to do.
> > > >
> > > > Thanks for your advice.
> > > >
> > > > <--
> > > > Alexandre Jaquet
> > > > -->
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: fill value from database
Posted by alexj <al...@freesurf.ch>.
I explain more my problem in my addstudent jsp page I got
some field like name, firstName, birthDate etc..
I got some fields who needs to be filled (values from a db) when
a user view the page load. (in asp.net I do that with Page_Load and the I
fill
my datas from db).
From: "alexj" <al...@freesurf.ch>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, February 20, 2003 3:37 PM
Subject: Re: <html:select> fill value from database
> Wich preceding action I only got an addstudent action who receive values
> from my view ?
>
>
>
> ----- Original Message -----
> From: "Affan Qureshi" <qu...@etilize.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, February 20, 2003 3:29 PM
> Subject: Re: <html:select> fill value from database
>
>
> > In the preceding Action just put the values for the <select> drop-down
in
> a
> > collection and set it in th erequest-scope (or the form-bean). On the
JSP
> > use the <html:options > or <html:collection> tag to populate the list
from
> > that collection.
> >
> > See the taglib API for details.
> >
> > Affan
> >
> > ----- Original Message -----
> > From: "alexj" <al...@freesurf.ch>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Thursday, February 20, 2003 6:43 PM
> > Subject: <html:select> fill value from database
> >
> >
> > > Hi all,
> > >
> > > I got a trouble what's the best to do for my project :
> > >
> > > I need to add student from an addstudent view page who
> > > have a StudentForm bean associated.
> > >
> > > In my view page I need to fill some datas who cames
> > > from a database (some field like formationSelected and
> > > durationSelected).
> > >
> > > I want to use these datas retrieved from a database to fill a
> > > <html:select>. But I don't know what's the best to do.
> > >
> > > Thanks for your advice.
> > >
> > > <--
> > > Alexandre Jaquet
> > > -->
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: fill value from database
Posted by alexj <al...@freesurf.ch>.
Wich preceding action I only got an addstudent action who receive values
from my view ?
----- Original Message -----
From: "Affan Qureshi" <qu...@etilize.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, February 20, 2003 3:29 PM
Subject: Re: <html:select> fill value from database
> In the preceding Action just put the values for the <select> drop-down in
a
> collection and set it in th erequest-scope (or the form-bean). On the JSP
> use the <html:options > or <html:collection> tag to populate the list from
> that collection.
>
> See the taglib API for details.
>
> Affan
>
> ----- Original Message -----
> From: "alexj" <al...@freesurf.ch>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, February 20, 2003 6:43 PM
> Subject: <html:select> fill value from database
>
>
> > Hi all,
> >
> > I got a trouble what's the best to do for my project :
> >
> > I need to add student from an addstudent view page who
> > have a StudentForm bean associated.
> >
> > In my view page I need to fill some datas who cames
> > from a database (some field like formationSelected and
> > durationSelected).
> >
> > I want to use these datas retrieved from a database to fill a
> > <html:select>. But I don't know what's the best to do.
> >
> > Thanks for your advice.
> >
> > <--
> > Alexandre Jaquet
> > -->
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: fill value from database
Posted by Affan Qureshi <qu...@etilize.com>.
In the preceding Action just put the values for the <select> drop-down in a
collection and set it in th erequest-scope (or the form-bean). On the JSP
use the <html:options > or <html:collection> tag to populate the list from
that collection.
See the taglib API for details.
Affan
----- Original Message -----
From: "alexj" <al...@freesurf.ch>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, February 20, 2003 6:43 PM
Subject: <html:select> fill value from database
> Hi all,
>
> I got a trouble what's the best to do for my project :
>
> I need to add student from an addstudent view page who
> have a StudentForm bean associated.
>
> In my view page I need to fill some datas who cames
> from a database (some field like formationSelected and
> durationSelected).
>
> I want to use these datas retrieved from a database to fill a
> <html:select>. But I don't know what's the best to do.
>
> Thanks for your advice.
>
> <--
> Alexandre Jaquet
> -->
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org