struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Ruggles <a.rugg...@gmail.com>
Subject Re: [OT] [RANT] Re: Preparable or interceptors - is there a better mailing list than this ? some thing for total newbies.
Date Sun, 15 Apr 2007 04:26:53 GMT
Then why don't you simply pass the id of the account you want to update 
and the fields you want to update to the action.

Then create an update SQL statement like "update account set 
field1='data_from_form', field2='data2_from_form' where id='id_from_form';"

Why do you need to reload the account to update it?  If You don't pass 
an id in then you know its a new record and can issue an insert 
statement instead.

The only things you should put into a session are thing that usually 
don't change very often and are session specific.

Mansour wrote:
> I am accessing the DB using JDBC.
>
>
> Adam Ruggles wrote:
>> How are you accessing the database? JDBC, Hibernate, Another ORM 
>> solution?
>>
>> Mansour wrote:
>>> Ok Dave:
>>> you are really helping me a lot. I think I'll have to explain to you 
>>> exactly what I am doing, and you give me an advice about how to do 
>>> it. Okay?
>>>
>>> I 've been trying to learn struts 2 for a week but not doing any 
>>> significant progress. I need an program that stores accounts and 
>>> services with invoices. All I need is to be able to retrieve an 
>>> account view/add invoices , and services to each invoice.
>>> When ever, I retrieve an account I want to perform the operations of 
>>> adding or updating invoices.
>>> Now I am able to get an account (from the DB) and to view all the 
>>> invoices, but nothing more. How do I go around this?
>>>
>>> I have tried retrieving the account again (by its id) form the DB 
>>> but this is not what I want as it keeps on openning connection and 
>>> get every single from the DB every time I need to update. That's why 
>>> I asked if I have to use interceptors or implement Preparable and 
>>> sessionAware.
>>>
>>> By the way, I really appreciate your help, and in many cases you may 
>>> find my post lacks some info. The reason of this is because I am 
>>> still LEARNING and I don't know what info you need to be able to 
>>> help. So if I miss some thing, just ask.
>>>
>>>
>>> Dave Newton wrote:
>>>> --- Mansour <mansour77@yahoo.com> wrote:
>>>>  
>>>>> I thought there's a way like .net of jsf to store
>>>>>     
>>>> the
>>>>> object in the session and retrieve when needed.
>>>>>     
>>>>
>>>> Of course you can store an object in the session. You
>>>> didn't say you wanted to.
>>>>
>>>> As I said, without any information about what you're
>>>> attempting to do or if you're experiencing any
>>>> specific issues it's pretty difficult to be helpful.
>>>>
>>>> d.
>>>>
>>>>
>>>> __________________________________________________
>>>> Do You Yahoo!?
>>>> Tired of spam?  Yahoo! Mail has the best spam protection around 
>>>> http://mail.yahoo.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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>


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


Mime
View raw message