You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by RajiR <ra...@yahoo.com> on 2008/03/12 06:52:16 UTC

How to Populate jsp with values in the database ?


-- 
View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-database---tp15998376p15998376.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How to Populate jsp with values in the database ?

Posted by RajiR <ra...@yahoo.com>.
Hi,
I doesn't mean about having access to database from jsp.What I mean is, what
is the syntax of jstl tags to reference the beans placed in the context.
    Anyways, Thanks for replies,I solved the problem by just mapping using
the attribute 'name' in <s:textfield/>.

Thanks.

dkarr wrote:
> 
> The basic idea is to have Java code in Action classes interface to your
> data sources and populate beans that are put into the contexts available
> to your JSP code.  You then forward to JSP pages that can use Struts or
> JSTL tags to reference the beans placed into the context.  Your JSP
> should not have database access code at all. 
> 
>> -----Original Message-----
>> From: RajiR [mailto:rajesware99@yahoo.com] 
>> Sent: Tuesday, March 11, 2008 10:58 PM
>> To: user@struts.apache.org
>> Subject: Re: How to Populate jsp with values in the database ?
>> 
>> 
>> HI,
>> 
>> I have inserted some 
>> values(userId,password,email,address,phoneno and id as 
>> primary key with autoincrement)  into database.After logging 
>> into the application,i have kept the userId in session and 
>> retrived remaining values by passing userId into database.And 
>> then,I have set these values to my form bean register.
>>             My Problem is I need to populate these values 
>> into a jsp page inorder to update the details.How can I use 
>> formbean.fieldname in struts2 inorder to populate.What is the 
>> syntax of using those tags?Which tags should I use, is that 
>> OGNL or JSTL and why?
>> 
>> Plzzzzzzz reply as soon as possible......waiting for your 
>> replies eagerly...
>> 
>> Thanks..
>> 
>> RajiR wrote:
>> > 
>> > 
>> > 
>> 
>> --
>> View this message in context: 
>> http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-d
> atabase---tp15998376p15998387.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-database---tp15998376p16020991.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: How to Populate jsp with values in the database ?

Posted by "Karr, David" <da...@wamu.net>.
The basic idea is to have Java code in Action classes interface to your
data sources and populate beans that are put into the contexts available
to your JSP code.  You then forward to JSP pages that can use Struts or
JSTL tags to reference the beans placed into the context.  Your JSP
should not have database access code at all. 

> -----Original Message-----
> From: RajiR [mailto:rajesware99@yahoo.com] 
> Sent: Tuesday, March 11, 2008 10:58 PM
> To: user@struts.apache.org
> Subject: Re: How to Populate jsp with values in the database ?
> 
> 
> HI,
> 
> I have inserted some 
> values(userId,password,email,address,phoneno and id as 
> primary key with autoincrement)  into database.After logging 
> into the application,i have kept the userId in session and 
> retrived remaining values by passing userId into database.And 
> then,I have set these values to my form bean register.
>             My Problem is I need to populate these values 
> into a jsp page inorder to update the details.How can I use 
> formbean.fieldname in struts2 inorder to populate.What is the 
> syntax of using those tags?Which tags should I use, is that 
> OGNL or JSTL and why?
> 
> Plzzzzzzz reply as soon as possible......waiting for your 
> replies eagerly...
> 
> Thanks..
> 
> RajiR wrote:
> > 
> > 
> > 
> 
> --
> View this message in context: 
> http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-d
atabase---tp15998376p15998387.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to Populate jsp with values in the database ?

Posted by Dave Newton <ne...@yahoo.com>.
--- RajiR <ra...@yahoo.com> wrote:
> I have set these values to my form bean register.

Form bean? In S2? Not exactly sure what you're referring to here.

> My Problem is I need to populate these values into 
> a jsp page inorder to update the details.How can I 
> use formbean.fieldname in struts2 inorder to populate.

http://struts.apache.org/2.0.11.1/docs/bootstrap.html

> What is the syntax of using those tags?

http://struts.apache.org/2.0.11.1/docs/tag-reference.html

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: How to Populate jsp with values in the database ?

Posted by RajiR <ra...@yahoo.com>.
HI,

I have inserted some values(userId,password,email,address,phoneno and id as
primary key with autoincrement)  into database.After logging into the
application,i have kept the userId in session and retrived remaining values
by passing userId into database.And then,I have set these values to my form
bean register.
            My Problem is I need to populate these values into a jsp page
inorder to update the details.How can I use formbean.fieldname in struts2
inorder to populate.What is the syntax of using those tags?Which tags should
I use, is that OGNL or JSTL and why?

Plzzzzzzz reply as soon as possible......waiting for your replies eagerly...

Thanks..

RajiR wrote:
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-Populate-jsp-with-values-in-the-database---tp15998376p15998387.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org