Beginner question

2011-11-11 Thread Marco Schwarz
Hi,

I'm new in this mailinglist.

I have a guestion (simple) Why a textfield disabled="true" doesn't set
his value to my object? When I set disabled="false" it works fine.

Thanks
Marco

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



Re: Beginner question

2011-11-11 Thread Marco Schwarz
Hi,

that's I understand... but I disable fields because a user doesn't
have right to change the value... and after submit the entity is
incomplete.

It's there a better method to do that?

Thanks
Marco


On Fri, Nov 11, 2011 at 10:53 PM, Dave Newton  wrote:
> Oh, I misunderstood; I thought you meant the rendered HTML.
>
> Chris is correct; disabled field values aren't sent by the browser.
>
> Sorry!
>
> On Fri, Nov 11, 2011 at 4:47 PM, Dave Newton  wrote:
>> Probably because it doesn't need to.
>>
>> Dave
>>
>> On Fri, Nov 11, 2011 at 4:43 PM, Marco Schwarz
>>  wrote:
>>> Hi,
>>>
>>> I'm new in this mailinglist.
>>>
>>> I have a guestion (simple) Why a textfield disabled="true" doesn't set
>>> his value to my object? When I set disabled="false" it works fine.
>>>
>>> Thanks
>>> Marco
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Beginner question

2011-11-11 Thread Marco Schwarz
Hi,

hidden tags and plain text solve my problem ...

I find, when I disable components via jquery, client side I'm sure to
find the same problem :-(

Thanks
Marco

On Fri, Nov 11, 2011 at 11:06 PM, Dave Newton  wrote:
> I'd either:
>
> (a) Not render it as a text field, but rather as plain text, or
> (b) Include a hidden field if the user can't edit it.
>
> There are probably other options too.
>
> Dave
>
> On Fri, Nov 11, 2011 at 5:00 PM, Marco Schwarz
>  wrote:
>> Hi,
>>
>> that's I understand... but I disable fields because a user doesn't
>> have right to change the value... and after submit the entity is
>> incomplete.
>>
>> It's there a better method to do that?
>>
>> Thanks
>> Marco
>>
>>
>> On Fri, Nov 11, 2011 at 10:53 PM, Dave Newton  wrote:
>>> Oh, I misunderstood; I thought you meant the rendered HTML.
>>>
>>> Chris is correct; disabled field values aren't sent by the browser.
>>>
>>> Sorry!
>>>
>>> On Fri, Nov 11, 2011 at 4:47 PM, Dave Newton  wrote:
>>>> Probably because it doesn't need to.
>>>>
>>>> Dave
>>>>
>>>> On Fri, Nov 11, 2011 at 4:43 PM, Marco Schwarz
>>>>  wrote:
>>>>> Hi,
>>>>>
>>>>> I'm new in this mailinglist.
>>>>>
>>>>> I have a guestion (simple) Why a textfield disabled="true" doesn't set
>>>>> his value to my object? When I set disabled="false" it works fine.
>>>>>
>>>>> Thanks
>>>>> Marco
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>>>
>>>>>
>>>>
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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



Re: Beginner question

2011-11-12 Thread Marco Schwarz
You are right, but the user must see the fields and I need the object
with all properties for call (JPA) persist method. what's the best
practice for this use case

I have one object and many roles   any role can change a different
field ... Do I create a class for any roles?

Idea?

Thanks
Marco


On Sat, Nov 12, 2011 at 7:31 PM,   wrote:
> The use of hidden fields to avoid the user changing those fields is a 
> security risk. You are still getting all the fields from the client's side, 
> so the user or somebody else (through a man-in-the-middle atytack) are still 
> able to change the value of those fields.

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



Re: Beginner question

2011-11-14 Thread Marco Schwarz
I remember I'm new with Struts2 ;-)

Why do I use Struts2/Tiles/openJPA?

openJPA: to work with database entities
tiles: to work with layouts
struts2: the action concept and the posibility to make mapping between
html and the object in my action.

example:

model:
class Person() {
  private int id;
  private String name;
  public String getName() { return name; }
  public int getId() { return id; }
  public void setName(String name) { this.name = name; }
  publci void setId(int id) { this.id = id; }
}

action:
PersonAction extends {

  private Person person;

  @override
  public String execute throws Execption {

//read Person 1 from DB
person = em.find(1, Person.class);

return SUCCESS;

  }

}

html:



When I must read the request, why do I use Struts2... Servlet do the same.

Thanks
Marco




On Mon, Nov 14, 2011 at 3:58 PM, Edward W. Rouse  wrote:
> You could always store it in the session and read it from there.
>
>> -Original Message-----
>> From: Marco Schwarz [mailto:marco.schw...@cioppino.net]
>> Sent: Saturday, November 12, 2011 1:57 PM
>> To: Struts Users Mailing List; jlm...@gmail.com
>> Subject: Re:  Beginner question
>>
>> You are right, but the user must see the fields and I need the object
>> with all properties for call (JPA) persist method. what's the best
>> practice for this use case
>>
>> I have one object and many roles   any role can change a different
>> field ... Do I create a class for any roles?
>>
>> Idea?
>>
>> Thanks
>> Marco
>>
>>
>> On Sat, Nov 12, 2011 at 7:31 PM,   wrote:
>> > The use of hidden fields to avoid the user changing those fields is a
>> security risk. You are still getting all the fields from the client's
>> side, so the user or somebody else (through a man-in-the-middle
>> atytack) are still able to change the value of those fields.
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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