Fwd: How to preselect a radio button in Struts 2

2007-11-20 Thread Pankaj Gupta
Hey,
I tried it  out
  
     
   

But it didn't worked.
I tried
 name="users(${u_rowNum})
.access_lvl_types_id"/>
But this was also of not much  help. Sic eit didn't selected a  radio button
by default

I want by default a value of radio button to be pre selected when a jsp page
comes up.
If somebody has a solution to it.

Regards,
Pankaj










On Nov 15, 2000 8:40 PM, <[EMAIL PROTECTED] > wrote:

> the classic example sets a Map on VS referencable via var
> 
> and then obtains its list of genders by getGenders() from GenderMap
> and sets the default selection will be determined (in this case) by the
> getMale()
> 
>
> so in your case
> 
> where the name is the name of the element and
> the value getList is the the iterable source to populate the list from
> and sets the default selection will be determined (in this case) by the
> getId()
> 
>
> http://struts.apache.org/2.0.11/docs/radio.html
> M--
> - Original Message -
> Wrom: IPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQ
> To: "Struts Users Mailing List" 
> Sent: Thursday, November 15, 2007 9:01 AM
> Subject: Re: How to preselect a radio button in Struts 2
>
>
> > Here is a working example.
> >
> >  > name="users(${u_rowNum}).access_lvl_types_id"/>
> >
> > The value coming from the bean is always 1 or 2.
> >
> > HTH
> >
> > Regards,
> > Randy Burgess
> > Web Applications Developer
> > Nuvox Communications
> >
> >
> >
> > > Wrom: HYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTT
> > > Reply-To: Struts Users Mailing List < user@struts.apache.org>
> > > Date: Thu, 15 Nov 2007 11:53:53 +0530
> > > To: Struts Users Mailing List 
> > > Subject: Re: How to preselect a radio button in Struts 2
> > >
> > > Hi,
> > > I tried the same. But it didn't worked
> > >  > > list="{'Yes','No'}" value="No" required="true" />
> > > Regards,
> > > Pankaj
> > >
> > >
> > > On 11/14/07, Randy Burgess < [EMAIL PROTECTED]> wrote:
> > >>
> > >> Use the value attribute and the radio button with that value will be
> > >> selected.
> > >>
> > >> 
> > >>
> > >> Regards,
> > >> Randy Burgess
> > >> Web Applications Developer
> > >> Nuvox Communications
> > >>
> > >>
> > >>
> > >>> Wrom: ZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRT
> > >>> Reply-To: Struts Users Mailing List < user@struts.apache.org>
> > >>> Date: Wed, 14 Nov 2007 10:42:20 +0530
> > >>> To: 
> > >>> Subject: How to preselect a radio button in Struts 2
> > >>>
> > >>> Hi,
> > >>> I am working on Struts 2 and I want to preselect  a radio button.
> > >>> If somebody can let me know how to go about it.
> > >>> Regards,
> > >>> Pankaj
> > >>
> > >>
> > >>
> > >> This email and any attachments ("Message") may contain legally
> privileged
> > >> and/or confidential information.  If you are not the addressee, or if
>
> this
> > >> Message has been addressed to you in error, you are not authorized to
> read,
> > >> copy, or distribute it, and we ask that you please delete it
> (including
> all
> > >> copies) and notify the sender by return email.  Delivery of this
> Message to
> > >> any person other than the intended recipient(s) shall not be deemed a
> waiver
> > >> of confidentiality and/or a privilege.
> > >>
> > >> -
>
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> >
> >
> >
> > This email and any attachments ("Message") may contain legally
> privileged
> and/or confidential information.  If you are not the addressee, or if this
>
> Message has been addressed to you in error, you are not authorized to
> read,
> copy, or distribute it, and we ask that you please delete it (including
> all
> copies) and notify the sender by return email.  Delivery of this Message
> to
> any person other than the intended recipient(s) shall not be deemed a
> waiver
> of confidentiality and/or a privilege.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>


Re: jQuery plugin for Struts 2?

2007-11-20 Thread Nuwan Chandrasoma

i would like to see one :)

emartin24 wrote:

Ted Husted wrote:
  

On Nov 20, 2007 1:53 PM,   wrote:


I've been working with Struts 2 for a few months and have some questions
that I was hoping you would be interested in discussing with me.

I see that Struts 2 uses Dojo for it's Ajax capabilities. I prefer jQuery
and have contemplated
making a jQuery plugin for Struts 2, to use instead of Dojo. I'd also
like to utilize JSON as
 the interchange for my Ajax transactions.

I checked out your presentation about the YUI plugin...which is why I'm
sending this
question to you. What all is required to create a plugin? Do you think it
is worth the time and
 effort to create a jQuery plugin? Or, do you think that I'd be better
off just using the Dojo for
the core stuff and then using jQuery on top of that?

I'm just trying to get a feel for what all is involved and if it would be
something useful. I know
you are a very busy person and I appreciate any input you'd be willing to
give.

Regards,
  

The Ajax plugin approach is useful when someone wants to keep Ajax at
arms-length and let a magical taglib handle the JavaScript vodoo. But,
a plugin is NOT required to use Ajax with Struts 2!

Struts 2 works just fine with plain Ajax library out-of-the-box. We
updated the Ajax page recently to help make this point more clear.

 * http://struts.apache.org/2.x/docs/ajax.html

The bottom line is that if you're savvy enough to even have a Ajax
preference, then you probably want to just use JQuery and Struts
without the "training wheels".

-Ted.




Thanks Ted.

Anyone else out there interested in a jQuery plugin? =) If so, I'd love to
hear from you!

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jQuery plugin for Struts 2?

2007-11-20 Thread emartin24


Ted Husted wrote:
> 
> On Nov 20, 2007 1:53 PM,   wrote:
>> I've been working with Struts 2 for a few months and have some questions
>> that I was hoping you would be interested in discussing with me.
>>
>> I see that Struts 2 uses Dojo for it's Ajax capabilities. I prefer jQuery
>> and have contemplated
>> making a jQuery plugin for Struts 2, to use instead of Dojo. I'd also
>> like to utilize JSON as
>>  the interchange for my Ajax transactions.
>>
>> I checked out your presentation about the YUI plugin...which is why I'm
>> sending this
>> question to you. What all is required to create a plugin? Do you think it
>> is worth the time and
>>  effort to create a jQuery plugin? Or, do you think that I'd be better
>> off just using the Dojo for
>> the core stuff and then using jQuery on top of that?
>>
>> I'm just trying to get a feel for what all is involved and if it would be
>> something useful. I know
>> you are a very busy person and I appreciate any input you'd be willing to
>> give.
>>
>> Regards,
> 
> The Ajax plugin approach is useful when someone wants to keep Ajax at
> arms-length and let a magical taglib handle the JavaScript vodoo. But,
> a plugin is NOT required to use Ajax with Struts 2!
> 
> Struts 2 works just fine with plain Ajax library out-of-the-box. We
> updated the Ajax page recently to help make this point more clear.
> 
>  * http://struts.apache.org/2.x/docs/ajax.html
> 
> The bottom line is that if you're savvy enough to even have a Ajax
> preference, then you probably want to just use JQuery and Struts
> without the "training wheels".
> 
> -Ted.
> 

Thanks Ted.

Anyone else out there interested in a jQuery plugin? =) If so, I'd love to
hear from you!

-- 
View this message in context: 
http://www.nabble.com/Re%3A-jQuery-plugin-for-Struts-2--tf4846722.html#a13870822
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Having query on action chaining

2007-11-20 Thread vijay vijay
Hi,
 i am want to work on action chaining can any one give me links for
it.

vijay


Re: Problem with struts2 iterator and ognl

2007-11-20 Thread sagarlotiya

Hi,
"not going through the action " means that, directly set on "Model bean"
without going through action.
Otherewise what happen, first we have to get the value in our action using
reqest.getParameter() or through getter/setter using paramPrepareParamStack
and then set these values on "Model" from that action but i don't want to do
that through ognl we can directly set the value on "Model" right ? It works
fine for all cases but when if we will use Iterator at that time it creates
problem.


newton.dave wrote:
> 
> What do you mean by "not going through the action"?
> 
> d.
> 
> --- sagarlotiya <[EMAIL PROTECTED]> wrote:
> 
>> 
>> Hi,
>> I have a iterator and i am loop through it in my jsp
>> file and iterator
>> contains textbox.
>> Problem occurs when i am try to set the values
>> directly on "Model" through
>> ognl.
>> any one has idea how to do that ?
>> 
>> e.g.
>> > status="stat">
>> > value="%{#product.quantity}">
>> 
>> 
>> when i am trying to set the value through ognl
>> directly on model without
>> going through action it didn't set it through ognl.
>> 
>> can any one tell me the solution?
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/Problem-with-struts2-iterator-and-ognl-tf4842578.html#a13854424
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>>
> -
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-struts2-iterator-and-ognl-tf4842578.html#a13870755
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA + AJAX" tutorial

2007-11-20 Thread Dave Newton
--- Lewis Li <[EMAIL PROTECTED]> wrote:
> I can't believe the officical Struts 2 tutorial has
> such a silly error. Did the tutorial authors ever 
> try running the script themselves?

Everybody runs under different environments, different
settings, different toolchains, etc. The framework and
its documentation are the product of volunteers.

Errors in documentation may be brought up here, but
filing a JIRA [1] will increase the likelihood that
bugs and errors will be looked at (and possibly
fixed). You may also lend a hand either at the public
wiki [2] or on the official documentation wiki [3] 
after filing a CLA.

d.

[1] https://issues.apache.org/struts/browse/WW
[2] http://cwiki.apache.org/S2WIKI/home.html
[3] http://cwiki.apache.org/WW/home.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA + AJAX" tutorial

2007-11-20 Thread Lewis Li

Thanks, Dave. It finally works now.
I can't believe the officical Struts 2 tutorial has such a silly error. Did 
the tutorial authors ever try running the script themselves?


Lewis
- Original Message - 
From: "Dave Newton" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Wednesday, November 21, 2007 11:12 AM
Subject: Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA 
+ AJAX" tutorial




Remove all the single quotes and try; it works for me
fine that way.

MySQL documentation is available
http://dev.mysql.com/doc/#manual.

d. 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA + AJAX" tutorial

2007-11-20 Thread Dave Newton
Remove all the single quotes and try; it works for me
fine that way.

MySQL documentation is available
http://dev.mysql.com/doc/#manual.

d.

--- Lewis Li <[EMAIL PROTECTED]> wrote:

> Yes, I created a database named "quickstart" before
> running the script. A 
> database is the same as a schema.
> Can you successfully run the script with your MySql?
> 
> Lewis
> - Original Message - 
> From: "Musachy Barroso" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> 
> Sent: Tuesday, November 20, 2007 9:59 PM
> Subject: Re: Problem running the MySQL script in
> "Struts 2 + Spring 2 + JPA 
> + AJAX" tutorial
> 
> 
> > Do you have a "quickstart" schema in your db?
> >
> > musachy
> >
> > On Nov 20, 2007 12:43 AM, Lewis Li
> <[EMAIL PROTECTED]> wrote:
> >> Hi! I'm doing the tutorial "Struts 2 + Spring 2 +
> JPA + AJAX" located at
> >>
>
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
> >> I have installed and configured MySQL and created
> a database named
> >> "quickstart". But I get a syntax error when
> running this script:
> >> CREATE TABLE 'quickstart'.'Person' (
> >>   'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
> >>   'firstName' VARCHAR(45) NOT NULL,
> >>   'lastName' VARCHAR(45) NOT NULL,
> >>   PRIMARY KEY('id')
> >> )
> >> ENGINE = InnoDB;This is exactly the same script
> from the tutorial. The 
> >> error
> >> report reported by MySQL Query Browser is:
> >> You have an error in your SQL syntax; check the
> manual that corresponds 
> >> to
> >> your MySQL server version for the right syntax to
> use near
> >> ''quickstart'.'Person' (
> >>   'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
> >>   'fi' at line 1
> >>
> >> I really can't figure out what's wrong with the
> script. I'm running this
> >> version of MySQL on a Windows XP computer:
> >> Server version: 5.0.41-community-nt MySQL
> Community Edition (GPL)
> >> I'd really appreciate it if anyone could help me
> out. Thank you. 
> 
> 
>
-
> 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]



Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA + AJAX" tutorial

2007-11-20 Thread Lewis Li
Yes, I created a database named "quickstart" before running the script. A 
database is the same as a schema.

Can you successfully run the script with your MySql?

Lewis
- Original Message - 
From: "Musachy Barroso" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Tuesday, November 20, 2007 9:59 PM
Subject: Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA 
+ AJAX" tutorial




Do you have a "quickstart" schema in your db?

musachy

On Nov 20, 2007 12:43 AM, Lewis Li <[EMAIL PROTECTED]> wrote:

Hi! I'm doing the tutorial "Struts 2 + Spring 2 + JPA + AJAX" located at
http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
I have installed and configured MySQL and created a database named
"quickstart". But I get a syntax error when running this script:
CREATE TABLE 'quickstart'.'Person' (
  'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  'firstName' VARCHAR(45) NOT NULL,
  'lastName' VARCHAR(45) NOT NULL,
  PRIMARY KEY('id')
)
ENGINE = InnoDB;This is exactly the same script from the tutorial. The 
error

report reported by MySQL Query Browser is:
You have an error in your SQL syntax; check the manual that corresponds 
to

your MySQL server version for the right syntax to use near
''quickstart'.'Person' (
  'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  'fi' at line 1

I really can't figure out what's wrong with the script. I'm running this
version of MySQL on a Windows XP computer:
Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
I'd really appreciate it if anyone could help me out. Thank you. 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: user Digest 20 Nov 2007 22:05:01 -0000 Issue 7714

2007-11-20 Thread Dave Newton
Consider creating a more descriptive subject line.

--- Adrian Marrero <[EMAIL PROTECTED]> wrote:
> struts-config.xml
>  type="java.lang.String" />

I thought you wanted an array?

> CustomData cd = (CustomData)form;
> String [] attr = cd.getSelectedAttributes();
> out.println("Selected attributes size: " +
> attr.length);
> out.println("Selected attributes data: " + attr[0]);
> --
> 
> output
> --
> Selected attributes size: 1
> Selected attributes data:
> [Ljava.lang.String;@18170f98

Ljava.langString *is* an array of String.

d.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: user Digest 20 Nov 2007 22:05:01 -0000 Issue 7714

2007-11-20 Thread Adrian Marrero
Hi,

I am having difficulty using struts:


Goal:
I would like to be able to select multiple fields from the drop down
box, retrieve them in my servlet, and use them elsewhere.

Problem:
When I retrieve the String [] in my servlet and I view its contained
information; what I have is a String [] of length = 1 and of type
Ljava.lang.String, regardless of how many selections I make in the
drop down box.

Code:

customProperties.jsp
-

  
-


struts-config.xml
-

-

CustomData.java (Bean in use)
-
private String [] selectedAttributes;

public String [] getSelectedAttributes()
{ return this.selectedAttributes;}

public void setSelectedAttributes(String [] selectedAttributes)
{ this.selectedAttributes = selectedAttributes; }
--

CustomizeAction.java (Servlet)
--
CustomData cd = (CustomData)form;
String [] attr = cd.getSelectedAttributes();
out.println("Selected attributes size: " + attr.length);
out.println("Selected attributes data: " + attr[0]);
--

output
--
Selected attributes size: 1
Selected attributes data: [Ljava.lang.String;@18170f98
--

Does anyone have an idea of what I can do to retrieve in the servlet
the values that I selected from the drop down menu on the jsp page?
Any suggestions would be really appreciated. Thank you in advance for
you help.

Adrian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jQuery plugin for Struts 2?

2007-11-20 Thread Dave Newton
FWIW, I'm working on a minimal jQuery plugin that
should be up on GoogleCode within a couple of weeks,
including some jQueryUI support.

d.

--- Ted Husted <[EMAIL PROTECTED]> wrote:

> On Nov 20, 2007 1:53 PM,   wrote:
> > I've been working with Struts 2 for a few months
> and have some questions that I was hoping you would
> be interested in discussing with me.
> >
> > I see that Struts 2 uses Dojo for it's Ajax
> capabilities. I prefer jQuery and have contemplated
> > making a jQuery plugin for Struts 2, to use
> instead of Dojo. I'd also like to utilize JSON as
> >  the interchange for my Ajax transactions.
> >
> > I checked out your presentation about the YUI
> plugin...which is why I'm sending this
> > question to you. What all is required to create a
> plugin? Do you think it is worth the time and
> >  effort to create a jQuery plugin? Or, do you
> think that I'd be better off just using the Dojo for
> > the core stuff and then using jQuery on top of
> that?
> >
> > I'm just trying to get a feel for what all is
> involved and if it would be something useful. I know
> > you are a very busy person and I appreciate any
> input you'd be willing to give.
> >
> > Regards,
> 
> The Ajax plugin approach is useful when someone
> wants to keep Ajax at
> arms-length and let a magical taglib handle the
> JavaScript vodoo. But,
> a plugin is NOT required to use Ajax with Struts 2!
> 
> Struts 2 works just fine with plain Ajax library
> out-of-the-box. We
> updated the Ajax page recently to help make this
> point more clear.
> 
>  * http://struts.apache.org/2.x/docs/ajax.html
> 
> The bottom line is that if you're savvy enough to
> even have a Ajax
> preference, then you probably want to just use
> JQuery and Struts
> without the "training wheels".
> 
> -Ted.
> 
>
-
> 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]



Re: [s2] Prepare and Parameter Interceptors

2007-11-20 Thread Gary Affonso

Mark Steyn wrote:

Thanks for your help Gary.  I got to the bottom of the problem, or at
least got around it in the end.

After Struts created objects based on the submitted form values, I was
using the ids of those objects to create corresponding objects
instantiated with values from a database.  I then used the action's
setters to replace the objects created by Struts.  It seems that part
caused the problem.  Rather than replacing objects, I copied back the
properties instead and it works.


Good to hear you have it working.

Sounds like you're doing something like this...

  Form
  
  
  

  Action
  --
  private MyObject myObject;
  public ... myObject setter ...
  public ... myObject getter ...

The first params pass creates one so that it can set the Id (and the 
name), you go take that ID go get the real object, replace the one 
auto-created (or at least replace it's property values), and then the 
2nd params pass sets the values on that newly instantiated object.


That's the workflow you're using, right?

I find that confusing, what I do instead is this...

  Form
  
  
  

  Action
  --
  private Long id;
  public ... id setter ...
  public ... id getter ...

  private MyObject myObject;
  public ... myObject setter ...
  public ... myObject getter ...

That way with the first params pass I'm sucking the ID into a separate 
and distinct property on the action (not letting OGNL create an object 
and setting the property that way).


Then I take the Id, go get the object, set myObject to that newly 
retrieved object and let the 2nd pass inject into it.


I just find *not* using a domain object to suck in all my IDs in the 
first pass is a little less confusing.  But maybe that's me.  You 
clearly get the idea of how the params/prapre/params sandwich works, 
from there it's just preferences.


- Gary

P.S.  As noted in another thread, keep in mind that you can do all of 
this without the interceptor sandwich.  You can do this with the 
conversion portion of the framework, and you can also do this by simply 
coding more sophisticated getters/setters.  It's really up to you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jQuery plugin for Struts 2?

2007-11-20 Thread Ted Husted
On Nov 20, 2007 1:53 PM,   wrote:
> I've been working with Struts 2 for a few months and have some questions that 
> I was hoping you would be interested in discussing with me.
>
> I see that Struts 2 uses Dojo for it's Ajax capabilities. I prefer jQuery and 
> have contemplated
> making a jQuery plugin for Struts 2, to use instead of Dojo. I'd also like to 
> utilize JSON as
>  the interchange for my Ajax transactions.
>
> I checked out your presentation about the YUI plugin...which is why I'm 
> sending this
> question to you. What all is required to create a plugin? Do you think it is 
> worth the time and
>  effort to create a jQuery plugin? Or, do you think that I'd be better off 
> just using the Dojo for
> the core stuff and then using jQuery on top of that?
>
> I'm just trying to get a feel for what all is involved and if it would be 
> something useful. I know
> you are a very busy person and I appreciate any input you'd be willing to 
> give.
>
> Regards,

The Ajax plugin approach is useful when someone wants to keep Ajax at
arms-length and let a magical taglib handle the JavaScript vodoo. But,
a plugin is NOT required to use Ajax with Struts 2!

Struts 2 works just fine with plain Ajax library out-of-the-box. We
updated the Ajax page recently to help make this point more clear.

 * http://struts.apache.org/2.x/docs/ajax.html

The bottom line is that if you're savvy enough to even have a Ajax
preference, then you probably want to just use JQuery and Struts
without the "training wheels".

-Ted.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S2] Tooltip and simple theme

2007-11-20 Thread Jim Cushing
You can use the "title" property, which generates a title attribute in  
the HTML. Most browsers will render this like a tool tip when the user  
hovers over the element.


On Nov 20, 2007, at 4:21 PM, Jiang, Jane (NIH/NCI) [C] wrote:


Hi,

I have an application developed ready for test.  Now I have added
requirement for tooltips for a few components.  I just noticed that
tooltip is only available in xhmtl theme.  How should I implement
tooltips in simple theme?

Thanks a lot for your help,

Jane

-Original Message-
From: Stefano Greco [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 9:55 AM
To: Struts Users Mailing List
Subject: Re: [S2] autocompler + ajax in 2.0.11

I think in the URL

http://struts.apache.org/2.x/docs/ajax-tags.html

say how work in 2.1
but I suppose Ajax should work since 2.0

Stefano


- Original Message -
From: "Dave Newton" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Friday, November 16, 2007 3:43 PM
Subject: RE: [S2] autocompler + ajax in 2.0.11



Ajax has been working for quite awhile in S2.0, it's
just better in 2.1.

d.

--- "Hernandez, David" <[EMAIL PROTECTED]>
wrote:



Does it work at all? I thought no ajax tags would
work until version 2.1
. . .

-Original Message-
From: Stefano Greco [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 9:08 AM
To: user@struts.apache.org
Subject: [S2] autocompler + ajax in 2.0.11

Hi,
I'm using autocompler with ajax theme
as in this example:


   
  ...
   
   ..
   
   
   
   
   
   
   



If I put theme="ajax" as attribute of autocompleter
tag as the example
the label is not visible in HTML rendered.

I I dont use the attribute theme in the tag
autocomplet it doesnt work
very well especially for the attribute
loadOnTextChange="true"
loadMinimumCount="3" showDownArrow="false"
that aren't rendered in HTML result.

I think it's a BUG?
Or it's a my mystake?





-

To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]

- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -

This message is intended only for the personal and
confidential use of the designated recipient(s)
named above.  If you are not the intended recipient
of this message you are hereby notified that any
review, dissemination, distribution or copying of
this message is strictly prohibited.  This
communication is for information purposes only and
should not be regarded as an offer to sell or as a
solicitation of an offer to buy any financial
product, an official confirmation of any
transaction, or as an official statement of Lehman
Brothers.  Email transmission cannot be guaranteed
to be secure or error-free.  Therefore, we do not
represent that this information is complete or
accurate and it should not be relied upon as such.
All information is subject to change without notice.


IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax
matters contained within this communication
(including any attachments) is not intended or
written to be used and cannot be used for the
purpose of (i) avoiding U.S. tax related penalties
or (ii) promoting, marketing or recommending to
another party any transaction or matter addressed
herein.





-

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]





-
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]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [S2] Tooltip and simple theme

2007-11-20 Thread Hernandez, David

I would try rendering with XHTML and then copying and pasting the
resultant Tooltip code into my simple themed page. 

-Original Message-
From: Jiang, Jane (NIH/NCI) [C] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 20, 2007 4:22 PM
To: Struts Users Mailing List
Subject: [S2] Tooltip and simple theme

Hi,

I have an application developed ready for test.  Now I have added
requirement for tooltips for a few components.  I just noticed that
tooltip is only available in xhmtl theme.  How should I implement
tooltips in simple theme?  

Thanks a lot for your help,

Jane

-Original Message-
From: Stefano Greco [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 9:55 AM
To: Struts Users Mailing List
Subject: Re: [S2] autocompler + ajax in 2.0.11

I think in the URL

http://struts.apache.org/2.x/docs/ajax-tags.html

say how work in 2.1
but I suppose Ajax should work since 2.0

Stefano


- Original Message -
From: "Dave Newton" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Friday, November 16, 2007 3:43 PM
Subject: RE: [S2] autocompler + ajax in 2.0.11


> Ajax has been working for quite awhile in S2.0, it's
> just better in 2.1.
> 
> d.
> 
> --- "Hernandez, David" <[EMAIL PROTECTED]>
> wrote:
> 
>> 
>> Does it work at all? I thought no ajax tags would
>> work until version 2.1
>> . . . 
>> 
>> -Original Message-
>> From: Stefano Greco [mailto:[EMAIL PROTECTED] 
>> Sent: Friday, November 16, 2007 9:08 AM
>> To: user@struts.apache.org
>> Subject: [S2] autocompler + ajax in 2.0.11
>> 
>> Hi,
>> I'm using autocompler with ajax theme
>> as in this example:
>> 
>> 
>> 
>>...
>> 
>> ..
>> 
>> 
>> 
>> > value="/getTeams.action"/>
>> > key="label.team"
>> href="%{getTeams}"
>>theme="ajax" autoComplete="true"
>> loadOnTextChange="true"
>>loadMinimumCount="3"
>> showDownArrow="false" />
>> 
>> 
>> 
>> 
>> 
>> If I put theme="ajax" as attribute of autocompleter
>> tag as the example
>> the label is not visible in HTML rendered.
>> 
>> I I dont use the attribute theme in the tag
>> autocomplet it doesnt work
>> very well especially for the attribute 
>> loadOnTextChange="true"
>> loadMinimumCount="3" showDownArrow="false"
>> that aren't rendered in HTML result.
>> 
>> I think it's a BUG?
>> Or it's a my mystake?
>> 
>> 
>> 
>>
> -
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> 
>> - - - - - - - - - - - - - - - - - - - - - - - - - -
>> - - - - - - - - - - - - - - - - - -
>> 
>> This message is intended only for the personal and
>> confidential use of the designated recipient(s)
>> named above.  If you are not the intended recipient
>> of this message you are hereby notified that any
>> review, dissemination, distribution or copying of
>> this message is strictly prohibited.  This
>> communication is for information purposes only and
>> should not be regarded as an offer to sell or as a
>> solicitation of an offer to buy any financial
>> product, an official confirmation of any
>> transaction, or as an official statement of Lehman
>> Brothers.  Email transmission cannot be guaranteed
>> to be secure or error-free.  Therefore, we do not
>> represent that this information is complete or
>> accurate and it should not be relied upon as such. 
>> All information is subject to change without notice.
>> 
>> 
>> IRS Circular 230 Disclosure:
>> Please be advised that any discussion of U.S. tax
>> matters contained within this communication
>> (including any attachments) is not intended or
>> written to be used and cannot be used for the
>> purpose of (i) avoiding U.S. tax related penalties
>> or (ii) promoting, marketing or recommending to
>> another party any transaction or matter addressed
>> herein.
>> 
>> 
>> 
>>
> -
>> 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]
> 
> 
>

-
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]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - -

This message is intended only for the personal and confidential use of the 
designated recipient(s) named above.  If you are not the intended recipient of 
this message you are hereby notified that any review, dissemination, 
distribution or copying of this

[S2] Tooltip and simple theme

2007-11-20 Thread Jiang, Jane (NIH/NCI) [C]
Hi,

I have an application developed ready for test.  Now I have added
requirement for tooltips for a few components.  I just noticed that
tooltip is only available in xhmtl theme.  How should I implement
tooltips in simple theme?  

Thanks a lot for your help,

Jane

-Original Message-
From: Stefano Greco [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 16, 2007 9:55 AM
To: Struts Users Mailing List
Subject: Re: [S2] autocompler + ajax in 2.0.11

I think in the URL

http://struts.apache.org/2.x/docs/ajax-tags.html

say how work in 2.1
but I suppose Ajax should work since 2.0

Stefano


- Original Message - 
From: "Dave Newton" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Friday, November 16, 2007 3:43 PM
Subject: RE: [S2] autocompler + ajax in 2.0.11


> Ajax has been working for quite awhile in S2.0, it's
> just better in 2.1.
> 
> d.
> 
> --- "Hernandez, David" <[EMAIL PROTECTED]>
> wrote:
> 
>> 
>> Does it work at all? I thought no ajax tags would
>> work until version 2.1
>> . . . 
>> 
>> -Original Message-
>> From: Stefano Greco [mailto:[EMAIL PROTECTED] 
>> Sent: Friday, November 16, 2007 9:08 AM
>> To: user@struts.apache.org
>> Subject: [S2] autocompler + ajax in 2.0.11
>> 
>> Hi,
>> I'm using autocompler with ajax theme
>> as in this example:
>> 
>> 
>> 
>>...
>> 
>> ..
>> 
>> 
>> 
>> > value="/getTeams.action"/>
>> > key="label.team"
>> href="%{getTeams}"
>>theme="ajax" autoComplete="true"
>> loadOnTextChange="true"
>>loadMinimumCount="3"
>> showDownArrow="false" />
>> 
>> 
>> 
>> 
>> 
>> If I put theme="ajax" as attribute of autocompleter
>> tag as the example
>> the label is not visible in HTML rendered.
>> 
>> I I dont use the attribute theme in the tag
>> autocomplet it doesnt work
>> very well especially for the attribute 
>> loadOnTextChange="true"
>> loadMinimumCount="3" showDownArrow="false"
>> that aren't rendered in HTML result.
>> 
>> I think it's a BUG?
>> Or it's a my mystake?
>> 
>> 
>> 
>>
> -
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> 
>> - - - - - - - - - - - - - - - - - - - - - - - - - -
>> - - - - - - - - - - - - - - - - - -
>> 
>> This message is intended only for the personal and
>> confidential use of the designated recipient(s)
>> named above.  If you are not the intended recipient
>> of this message you are hereby notified that any
>> review, dissemination, distribution or copying of
>> this message is strictly prohibited.  This
>> communication is for information purposes only and
>> should not be regarded as an offer to sell or as a
>> solicitation of an offer to buy any financial
>> product, an official confirmation of any
>> transaction, or as an official statement of Lehman
>> Brothers.  Email transmission cannot be guaranteed
>> to be secure or error-free.  Therefore, we do not
>> represent that this information is complete or
>> accurate and it should not be relied upon as such. 
>> All information is subject to change without notice.
>> 
>> 
>> IRS Circular 230 Disclosure:
>> Please be advised that any discussion of U.S. tax
>> matters contained within this communication
>> (including any attachments) is not intended or
>> written to be used and cannot be used for the
>> purpose of (i) avoiding U.S. tax related penalties
>> or (ii) promoting, marketing or recommending to
>> another party any transaction or matter addressed
>> herein.
>> 
>> 
>> 
>>
> -
>> 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]
> 
> 
>

-
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]



[S2] How to forward to another struts mapping

2007-11-20 Thread alexworden

Hi,

I'm trying to process a request to URL-A with Action-A, then display a home
page of URL-B in Struts 2. However, in order to display the view of URL-B, I
need to invoke Action-B first. I also want any ActionErrors from Action-A to
be present in the view of URL-B. 

How do I do this? It used to be simple in Struts-1, but I can't figure it
out for Struts2. 

Thanks,

Alex
-- 
View this message in context: 
http://www.nabble.com/-S2--How-to-forward-to-another-struts-mapping-tf4846285.html#a13865418
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: combining Struts-2 with Struts-1 application.

2007-11-20 Thread Leena Borle
Hi,
  I followed simple approach suggested by Ted which says,
"The simplest thing is to let the Struts 1 portion answer the *.do URIs
and let the Struts 2 portion answer the *.action URIs. Everyone can
share session and application scope as needed. One page can submit to
the other portion, just include the extension as part of the URI, as
if you were calling a HTML page."

I am am having some issues with it. I have put URL of S1 application
inside the TabbedPane of S2. It displays S1, but as soon as I click on it,
browser refreshes with showing only S1 application. I want it running inside
my TabbedPane of S2 application. Is this approach of mine correct or do I
need something else. I need S1 application to be running inside Struts 2
without refreshing window and loosing control of S2.

  Do you think portlet will work ? I am not familiar with portlets and how
struts and portlets work ?

  I am kind of confused about how to go with this.I would really appreciate
any help.
Thanks,
Leena


Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2007-11-20 Thread Musachy Barroso
yeah, kudos to Ian. I should try writing one so I could have a fancy
signature ;)

musachy

On Nov 20, 2007 2:04 PM, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> Congratulations Ian!  I know how it feels to finally finish such an
> undertaking and see the end result.  Kudos!
>
> I'm sure it's a fantastic book too (wink-wink).
>
> Frank
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: [EMAIL PROTECTED]
> Author of "Practical Ajax Projects With Java Technology"
>  (2006, Apress, ISBN 1-59059-695-1)
> and "JavaScript, DOM Scripting and Ajax Projects"
>  (2007, Apress, ISBN 1-59059-816-4)
> Java Web Parts - http://javawebparts.sourceforge.net
>  Supplying the wheel, so you don't have to reinvent it!
> (technical reviewer of "Practical Apache Struts2 Web 2.0 Projects" - LOL)
>
>
> On Tue, November 20, 2007 1:31 pm, Ian Roughley wrote:
> > I'm pleased to announce the release of my newest book, "Practical Apache
> > Struts2 Web 2.0 project".  And, no, I didn't pick the name :-)
> >
> > Where "Starting Struts2" was high level and provided pointers for
> > further exploration, this book dives deep into the framework providing a
> > practical guide and lots of code examples for developing web application
> > using Struts2.  For those that are new to the framework, there is
> > information on getting started, the request/response life cycle, and
> > architecture and configuration (XML and zero configuration/annotation).
> > And for those that are familiar with Struts2, more advanced topics such
> > as security (yes, container, custom and Acegi are all provided with
> > example code), workflows/wizards, RESTful web services, and Ajax are
> > covered.
> >
> > For more information, the Apress web site is
> > http://www.apress.com/book/view/9781590599037.  I also believe it will
> > be available through most major bookstores.
> >
> > /Ian
> >
> > --
> > Ian Roughley
> > From Down & Around, Inc.
> > Consulting * Training / Mentoring * Agile Process * Open Source
> > web: http://www.fdar.com - email: [EMAIL PROTECTED]
> >
> >
> > -
> > 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]
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [s2] Prepare and Parameter Interceptors

2007-11-20 Thread Mark Steyn
Thanks for your help Gary.  I got to the bottom of the problem, or at
least got around it in the end.

After Struts created objects based on the submitted form values, I was
using the ids of those objects to create corresponding objects
instantiated with values from a database.  I then used the action's
setters to replace the objects created by Struts.  It seems that part
caused the problem.  Rather than replacing objects, I copied back the
properties instead and it works.

Mark

-Original Message-
From: Gary Affonso [mailto:[EMAIL PROTECTED] 
Sent: 19 November 2007 16:34
To: Struts Users Mailing List
Subject: Re: [s2] Prepare and Parameter Interceptors

You've got the interceptor setup order correct.  You haven't really 
provided enough info to really identify another other problems (we'd 
need to see the form fields, the action, and the object being exposed 
and hydrated in the action.)

But here are some things you can try...

1) turn on debugging for *both* struts and xwork...




... and then submit your form to your action.  This will give you 
detailed info as s2/xwork attempt to find and set values on your
properties.

2) Be sure that your action has provided a setter for the recently 
hydrated object.

3) Be sure your form fields reference the hydrated object and its 
properties with a valid OGNL expression...



(note the "myObject." prefix)

4) An alternative to steps #2 and #3 is ModelDriven
A waste of effort, IMO, but that's another way you can expose your 
recently hydrated object to the form.  You would not need the 
"myObject." prefix on your fieldnames or a setter in the Action for that

object if you use ModelDriven.

---

If none of that does the trick, you'll need to provide more detail, I'm 
out of guesses. :-)

- Gary

Mark Steyn wrote:
> I'm trying to use the Prepare interceptor in conjunction with the
> Parameters interceptor to create objects from persistent storage
before
> Struts 2 sets their properties based on values posted from a form, as
> suggested in
> http://struts.apache.org/2.0.11/docs/prepare-interceptor.html
> 
>  
> 
> My understanding of the steps involved is as follows:
> 
>  
> 
> 1. The ParametersInterceptor creates objects based on the values
posted
> to the form.
> 
> 2. The prepare method called by the PrepareInterceptor replaces those
> objects with objects instantiated from a database.
> 
> 3. The ParametersInterceptor is called again, updating the objects
> constructed from the database with the values posted in the form.
> 
>  
> 
> The first 2 steps work fine, but not the 3rd.
> 
>  
> 
> The Parameters interceptor is definitely being called before and after
> the Prepare interceptor, but the second call doesn't set the
properties
> of the objects created in step 2.
> 
>  
> 
> The intercept stack for the my is:
> 
>  
> 
> 
> 
> 
> 
> true
> 
> 
> 
> 
> 
>   
> 
> 
> 
> true
> 
> 
> 
>  
> 
> Am I overlooking something, or is there something else I need to do?
> 
>  
> 
> Thanks,
> 
> Mark
> 
> 


-
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]



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2007-11-20 Thread Frank W. Zammetti
Congratulations Ian!  I know how it feels to finally finish such an
undertaking and see the end result.  Kudos!

I'm sure it's a fantastic book too (wink-wink).

Frank

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
and "JavaScript, DOM Scripting and Ajax Projects"
 (2007, Apress, ISBN 1-59059-816-4)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!
(technical reviewer of "Practical Apache Struts2 Web 2.0 Projects" - LOL)

On Tue, November 20, 2007 1:31 pm, Ian Roughley wrote:
> I'm pleased to announce the release of my newest book, "Practical Apache
> Struts2 Web 2.0 project".  And, no, I didn't pick the name :-)
>
> Where "Starting Struts2" was high level and provided pointers for
> further exploration, this book dives deep into the framework providing a
> practical guide and lots of code examples for developing web application
> using Struts2.  For those that are new to the framework, there is
> information on getting started, the request/response life cycle, and
> architecture and configuration (XML and zero configuration/annotation).
> And for those that are familiar with Struts2, more advanced topics such
> as security (yes, container, custom and Acegi are all provided with
> example code), workflows/wizards, RESTful web services, and Ajax are
> covered.
>
> For more information, the Apress web site is
> http://www.apress.com/book/view/9781590599037.  I also believe it will
> be available through most major bookstores.
>
> /Ian
>
> --
> Ian Roughley
> From Down & Around, Inc.
> Consulting * Training / Mentoring * Agile Process * Open Source
> web: http://www.fdar.com - email: [EMAIL PROTECTED]
>
>
> -
> 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]



Struts 2 Session Timeout

2007-11-20 Thread Richard Sayre
I noticed while developing my application that Struts 2 (I think) will
recreate your session when it times out.

I have several name spaces used in my packages such as:

1.  /Admin
2. /Design
3. /

While I am hitting actions in the /Admin or /Design area of my
application, if the session times out I am redirected back to my main
page with a restored session.  If any of the link point to / then the
session does not get restored.

How can I restore the session in the / name space?  Is there any
reason why this is not happening for the / name space?

Thank you

Rich

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[ANN] Practical Apache Struts2 Web 2.0 Projects

2007-11-20 Thread Ian Roughley
I'm pleased to announce the release of my newest book, "Practical Apache 
Struts2 Web 2.0 project".  And, no, I didn't pick the name :-)


Where "Starting Struts2" was high level and provided pointers for 
further exploration, this book dives deep into the framework providing a 
practical guide and lots of code examples for developing web application 
using Struts2.  For those that are new to the framework, there is 
information on getting started, the request/response life cycle, and 
architecture and configuration (XML and zero configuration/annotation).  
And for those that are familiar with Struts2, more advanced topics such 
as security (yes, container, custom and Acegi are all provided with 
example code), workflows/wizards, RESTful web services, and Ajax are 
covered.


For more information, the Apress web site is 
http://www.apress.com/book/view/9781590599037.  I also believe it will 
be available through most major bookstores.


/Ian

--
Ian Roughley

From Down & Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: concatenate Strings in tag attributes

2007-11-20 Thread Gary Affonso

Anton Pussep wrote:

  value="%{'/jsp/'+#parameters.file[0]}"


I thought I tried that one out already, but apparently I remembered
wrong, since it really works, which is great!

Anyway, for my part this is very inconvenient. Also I don't know a way
to pass an array to request parameters. Thus IMHO there should be a more
convenient way to concatenate strings here.


When you use the raw request parameters, the datatype is determined by 
the Servlet engine.  It's a *array* of strings because HTML forms can 
have more than one value associated with a given field.  Checkboxes are 
the typical example, but keep in mind that *most* form field types 
(select, text, etc.) can have more than one control with the same name 
which yields multiple values associated .


So when form data is submitted, the servlet engine has to handle that 
case.  This is why the raw parameter data is a string array.


Now, for you this is "inconvenient", you almost probably have just one 
value submitted for the "file" parameter.


So my suggestion is do *not* access the raw parameters.  That's sort of 
not the point of S2 anyway.  The idea is to let S2 translate the raw 
input values submitted from the form into property values either on the 
action itself, or on an object/bean that the action makes available.


So instead of doing:

  value="%{'/jsp/'+#parameters.file[0]}"

You should probably be doing something like:

  In the form
  ---
  

  In the Action
  -
  private String targetFilename
  public void setTargetFilename(tf){this.targetFilename = tf; }
  public String getTargetFilename(){retrun this.targetFilename; }

  In the View
  ---
  value="%{'/jsp/' + targetFileName}"

The idea here is that you have an action property for the form field. 
As long as the names are the same (and you provide a setter) S2 will 
automatically get the value from the submitted form and get it into the 
action's property.


And as long as you have a getter, you can reference that value in the 
view by simply referencing the property name.


That way you don't deal with the fact that the raw request data is an 
array.  S2 has done the translation for you from an array of Strings to 
a single string when it sets the property value.


- Gary

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validation errors

2007-11-20 Thread Brian Relph
I realized that since this was a custom validator, I can add the error
message to the fieldErrors with whatever key i choose - so i can now
reference that error message.  What about for other validators, like the
expression validator, is there a way to specify a key for it?  I think the
expression validator by default adds to the actionErrors, is there another
way besides re-writing it and specifying to add to the fieldErrors instead?

On 11/20/07, Brian Relph <[EMAIL PROTECTED]> wrote:
>
>
> Can I reference action errors / messages in a similar way to field
> errors?  I have a custom validator for a date field that is split into
> month/day/year fields, but i want the errors for it to appear next to
> inputs.  Here are my validators:
>
> 
>   
> 
>   
>   
> ^\d{4}$
> 
>   
> 
>
> 
>   
> 
>
> which i reference in my jsp like so:
>
> 
>   ssn
> 
>
> how would i reference the "splitdatevalidator" in my jsp?
>


validation errors

2007-11-20 Thread Brian Relph
Can I reference action errors / messages in a similar way to field errors?
I have a custom validator for a date field that is split into month/day/year
fields, but i want the errors for it to appear next to inputs.  Here are my
validators:


  

  
  
^\d{4}$

  



  


which i reference in my jsp like so:


  ssn


how would i reference the "splitdatevalidator" in my jsp?


Re: Problem with

2007-11-20 Thread slideharmony

thanks, I have tried it, but it doesn't work yet! I can't understand..



newton.dave wrote:
> 
> --- slideharmony <[EMAIL PROTECTED]> wrote:
>> in the interceptor class I use the following code:
>> final ActionContext context 
>> = invocation.getInvocationContext ();
>> Map request = (Map)context.get("request");
> 
> context.getParameters() will give you request
> parameters.
> 
> d.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-%3Cs%3Aparam%3E-tf4844353.html#a13860387
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] conditional validation

2007-11-20 Thread Dave Newton
You said you wanted different validation for different
methods in an action, yes?




FooClass-meth1-validation.xml
  First set of validations
  
FooClass-meth2-validation.xml
  Second set of validations

Perhaps I'm misunderstanding what you want to do.

Regarding annotations, AFAIK you can set the
"validateAnnotatedMethodOnly" attribute on the
validation interceptor [1] and annotate methods in
your action class as normal. Haven't done that myself,
so I don't know if it works or not.

d.

[1]
http://struts.apache.org/2.x/docs/validations-annotation.html

--- lbastil <[EMAIL PROTECTED]> wrote:

> 
> Hm, but as I have model driven action,
> for both methods (even if I want to validate
> different attributes later on)
> the first I have to use is VisitorFieldValidator
> with appendPrefix=false for
> the model attribute of the action class.
> 
> So at this level there is no difference, thats why I
> cannot see how it
> should help.
> 
> Could you explain your suggestion a little more in
> detail?
> Would it be realizable with annotation approach too?
> 
> Thank you very much in advance,
> Basti
> 
> 
> 
> newton.dave wrote:
> > 
> > Create two validation XML files, one for each
> method.
> > You can differentiate between them in a couple
> > different ways, the easiest may be to just create
> two
> > action mappings, one for each method.
> > 
> > d.
> > 
> > --- lbastil <[EMAIL PROTECTED]> wrote:
> > 
> >> 
> >> Is there any way with the build in declarative
> >> validation possibilities in
> >> struts 2 (annotations, xml)
> >> to do something like conditional validation in
> the
> >> following sense:
> >> 
> >> in the action class I have a model class, where
> on
> >> action method one i want
> >> to validate
> >> a special subset of model attributes and on
> action
> >> method two another subset
> >> of attributes?
> >> 
> >> (note the model in action is used "modeldriven")
> >> 
> >> Thank you for any idea,
> >> Basti
> >> -- 
> >> View this message in context:
> >>
> >
>
http://www.nabble.com/-s2--conditional-validation-tf4843582.html#a13857280
> >> Sent from the Struts - User mailing list archive
> at
> >> Nabble.com.
> >> 
> >> 
> >>
> >
>
-
> >> 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]
> > 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/-s2--conditional-validation-tf4843582.html#a13859839
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
-
> 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]



Re: Problem with

2007-11-20 Thread Dave Newton
--- slideharmony <[EMAIL PROTECTED]> wrote:
> in the interceptor class I use the following code:
> final ActionContext context 
> = invocation.getInvocationContext ();
> Map request = (Map)context.get("request");

context.getParameters() will give you request
parameters.

d.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] conditional validation

2007-11-20 Thread lbastil

Hm, but as I have model driven action,
for both methods (even if I want to validate different attributes later on)
the first I have to use is VisitorFieldValidator with appendPrefix=false for
the model attribute of the action class.

So at this level there is no difference, thats why I cannot see how it
should help.

Could you explain your suggestion a little more in detail?
Would it be realizable with annotation approach too?

Thank you very much in advance,
Basti



newton.dave wrote:
> 
> Create two validation XML files, one for each method.
> You can differentiate between them in a couple
> different ways, the easiest may be to just create two
> action mappings, one for each method.
> 
> d.
> 
> --- lbastil <[EMAIL PROTECTED]> wrote:
> 
>> 
>> Is there any way with the build in declarative
>> validation possibilities in
>> struts 2 (annotations, xml)
>> to do something like conditional validation in the
>> following sense:
>> 
>> in the action class I have a model class, where on
>> action method one i want
>> to validate
>> a special subset of model attributes and on action
>> method two another subset
>> of attributes?
>> 
>> (note the model in action is used "modeldriven")
>> 
>> Thank you for any idea,
>> Basti
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/-s2--conditional-validation-tf4843582.html#a13857280
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>>
> -
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-s2--conditional-validation-tf4843582.html#a13859839
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with

2007-11-20 Thread slideharmony

Hi, I want to pass a request parameter with this code in order to use it
inside an interceptor.
 this is jsp code:


  

 
Sign up!

in the interceptor class I use the following code:


public String intercept(ActionInvocation invocation) throws Exception {
   
final ActionContext context = invocation.getInvocationContext 
();

Map request = (Map)context.get("request");

But when I try to print all map's values:

Iterator it = request.keySet().iterator();
while(it.hasNext()){
log.info(it.next());
}


this is the output:

   struts.valueStack

and the map size is 1!
Why isn't there login_attempt param? any idea??
thanks


-- 
View this message in context: 
http://www.nabble.com/Problem-with-%3Cs%3Aparam%3E-tf4844353.html#a13859822
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.1 Archived Website link broken

2007-11-20 Thread pmularien

That was fast -- thank you :)


Antonio Petrelli-3 wrote:
> 
> Committed the change, you will see it in the next site deploy.
> Thanks for the report!
> 
> Antonio
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-1.1-Archived-Website-link-broken-tf4843948.html#a13859453
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.1 Archived Website link broken

2007-11-20 Thread Antonio Petrelli
2007/11/20, pmularien <[EMAIL PROTECTED]>:
>
>
> On this page:
> http://struts.apache.org/downloads.html#PriorReleases
>
> The Struts 1.1 website link is wrong. It links to:
> http://struts.apache.org/1.1/index.htm
>
> It should link to (note .html instead of .htm):
> http://struts.apache.org/1.1/index.html
>
> Could someone please fix this? If I should enter this in JIRA, do let me
> know. Thanks!



Committed the change, you will see it in the next site deploy.
Thanks for the report!

Antonio


domain name used soehow as "namespace"

2007-11-20 Thread Ivan Žučenko
Hi all,
title of my question may sound a bit wired.. but.. I want to run my
service for web but also on .mobi
and so.. I want one package in struts.xml dedicated to mobi actions...
in other worlds
I have myDomain.com which is handled by actions of one package + tiles

then myDomain.com/ajax for obvious purpose... easily defined by namespace

AND THEN I would like to map myDomain.mobi to completly different package.

I run Apache + tomcat5 + S2

PLS ADVICE for best practise?

Thanks Ivan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 1.1 Archived Website link broken

2007-11-20 Thread pmularien

On this page:
http://struts.apache.org/downloads.html#PriorReleases

The Struts 1.1 website link is wrong. It links to:
http://struts.apache.org/1.1/index.htm

It should link to (note .html instead of .htm):
http://struts.apache.org/1.1/index.html

Could someone please fix this? If I should enter this in JIRA, do let me
know. Thanks!
-- 
View this message in context: 
http://www.nabble.com/Struts-1.1-Archived-Website-link-broken-tf4843948.html#a13858401
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Warn: No configuration found for the specified action under struts2.0.11

2007-11-20 Thread red phoenix
I have some configure,and it runs well under struts2.0.9,but it raise
warning under struts2.0.11,my files are follows:

/*struts.xml*/

http://struts.apache.org/dtds/struts-2.0.dtd";>

  
  


/*test.xml*/

http://struts.apache.org/dtds/struts-2.0.dtd";>

  

 /t1.jsp
 /t2.jsp
   
  


/*Struts.properties*/
struts.i18n.reload=true
struts.devMode=true
struts.configuration.xml.reload=true
struts.action.extension=pl

Warn: No configuration found for the specified action: 'testing.pl' in
namespace:
'/test'. Form action defaulting to 'action' attribute's literal value.

I am puzzled with it for several days! Anyone could tell me how to
correct above code to get rid of warning?
Thanks!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] conditional validation

2007-11-20 Thread Dave Newton
Create two validation XML files, one for each method.
You can differentiate between them in a couple
different ways, the easiest may be to just create two
action mappings, one for each method.

d.

--- lbastil <[EMAIL PROTECTED]> wrote:

> 
> Is there any way with the build in declarative
> validation possibilities in
> struts 2 (annotations, xml)
> to do something like conditional validation in the
> following sense:
> 
> in the action class I have a model class, where on
> action method one i want
> to validate
> a special subset of model attributes and on action
> method two another subset
> of attributes?
> 
> (note the model in action is used "modeldriven")
> 
> Thank you for any idea,
> Basti
> -- 
> View this message in context:
>
http://www.nabble.com/-s2--conditional-validation-tf4843582.html#a13857280
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
-
> 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]



Re: javascript update tag value property

2007-11-20 Thread victor sosa

ANY IDEAS, how to? 


victor sosa wrote:
> 
> Hi, I am trying to update a textfield when the select is changed using
> javascript event onchange, so How I can do that? Which is the best
> practices here?
> 
> 
> Here is my code, any Ideas?
> 
>   
>   function getVolumenInicial() {
>   var volumenInicial = 
> document.getElementById('save_volumenInicial');
>   var maquinaSelected = 
> document.getElementById('save_maquina_codigo');
>   volumenInicial.value = '%{maquinas[' + 
> maquinaSelected.selectedIndex +
> '].metro}';
>   }
>   
> .
>onchange="getVolumenInicial();"
>   value="%{maquina.codigo}" required="true" 
> listKey="codigo"
> listValue="codigo" />
>  
>  value="%{venta.volumenInicial}" readonly="true" 
> size="7" maxlength="9"
> />
> 
> ANY IDEAS, how to?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/javascript-update-tag-value-property-tf4843331.html#a13858354
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: User validation

2007-11-20 Thread Dave Newton
So there's a form for them to log in from?

d.

--- slideharmony <[EMAIL PROTECTED]> wrote:

> 
> Hello, i have a question:
> shoud I put user validation (with username and
> password) into an action or
> an interceptor? If I have a LoginInterceptor that
> validate the user, what's
> the utility to have a LoginAction too?
> thanks
> -- 
> View this message in context:
>
http://www.nabble.com/User-validation-tf4843033.html#a13855566
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
-
> 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]



Re: Problem with struts2 iterator and ognl

2007-11-20 Thread Dave Newton
What do you mean by "not going through the action"?

d.

--- sagarlotiya <[EMAIL PROTECTED]> wrote:

> 
> Hi,
> I have a iterator and i am loop through it in my jsp
> file and iterator
> contains textbox.
> Problem occurs when i am try to set the values
> directly on "Model" through
> ognl.
> any one has idea how to do that ?
> 
> e.g.
>  status="stat">
>  value="%{#product.quantity}">
> 
> 
> when i am trying to set the value through ognl
> directly on model without
> going through action it didn't set it through ognl.
> 
> can any one tell me the solution?
> 
> -- 
> View this message in context:
>
http://www.nabble.com/Problem-with-struts2-iterator-and-ognl-tf4842578.html#a13854424
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
>
-
> 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]



Re: Access the value stack

2007-11-20 Thread Dave Newton
You don't need to access the value stack directly in
order to access action properties in a JSP. The action
itself is pushed on to the stack allowing any member
with a public "getter" method to be accessed.

Action:
public class MyAction {
private String _foo = "Hello";
public String getFoo() { return _foo; }
}

JSP:
<%@ taglib prefix="s" uri="/struts-tags" %>
 
${foo} 

d.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: opening a new window if validated

2007-11-20 Thread Pavel Sapozhnikov
Hey Adam thanks. So basically one of the things I did was when I am on page
x I validate using client side JS validation either written myself or
html:javascript doesn't really metter but both of those two methods pop up
an alert and doesn't actually put it right in the page like html:errors
does. But then yeah it actually works I still have target there and it opens
a new window only when validation succeded thats fine is there any way to
make javascript display html:errors like right in page and not in a pop up I
looked at html:errors it doesn't have an id or styleId attribute which means
I can't do my document.getElementByID('id').innerHTML = 'some error'. So
what do you recommend. By the way thanks for your input.

Pavel

On Nov 19, 2007 5:38 PM, Adam Gordon <[EMAIL PROTECTED]> wrote:

> It could actually be both.  I assume you are using both client and
> server side JavaScript validation (at the very least you should be doing
> server side since HTML pages can be manipulated).
>
> So, assuming you are doing both, you need the page you submitted the
> data on to go somewhere because you want to chain the action, i.e., you
> want to have another window open.  One way to do this is to have the
> main page come back and set a request attribute that indicates you are
> to open the pop-up window.  In J/S land in your JSP (inside a 

Re: [S2] Struts/JPA Design Practices

2007-11-20 Thread Ted Husted
> Hopefully that's the sort of stuff you're interested in hearing about.

Yes, thanks!

By "custom interceptors" I meant strategies like Open Session In View,
which can be used to implement One Transaction Per Request

 * 
http://struts.apache.org/2.0.11/docs/non-ioc-version-of-opensessioninviewinterceptor.html

 * 
http://struts.apache.org/2.x/docs/hibernateandspringenabledexecuteandwaitinterceptor.html

 * 
http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/orm/hibernate3/HibernateInterceptor.html

 * http://struts.apache.org/2.x/docs/adminapp.html

I've seen various other references on the list to people using custom
interceptors to help with data access.


> We do find that doing the params/prepare/params interceptor sandwich is
> a fairly elegant way to hydrate from a form-provided ID and then let
> other fields inject into that newly hyrdated object on the second params
> pass.

Yes, that does work well. The type converters can be used to do the
same sort of thing. For example, to hydrate (and dehydrate) a entity
based on a primary key, we can do something like this

public Object convertFromString(Map context, String[] values,
Class toClass) {
ProtocolManagerInterface manager = new ProtocolManager();
String id = values[0];
Protocol target = manager.find(id);
return target;
}

public String convertToString(Map context, Object o) {
Protocol value = (Protocol) o;
String id = value.getId();
return id;
}

This tells the framework to write out the primary key when the
Protocol object is referenced in a JSP, and then, on the way back, to
lookup the Protocol object using the key.

If an Action has a reference to, say, a User object, we can do things like





In which case, the framework will first hydrate the user object (the
string ID will be written out at the hidden field), and then update
the user's properties.

Of course, if the user field were left out, the framework will simply
create a blank user object (automatic lazy instantiation).

Elegant indeed :)

-Ted.

On Nov 17, 2007 1:00 AM, Gary Affonso <[EMAIL PROTECTED]> wrote:
> Ted Husted wrote:
> > I know the JPA is growing in popularlity among Struts developers. I
> > was wondering if there are certain Struts 2 features that people where
> > finding useful in using JPA or Hibernate 3
>
> For us it's Hibernate 3 still.  We'll be moving to JPA in the code (with
> Hibernate as the underlying implementation) soon.
>
> > with Struts 2. Are you
> > using custom interceptors?
>
> Er, why?
>
> Or, more specifically, yah we have some customer interceptors, they
> don't have anything to do with our persistence layer, though.
>
> We are using Spring's OSIV filter if that's of interest to you.
>
> >, type converters?
>
> Nothing related to persistence.
>
> > Spring?
>
> Absolutely, and heavily.  Spring for DI, DAO layer, service layer,
> integration testing, Spring AOP for the fault barrier (advice on the
> execute method of the Actions) and various Spring "utilities" like the
> scheduling integration.
>
> > model-driven?
>
> I don't find the "formal" model driven stuff in S2 to be of much benefit
> ("formal" meaning the interceptor combined with a getModel method
> implementation in the Actions).
>
> But we do a lot of direct-injection into model objects from the view
> layer simply using OGNL expressions for our field names and ensuring the
> model-object is a property of the action with getters/setters.  Most of
> the model objects we inject into (from forms in the view) are persisted.
>
> We do find that doing the params/prepare/params interceptor sandwich is
> a fairly elegant way to hydrate from a form-provided ID and then let
> other fields inject into that newly hyrdated object on the second params
> pass.
>
> > the scope plugin?
>
> Not quite yet.  But very soon.
>
> I've been seriously playing with WebFlow and will probably use *some*
> sort of framework-provided scoping very soon (WebFlow or the scope
> plug-in).  I'm s tired of managing conversation scopes by hand.
>
> ---
>
>
> Hopefully that's the sort of stuff you're interested in hearing about.
>
> - Gary
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
HTH, Ted 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



S2: how to go back and populate values the user input

2007-11-20 Thread panpan

Hi all, thank you for any helps. I'm new to struts2. I just got the below
problem. 

In the first page, the user inputs the values in the fields which is a List
variable additionalInterests from the Action. 
In the second page, I have a link "go back" which goes back to the first
page to repopulate the values the user just typed.  But when I click the
button, the Action is a new initianized one. All the values are gone. 

I'm thinkging about putting the List variable to Session scope. But in the
JSP page, the field's name has to changed to
#seesion.additionalInterests[0].firstname . I don't know in this way, does
Action will recognize the variable and automatically put the value into the
additionalInterests like without #session in front of it.

Appreaciate any inputs.

-- 
View this message in context: 
http://www.nabble.com/S2%3A-how-to-go-back-and-populate-values-the-user-input-tf4843707.html#a13857619
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



S2: how to go back and populate values the user input

2007-11-20 Thread panpan

Hi all, thank you for any helps. I'm new to struts2. I just got the below
problem. 

In the first page, the user inputs the values in the fields which is a List
variable additionalInterests from the Action. 
In the second page, I have a link "go back" which goes back to the first
page to repopulate the values the user just typed.  But when I click the
button, the Action is a new initianized one. All the values are gone. 

I'm thinkging about putting the List variable to Session scope. But in the
JSP page, the field's name has to changed to
#seesion.additionalInterests[0].firstname . I don't know in this way, does
Action will recognize the variable and automatically put the value into the
additionalInterests like without #session in front of it.

Appreaciate any inputs.

-- 
View this message in context: 
http://www.nabble.com/S2%3A-how-to-go-back-and-populate-values-the-user-input-tf4843708.html#a13857620
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem running the MySQL script in "Struts 2 + Spring 2 + JPA + AJAX" tutorial

2007-11-20 Thread Musachy Barroso
Do you have a "quickstart" schema in your db?

musachy

On Nov 20, 2007 12:43 AM, Lewis Li <[EMAIL PROTECTED]> wrote:
> Hi! I'm doing the tutorial "Struts 2 + Spring 2 + JPA + AJAX" located at
> http://struts.apache.org/2.0.11/docs/struts-2-spring-2-jpa-ajax.html.
> I have installed and configured MySQL and created a database named
> "quickstart". But I get a syntax error when running this script:
> CREATE TABLE 'quickstart'.'Person' (
>   'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
>   'firstName' VARCHAR(45) NOT NULL,
>   'lastName' VARCHAR(45) NOT NULL,
>   PRIMARY KEY('id')
> )
> ENGINE = InnoDB;This is exactly the same script from the tutorial. The error
> report reported by MySQL Query Browser is:
> You have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near
> ''quickstart'.'Person' (
>   'id' INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
>   'fi' at line 1
>
> I really can't figure out what's wrong with the script. I'm running this
> version of MySQL on a Windows XP computer:
> Server version: 5.0.41-community-nt MySQL Community Edition (GPL)
> I'd really appreciate it if anyone could help me out. Thank you.
>
> Lewis LI
> E-mail: [EMAIL PROTECTED]
> Phone: +86-755-8619 3841
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2] conditional validation

2007-11-20 Thread lbastil

Is there any way with the build in declarative validation possibilities in
struts 2 (annotations, xml)
to do something like conditional validation in the following sense:

in the action class I have a model class, where on action method one i want
to validate
a special subset of model attributes and on action method two another subset
of attributes?

(note the model in action is used "modeldriven")

Thank you for any idea,
Basti
-- 
View this message in context: 
http://www.nabble.com/-s2--conditional-validation-tf4843582.html#a13857280
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



javascript update tag value property

2007-11-20 Thread victor sosa

Hi, I am trying to update a textfield when the select is changed using
javascript event onchange, so How I can do that? Which is the best practices
here?


Here is my code, any Ideas?


function getVolumenInicial() {
var volumenInicial = 
document.getElementById('save_volumenInicial');
var maquinaSelected = 
document.getElementById('save_maquina_codigo');
volumenInicial.value = '%{maquinas[' + 
maquinaSelected.selectedIndex +
'].metro}';
}

.

 


-- 
View this message in context: 
http://www.nabble.com/javascript-update-tag-value-property-tf4843331.html#a13856511
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2][ognl] and with a string.

2007-11-20 Thread Martin Gainty
# and @ are both OGNL directives as in
#foo.blah // returns foo.getBlah()
and in the case of statics
@[EMAIL PROTECTED]

http://struts.apache.org/2.0.11/docs/ognl-basics.html

M--
- Original Message -
From: "LEONARD Julien (Consulting for ACCOR Hotels)"
<[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Tuesday, November 20, 2007 5:21 AM
Subject: RE: [s2][ognl]  and  with a string.



In fact belong my experience of Struts2, the good way to make an expression
is with %{ }.
And for all variables declared in JSP (s:set, or status of s:iterator ) are
accessible with a #.
Maybe these variables are in pageContext and not the valueStack, and "#" is
the way to acces to the pageContext.

Julien

-Message d'origine-
De : GF [mailto:[EMAIL PROTECTED]
Envoyé : mardi 20 novembre 2007 11:15
À : Struts Users Mailing List
Objet : Re: [s2][ognl]  and  with a string.

Wow.
Now It works.
Can you explain me the difference with my version?
Or have you any good link to some guide to understand what I did wrong?

Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail, any attachments and the information contained therein ("this
message") are confidential and intended solely for the use of the
addressee(s). If you have received this message in error please send it back
to the sender and delete it. Unauthorized publication, use, dissemination or
disclosure of this message, either in whole or in part is strictly
prohibited.
**
Ce message électronique et tous les fichiers joints ainsi que  les
informations contenues dans ce message ( ci après "le message" ), sont
confidentiels et destinés exclusivement à l'usage de la  personne à laquelle
ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le
renvoyer à son émetteur et de le détruire. Toutes diffusion, publication,
totale ou partielle ou divulgation sous quelque forme que se soit non
expressément autorisées de ce message, sont interdites.
**


-
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]



User validation

2007-11-20 Thread slideharmony

Hello, i have a question:
shoud I put user validation (with username and password) into an action or
an interceptor? If I have a LoginInterceptor that validate the user, what's
the utility to have a LoginAction too?
thanks
-- 
View this message in context: 
http://www.nabble.com/User-validation-tf4843033.html#a13855566
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Access the value stack

2007-11-20 Thread Omkar Patil

One way is by having following code in your action - 

ValueStack valueStack = ActionContext.getContext().getValueStack();

-Omkar


slideharmony wrote:
> 
> How can I access the value stack in my action in order to store
> objects(that I want to retrieve in my jsps)?
> 

-- 
View this message in context: 
http://www.nabble.com/Access-the-value-stack-tf4842284.html#a13855222
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



what about the concept of action forms in struts2

2007-11-20 Thread vijay vijay
Hi
do we have the concepts like dynavalidator form and other forms in
struts2 .

thnak you


Problem with struts2 iterator and ognl

2007-11-20 Thread sagarlotiya

Hi,
I have a iterator and i am loop through it in my jsp file and iterator
contains textbox.
Problem occurs when i am try to set the values directly on "Model" through
ognl.
any one has idea how to do that ?

e.g.




when i am trying to set the value through ognl directly on model without
going through action it didn't set it through ognl.

can any one tell me the solution?

-- 
View this message in context: 
http://www.nabble.com/Problem-with-struts2-iterator-and-ognl-tf4842578.html#a13854424
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2][ognl] and with a string.

2007-11-20 Thread GF
Ok, thank you again.

On Nov 20, 2007 11:21 AM, LEONARD Julien (Consulting for ACCOR Hotels)
<[EMAIL PROTECTED]> wrote:
>
> In fact belong my experience of Struts2, the good way to make an expression 
> is with %{ }.
> And for all variables declared in JSP (s:set, or status of s:iterator ) are 
> accessible with a #.
> Maybe these variables are in pageContext and not the valueStack, and "#" is 
> the way to acces to the pageContext.
>
> Julien
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [s2][ognl] and with a string.

2007-11-20 Thread LEONARD Julien (Consulting for ACCOR Hotels)

In fact belong my experience of Struts2, the good way to make an expression is 
with %{ }. 
And for all variables declared in JSP (s:set, or status of s:iterator ) are 
accessible with a #.
Maybe these variables are in pageContext and not the valueStack, and "#" is the 
way to acces to the pageContext.

Julien

-Message d'origine-
De : GF [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 20 novembre 2007 11:15
À : Struts Users Mailing List
Objet : Re: [s2][ognl]  and  with a string.

Wow.
Now It works.
Can you explain me the difference with my version?
Or have you any good link to some guide to understand what I did wrong?

Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail, any attachments and the information contained therein ("this 
message") are confidential and intended solely for the use of the addressee(s). 
If you have received this message in error please send it back to the sender 
and delete it. Unauthorized publication, use, dissemination or disclosure of 
this message, either in whole or in part is strictly prohibited.
** 
Ce message électronique et tous les fichiers joints ainsi que  les informations 
contenues dans ce message ( ci après "le message" ), sont confidentiels et 
destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. 
Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur 
et de le détruire. Toutes diffusion, publication, totale ou partielle ou 
divulgation sous quelque forme que se soit non expressément autorisées de ce 
message, sont interdites.
** 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2][ognl] and with a string.

2007-11-20 Thread GF
Wow.
Now It works.
Can you explain me the difference with my version?
Or have you any good link to some guide to understand what I did wrong?

Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [s2][ognl] and with a string.

2007-11-20 Thread LEONARD Julien (Consulting for ACCOR Hotels)
Hello

Try like this :


XXX





YYY
 

-Message d'origine-
De : GF [mailto:[EMAIL PROTECTED] 
Envoyé : mardi 20 novembre 2007 10:59
À : user@struts.apache.org
Objet : [s2][ognl]  and  with a string.

I have this code:


XXX





YYY


This code shows XXX but doesn't show YYY.
How can I satisfay the second test?

Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail, any attachments and the information contained therein ("this 
message") are confidential and intended solely for the use of the addressee(s). 
If you have received this message in error please send it back to the sender 
and delete it. Unauthorized publication, use, dissemination or disclosure of 
this message, either in whole or in part is strictly prohibited.
--
Ce message électronique et tous les fichiers joints ainsi que  les informations 
contenues dans ce message ( ci après "le message" ), sont confidentiels et 
destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. 
Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur 
et de le détruire. Toutes diffusion, publication, totale ou partielle ou 
divulgation sous quelque forme que se soit non expressément autorisées de ce 
message, sont interdites.
-


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[s2][ognl] and with a string.

2007-11-20 Thread GF
I have this code:


XXX





YYY


This code shows XXX but doesn't show YYY.
How can I satisfay the second test?

Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to preselect a radio button in Struts 2

2007-11-20 Thread Pankaj Gupta
Hey,
I tried it  out
  
     
   

But it didn't worked.
I tried
 name="users(${u_rowNum}).access_lvl_types_id"/>
But this was also of not much  help. Sic eit didn't selected a  radio button
by default

I want by default a value of radio button to be pre selected when a jsp page
comes up.
If somebody has a working solution to it.

Regards,
Pankaj









On Nov 15, 2000 8:40 PM, <[EMAIL PROTECTED]> wrote:

> the classic example sets a Map on VS referencable via var
> 
> and then obtains its list of genders by getGenders() from GenderMap
> and sets the default selection will be determined (in this case) by the
> getMale()
> 
>
> so in your case
> 
> where the name is the name of the element and
> the value getList is the the iterable source to populate the list from
> and sets the default selection will be determined (in this case) by the
> getId()
> 
>
> http://struts.apache.org/2.0.11/docs/radio.html
> M--
> - Original Message -
> Wrom: IPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQ
> To: "Struts Users Mailing List" 
> Sent: Thursday, November 15, 2007 9:01 AM
> Subject: Re: How to preselect a radio button in Struts 2
>
>
> > Here is a working example.
> >
> >  > name="users(${u_rowNum}).access_lvl_types_id"/>
> >
> > The value coming from the bean is always 1 or 2.
> >
> > HTH
> >
> > Regards,
> > Randy Burgess
> > Web Applications Developer
> > Nuvox Communications
> >
> >
> >
> > > Wrom: HYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTT
> > > Reply-To: Struts Users Mailing List 
> > > Date: Thu, 15 Nov 2007 11:53:53 +0530
> > > To: Struts Users Mailing List 
> > > Subject: Re: How to preselect a radio button in Struts 2
> > >
> > > Hi,
> > > I tried the same. But it didn't worked
> > >  > > list="{'Yes','No'}" value="No" required="true" />
> > > Regards,
> > > Pankaj
> > >
> > >
> > > On 11/14/07, Randy Burgess <[EMAIL PROTECTED]> wrote:
> > >>
> > >> Use the value attribute and the radio button with that value will be
> > >> selected.
> > >>
> > >> 
> > >>
> > >> Regards,
> > >> Randy Burgess
> > >> Web Applications Developer
> > >> Nuvox Communications
> > >>
> > >>
> > >>
> > >>> Wrom: ZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRT
> > >>> Reply-To: Struts Users Mailing List 
> > >>> Date: Wed, 14 Nov 2007 10:42:20 +0530
> > >>> To: 
> > >>> Subject: How to preselect a radio button in Struts 2
> > >>>
> > >>> Hi,
> > >>> I am working on Struts 2 and I want to preselect  a radio button.
> > >>> If somebody can let me know how to go about it.
> > >>> Regards,
> > >>> Pankaj
> > >>
> > >>
> > >>
> > >> This email and any attachments ("Message") may contain legally
> privileged
> > >> and/or confidential information.  If you are not the addressee, or if
> this
> > >> Message has been addressed to you in error, you are not authorized to
> read,
> > >> copy, or distribute it, and we ask that you please delete it
> (including
> all
> > >> copies) and notify the sender by return email.  Delivery of this
> Message to
> > >> any person other than the intended recipient(s) shall not be deemed a
> waiver
> > >> of confidentiality and/or a privilege.
> > >>
> > >> -
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> >
> >
> >
> > This email and any attachments ("Message") may contain legally
> privileged
> and/or confidential information.  If you are not the addressee, or if this
> Message has been addressed to you in error, you are not authorized to
> read,
> copy, or distribute it, and we ask that you please delete it (including
> all
> copies) and notify the sender by return email.  Delivery of this Message
> to
> any person other than the intended recipient(s) shall not be deemed a
> waiver
> of confidentiality and/or a privilege.
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>


Access the value stack

2007-11-20 Thread slideharmony

How can I access the value stack in my action in order to store objects(that
I want to retrieve in my jsps)?
-- 
View this message in context: 
http://www.nabble.com/Access-the-value-stack-tf4842284.html#a13853727
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Getting the login name from client pc

2007-11-20 Thread Ehteshamul Haque

I have a web application. Some one is browsing it from his PC. I want to rack 
him. I need to get his login name of his PC(Windows OS). Its a intranet 
application.

Thanks.



Ehteshamul Haque


  

Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  
http://overview.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Checkbox selection problem

2007-11-20 Thread John Doe
I've found solution.
You can avoid this problem if you will add hidden field with the same name
as the checkbox. Like this :


*

*


On Nov 20, 2007 11:12 AM, John Doe <[EMAIL PROTECTED]> wrote:

> Solution still needed. Forgot to say, I'm using struts 1.2.7
>
>
> On Nov 19, 2007 11:08 AM, John Doe <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I have a form declared in my struts config :
> >
> > *
> >
> >
> >
> >*
> >
> > and here is my JSP code :
> >
> > *
> >  
> > 
> > ...
> > 
> > *
> > and my code in action
> >
> > *log.info("IS processed : " + dynaForm.get(
> > Constants.FormFields.IS_PROCESSED));*
> >
> > I always have null value first time I submit the form if resource bean
> > had isProcessed as false and then I always get true, no matter what is the
> > state of my checkbox.
> >
> > Here is the part of struts documentation about html checkbox element :
> >
> > *WARNING*: In order to correctly recognize unchecked checkboxes, the
> > ActionForm bean associated with this form must include a statement
> > setting the corresponding boolean property to false in the reset()method.
> >
> > But I have no reset method, my form is declared in xml file.
> > Does any one know how to control checkbox right in this case?
> >
> > --
> > Best regards,
> > Bashmaкov Anton
> >
>
>
>
> --
> Best regards,
> Bashmaкov Anton




-- 
Best regards,
Bashmaкov Anton


Re: Checkbox selection problem

2007-11-20 Thread John Doe
Solution still needed. Forgot to say, I'm using struts 1.2.7

On Nov 19, 2007 11:08 AM, John Doe <[EMAIL PROTECTED]> wrote:

> Hi,
> I have a form declared in my struts config :
>
> *
>
>
>
>*
>
> and here is my JSP code :
>
> *
>  
> 
> ...
> 
> *
> and my code in action
>
> *log.info("IS processed : " + dynaForm.get(
> Constants.FormFields.IS_PROCESSED));*
>
> I always have null value first time I submit the form if resource bean had
> isProcessed as false and then I always get true, no matter what is the state
> of my checkbox.
>
> Here is the part of struts documentation about html checkbox element :
>
> *WARNING*: In order to correctly recognize unchecked checkboxes, the
> ActionForm bean associated with this form must include a statement setting
> the corresponding boolean property to false in the reset() method.
>
> But I have no reset method, my form is declared in xml file.
> Does any one know how to control checkbox right in this case?
>
> --
> Best regards,
> Bashmaкov Anton
>



-- 
Best regards,
Bashmaкov Anton