Re: [S2] ParametersInterceptor: Error setting expression

2008-02-04 Thread Jeromy Evans
That looks fine.  Do you have an action called index in the default 
namespace?  It's calling ActionSupport which is the default/fallback 
action under some circumstances.


You may need to go back to the default interceptor stack to isolate 
what's wrong. Or post the package from struts.xml here.


PS. [Ljava.lang.String;@18a270a is an array of strings. This should if you're 
using the default conversion.


hezjing wrote:

Hmmm ... my login.jsp now looks like this,


  
  
  



When the login button is pressed, the following exceptions are shown
in the console,

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'login' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'login' with value '[Ljava.lang.String;@223be4'

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'password' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'password' with value '[Ljava.lang.String;@18a270a'

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'username' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'username' with value '[Ljava.lang.String;@10936a1'




On 2/5/08, Jeromy Evans <[EMAIL PROTECTED]> wrote:
  

It depends what your interceptor is trying to do...
At the moment, I still think params is trying to call
getButton().setLogin(val) on your ACTION (prior to execution of your
login interceptor).
I presume your interceptor is going to check the params or session and
redirect if not authenticated, which is fine, but with your stack the
params interceptor will attempt to write to the ACTION first.

I still suspect your JSP/html includes a field with NAME "button.login"
and params is throwing the exception due to getButton().  You can test
my theory by giving the field a different name (eg. key="button.login"
name="login") that won't cause an error.

hezjing wrote:


The "button.login" is a key in i18n properties file, and it is suppose
to retrieve the label for a button.

I suspect this problem could be the interceptor statck I configured,



 // my interceptor











Is it OK if my login interceptor is configured after the params interceptor?


On 2/5/08, Jeromy Evans <[EMAIL PROTECTED]> wrote:

  

A param called "button.login" means the ParametersInterceptor has to
call getButton().setLogin(val).

If you don't have a getButton() method, or getButton() returns null, an
exception like this occurs while trying to set the parameter.

hezjing wrote:



Hi

I'm trying to create a login interceptor.

When a login form is submitted, I got the following exception:

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'button.login' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'button.login' with value
'[Ljava.lang.String;@2d4c7e'


What does this exception means?





  

-
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] ParametersInterceptor: Error setting expression

2008-02-04 Thread hezjing
Hmmm ... my login.jsp now looks like this,


  
  
  



When the login button is pressed, the following exceptions are shown
in the console,

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'login' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'login' with value '[Ljava.lang.String;@223be4'

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'password' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'password' with value '[Ljava.lang.String;@18a270a'

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'username' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'username' with value '[Ljava.lang.String;@10936a1'




On 2/5/08, Jeromy Evans <[EMAIL PROTECTED]> wrote:
> It depends what your interceptor is trying to do...
> At the moment, I still think params is trying to call
> getButton().setLogin(val) on your ACTION (prior to execution of your
> login interceptor).
> I presume your interceptor is going to check the params or session and
> redirect if not authenticated, which is fine, but with your stack the
> params interceptor will attempt to write to the ACTION first.
>
> I still suspect your JSP/html includes a field with NAME "button.login"
> and params is throwing the exception due to getButton().  You can test
> my theory by giving the field a different name (eg. key="button.login"
> name="login") that won't cause an error.
>
> hezjing wrote:
> > The "button.login" is a key in i18n properties file, and it is suppose
> > to retrieve the label for a button.
> >
> > I suspect this problem could be the interceptor statck I configured,
> >
> > 
> > 
> >  // my interceptor
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
> >
> > Is it OK if my login interceptor is configured after the params interceptor?
> >
> >
> > On 2/5/08, Jeromy Evans <[EMAIL PROTECTED]> wrote:
> >
> >> A param called "button.login" means the ParametersInterceptor has to
> >> call getButton().setLogin(val).
> >>
> >> If you don't have a getButton() method, or getButton() returns null, an
> >> exception like this occurs while trying to set the parameter.
> >>
> >> hezjing wrote:
> >>
> >>> Hi
> >>>
> >>> I'm trying to create a login interceptor.
> >>>
> >>> When a login form is submitted, I got the following exception:
> >>>
> >>> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> >>> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> >>> caught setting 'button.login' on 'class
> >>> com.opensymphony.xwork2.ActionSupport: Error setting expression
> >>> 'button.login' with value
> >>> '[Ljava.lang.String;@2d4c7e'
> >>>
> >>>
> >>> What does this exception means?
> >>>
> >>>
> >>>
> >>>
> >>>
> >> -
> >> 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]
>
>


-- 

Hez

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



Re: How to add prinr option ?

2008-02-04 Thread Kavita Mehta
how do u implement using js ..can u send me any link having more info ..




"bhaarat Sharma" <[EMAIL PROTECTED]> 
02/05/2008 11:02 AM
Please respond to
"Struts Users Mailing List" 


To
"Struts Users Mailing List" 
cc

Subject
Re: How to add prinr option ?






CSS and JS are best for this

On Feb 5, 2008 12:21 AM, Kavita Mehta <[EMAIL PROTECTED]> wrote:
> Hi ,
> I have a web page implemented using Struts and I want to add a Printer
> button to it so that user can take print out of the same. Is there any
> option supported by struts to do this ?
>
>
> Thanks in advance ,
> Kavita
>
>
>
>
> 
*DISCLAIMER*
>
> This message and/or attachment(s) contained here are confidential, 
proprietary to HUGHES SYSTIQUE and its customers.
> Contents may be privileged or otherwise protected by law. The 
information is solely intended for the entity it is
> addressed to. If you are not the intended recipient of this message, it 
is strictly prohibited to read, forward,
> print, retain, copy or disseminate this message or any part of it. If 
you have received this e-mail in error,
> please notify the sender immediately and delete the message.
>
> 

>
>

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






*DISCLAIMER*

This message and/or attachment(s) contained here are confidential, proprietary 
to HUGHES SYSTIQUE and its customers. 
Contents may be privileged or otherwise protected by law. The information is 
solely intended for the entity it is 
addressed to. If you are not the intended recipient of this message, it is 
strictly prohibited to read, forward, 
print, retain, copy or disseminate this message or any part of it. If you have 
received this e-mail in error, 
please notify the sender immediately and delete the message.





Re: [S2] ParametersInterceptor: Error setting expression

2008-02-04 Thread Jeromy Evans

It depends what your interceptor is trying to do...
At the moment, I still think params is trying to call 
getButton().setLogin(val) on your ACTION (prior to execution of your 
login interceptor).
I presume your interceptor is going to check the params or session and 
redirect if not authenticated, which is fine, but with your stack the 
params interceptor will attempt to write to the ACTION first.


I still suspect your JSP/html includes a field with NAME "button.login" 
and params is throwing the exception due to getButton().  You can test 
my theory by giving the field a different name (eg. key="button.login" 
name="login") that won't cause an error.


hezjing wrote:

The "button.login" is a key in i18n properties file, and it is suppose
to retrieve the label for a button.

I suspect this problem could be the interceptor statck I configured,



 // my interceptor











Is it OK if my login interceptor is configured after the params interceptor?


On 2/5/08, Jeromy Evans <[EMAIL PROTECTED]> wrote:
  

A param called "button.login" means the ParametersInterceptor has to
call getButton().setLogin(val).

If you don't have a getButton() method, or getButton() returns null, an
exception like this occurs while trying to set the parameter.

hezjing wrote:


Hi

I'm trying to create a login interceptor.

When a login form is submitted, I got the following exception:

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'button.login' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'button.login' with value
'[Ljava.lang.String;@2d4c7e'


What does this exception means?




  

-
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] ParametersInterceptor: Error setting expression

2008-02-04 Thread hezjing
The "button.login" is a key in i18n properties file, and it is suppose
to retrieve the label for a button.

I suspect this problem could be the interceptor statck I configured,



 // my interceptor











Is it OK if my login interceptor is configured after the params interceptor?


On 2/5/08, Jeromy Evans <[EMAIL PROTECTED]> wrote:
>
> A param called "button.login" means the ParametersInterceptor has to
> call getButton().setLogin(val).
>
> If you don't have a getButton() method, or getButton() returns null, an
> exception like this occurs while trying to set the parameter.
>
> hezjing wrote:
> > Hi
> >
> > I'm trying to create a login interceptor.
> >
> > When a login form is submitted, I got the following exception:
> >
> > com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> > SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> > caught setting 'button.login' on 'class
> > com.opensymphony.xwork2.ActionSupport: Error setting expression
> > 'button.login' with value
> > '[Ljava.lang.String;@2d4c7e'
> >
> >
> > What does this exception means?
> >
> >
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 

Hez

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



Re: How to add prinr option ?

2008-02-04 Thread bhaarat Sharma
CSS and JS are best for this

On Feb 5, 2008 12:21 AM, Kavita Mehta <[EMAIL PROTECTED]> wrote:
> Hi ,
> I have a web page implemented using Struts and I want to add a Printer
> button to it so that user can take print out of the same. Is there any
> option supported by struts to do this ?
>
>
> Thanks in advance ,
> Kavita
>
>
>
>
> *DISCLAIMER*
>
> This message and/or attachment(s) contained here are confidential, 
> proprietary to HUGHES SYSTIQUE and its customers.
> Contents may be privileged or otherwise protected by law. The information is 
> solely intended for the entity it is
> addressed to. If you are not the intended recipient of this message, it is 
> strictly prohibited to read, forward,
> print, retain, copy or disseminate this message or any part of it. If you 
> have received this e-mail in error,
> please notify the sender immediately and delete the message.
>
> 
>
>

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



How to add prinr option ?

2008-02-04 Thread Kavita Mehta
Hi ,
I have a web page implemented using Struts and I want to add a Printer 
button to it so that user can take print out of the same. Is there any 
option supported by struts to do this ?


Thanks in advance ,
Kavita




*DISCLAIMER*

This message and/or attachment(s) contained here are confidential, proprietary 
to HUGHES SYSTIQUE and its customers. 
Contents may be privileged or otherwise protected by law. The information is 
solely intended for the entity it is 
addressed to. If you are not the intended recipient of this message, it is 
strictly prohibited to read, forward, 
print, retain, copy or disseminate this message or any part of it. If you have 
received this e-mail in error, 
please notify the sender immediately and delete the message.





Example that includes both struts1.1 and struts2

2008-02-04 Thread nagendrabvvs

Hi all,
Could i ask...? Any one please provide me any available website link where i
can get example-application develped with both struts1 and struts2 side by
side.
(As i required to migrate our existing project(with struts1.1) to struts2.).

I have read few of the migration tutorials, in that they have mentined that
we can use both struts1 and struts2 side by side in the same application.
But, i couldn't get completly how to do that.
It would be more helpful if i am provided sample application.

Thanks a lot in advance,
[EMAIL PROTECTED] 
-- 
View this message in context: 
http://www.nabble.com/Example-that-includes-both-struts1.1-and-struts2-tp15283597p15283597.html
Sent from the Struts - User mailing list archive at Nabble.com.


Re: [S2] ParametersInterceptor: Error setting expression

2008-02-04 Thread Jeromy Evans


A param called "button.login" means the ParametersInterceptor has to 
call getButton().setLogin(val).


If you don't have a getButton() method, or getButton() returns null, an 
exception like this occurs while trying to set the parameter.


hezjing wrote:

Hi

I'm trying to create a login interceptor.

When a login form is submitted, I got the following exception:

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'button.login' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'button.login' with value
'[Ljava.lang.String;@2d4c7e'


What does this exception means?



  



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



[S2] ParametersInterceptor: Error setting expression

2008-02-04 Thread hezjing
Hi

I'm trying to create a login interceptor.

When a login form is submitted, I got the following exception:

com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
caught setting 'button.login' on 'class
com.opensymphony.xwork2.ActionSupport: Error setting expression
'button.login' with value
'[Ljava.lang.String;@2d4c7e'


What does this exception means?



-- 

Hez

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



Re: How to add login field in the image

2008-02-04 Thread Wes Wannemacher
This isn't necessarily a struts question, but more of a general DHTML
question. That being said, I would suggest the easiest solution (IMO) to
be creating a position:absolute div and placing your login form within
it.

-Wes
 
On Tue, 2008-02-05 at 09:14 +0530, mohammed hussain wrote:
> hi
>In index .jsp i have an image ,the whole page is coverd with the same
> image,i want to add login field in that page ,can anybody tell me how to add
> login field in that page
> 
> thanx


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



How to add login field in the image

2008-02-04 Thread mohammed hussain
hi
   In index .jsp i have an image ,the whole page is coverd with the same
image,i want to add login field in that page ,can anybody tell me how to add
login field in that page

thanx


Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
Right on.

On Feb 4, 2008 6:45 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Dave,
>
> I think the bigger problem is the JSON that is returned, while it may be
> valid, it not in the right structure expected. I should be generating
> JSON like this:
>
> {"questions":{"420":"Is your Java Application a ME, SE or EE
> application?","440":"If your Java Application is an SE application does
> it use Java Web Start?"}}
>
> The [] brackets seem to be ignored by the parser.
>
> -Original Message-
> From: Dave Newton [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 5:34 PM
> To: Struts Users Mailing List
> Subject: RE: AjaxTag 1.3 support?
>
> ...
>
>
> That's probably an issue.
>
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> > Yea, I think so -- I copied and pasted this from the log
> file/console...
> >
> > From: Dave Newton [mailto:[EMAIL PROTECTED]
> >
> > Is it generating those brackets around your JSON?
> >
> > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> >
> > > Musachy,
> > >
> > > Thanks for your many replies... Does this JSON look like the right
> > > format? As far as I can tell, it matches your snippet below -- but I
> > get
> > > the same dojo parting error.
> > >
> > > [{"questions":{"420":"Is your Java Application a ME, SE or EE
> > > application?"}},{"questions":{"440":"If your Java Application is an
> SE
> > > application does it use Java Web Start?"}},{"questions":{"450":"If
> > your
> > > Java Application is a Java Web Application, list the application
> > server
> > > used for production"}}]
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 3:52 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
> > > easiest way to generate the json is to have an object with a map
> field
> > > that matches the name of "dataFieldName" in the autocompleter tag:
> > >
> > > class QuestionJson {
> > >   private Map questions;
> > >   
> > > }
> > >
> > > public QuestionJson getQuestionJson() {
> > >   Question q= ... [from my list]
> > >Map m = new HaswhMap();
> > >m.put("Key1", q.getQuestion1());
> > >m.put("Key2", q.getQuestion2());
> > >return new QuestionJson(m);
> > > }
> > >
> > > 
> > >
> > > that will generate something like:
> > >
> > > {
> > >   "questions": {
> > >  "Key1" : "Question 1",
> > >  "Key2" : "Question 2",
> > >   }
> > > }
> > >
> > > //that's the idea, but I typed out of what I remember which is often
> > not
> > > good :)
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 4:34 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > Musachy,
> > > >
> > > > I'm still not getting it...
> > > > I am now serializing a list of maps with the entity id and text I
> > > > want...
> > > >
> > > > Map m= new HashMap();
> > > > Question q= ... [from my list]
> > > > m.put("id", q.getId().toString());
> > > > m.put("text", q.getText());
> > > > newList.add(m);
> > > >
> > > > And my JSON result looks:
> > > >
> > > > [JSON][{"text":"Is your Java Application a ME, SE or EE
> > > > application?","id":"420"},{"text":"If your Java Application is an
> SE
> > > > application does it use Java Web Start?","id":"440"},{"text":"If
> > your
> > > > Java Application is a Java Web Application, list the application
> > > server
> > > > used for production","id":"450"},{"text":"List any Java Web
> Services
> > > > Technologies Used","id":"490"},{"text":"List any Java Web
> > Application
> > > > Technologies Used for presentation","id":"500"},{"text":"List any
> > Java
> > > > EE Technologies used in your application","id":"510"}]
> > > >
> > > > I added the @JSON annotation as such:
> > > >
> > > > @JSON(name="question")
> > > > public List> getNewList(){
> > > > return newList;
> > > > }
> > > >
> > > > But it appears to be ignored.
> > > >
> > > > MG
> > > >
> > > > -Original Message-
> > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > >
> > > > Sent: Monday, February 04, 2008 2:53 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: AjaxTag 1.3 support?
> > > >
> > > > Take a look here:
> > > >
> > > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> > > >
> > > > musachy
> > > >
> > > > On Feb 4, 2008 3:43 PM, Griffith, Michael *
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > So, if you have an array of Entity objects, in my case question:
> > > > >
> > > > > How can I produce?
> > > > >  {
> > > > >  "question" : [
> > > > >  ["1","question 1 text..."],
> > > > >  ["2","question 2 text..."]
> > > > >
> > > > >  ]
> > > > >  }
> > > > >
> > > > > -Original Message-
> > > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > > Sent: Monday, February 04, 2008 2:37 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: Re: AjaxTag 1.3 sup

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Dave, 

I think the bigger problem is the JSON that is returned, while it may be
valid, it not in the right structure expected. I should be generating
JSON like this:

{"questions":{"420":"Is your Java Application a ME, SE or EE
application?","440":"If your Java Application is an SE application does
it use Java Web Start?"}}

The [] brackets seem to be ignored by the parser.

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 5:34 PM
To: Struts Users Mailing List
Subject: RE: AjaxTag 1.3 support?

...

That's probably an issue.

--- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> Yea, I think so -- I copied and pasted this from the log
file/console...
> 
> From: Dave Newton [mailto:[EMAIL PROTECTED] 
> 
> Is it generating those brackets around your JSON?
> 
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> 
> > Musachy, 
> > 
> > Thanks for your many replies... Does this JSON look like the right
> > format? As far as I can tell, it matches your snippet below -- but I
> get
> > the same dojo parting error.
> > 
> > [{"questions":{"420":"Is your Java Application a ME, SE or EE
> > application?"}},{"questions":{"440":"If your Java Application is an
SE
> > application does it use Java Web Start?"}},{"questions":{"450":"If
> your
> > Java Application is a Java Web Application, list the application
> server
> > used for production"}}]
> > 
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, February 04, 2008 3:52 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> > 
> > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
> > easiest way to generate the json is to have an object with a map
field
> > that matches the name of "dataFieldName" in the autocompleter tag:
> > 
> > class QuestionJson {
> >   private Map questions;
> >   
> > }
> > 
> > public QuestionJson getQuestionJson() {
> >   Question q= ... [from my list]
> >Map m = new HaswhMap();
> >m.put("Key1", q.getQuestion1());
> >m.put("Key2", q.getQuestion2());
> >return new QuestionJson(m);
> > }
> > 
> > 
> > 
> > that will generate something like:
> > 
> > {
> >   "questions": {
> >  "Key1" : "Question 1",
> >  "Key2" : "Question 2",
> >   }
> > }
> > 
> > //that's the idea, but I typed out of what I remember which is often
> not
> > good :)
> > 
> > musachy
> > 
> > On Feb 4, 2008 4:34 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy,
> > >
> > > I'm still not getting it...
> > > I am now serializing a list of maps with the entity id and text I
> > > want...
> > >
> > > Map m= new HashMap();
> > > Question q= ... [from my list]
> > > m.put("id", q.getId().toString());
> > > m.put("text", q.getText());
> > > newList.add(m);
> > >
> > > And my JSON result looks:
> > >
> > > [JSON][{"text":"Is your Java Application a ME, SE or EE
> > > application?","id":"420"},{"text":"If your Java Application is an
SE
> > > application does it use Java Web Start?","id":"440"},{"text":"If
> your
> > > Java Application is a Java Web Application, list the application
> > server
> > > used for production","id":"450"},{"text":"List any Java Web
Services
> > > Technologies Used","id":"490"},{"text":"List any Java Web
> Application
> > > Technologies Used for presentation","id":"500"},{"text":"List any
> Java
> > > EE Technologies used in your application","id":"510"}]
> > >
> > > I added the @JSON annotation as such:
> > >
> > > @JSON(name="question")
> > > public List> getNewList(){
> > > return newList;
> > > }
> > >
> > > But it appears to be ignored.
> > >
> > > MG
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > >
> > > Sent: Monday, February 04, 2008 2:53 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > Take a look here:
> > >
> > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 3:43 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > So, if you have an array of Entity objects, in my case question:
> > > >
> > > > How can I produce?
> > > >  {
> > > >  "question" : [
> > > >  ["1","question 1 text..."],
> > > >  ["2","question 2 text..."]
> > > >
> > > >  ]
> > > >  }
> > > >
> > > > -Original Message-
> > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 04, 2008 2:37 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: AjaxTag 1.3 support?
> > > >
> > > > yes, but the output will depend on what you feed the JSON
result.
> > > >
> > > > musachy
> > > >
> > > > On Feb 4, 2008 3:20 PM, Griffith, Michael *
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Musachy,
> > > > >
> > > > > I must have missed your point. Isn't the idea of using the
JSON
> > > > plug-in
> > > > > so you don't have to iterate and create the 

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Dave, 

Check out this JSON parser: http://braincast.nl/samples/jsoneditor/
Paste in the snippet below and it parses fine. BTW, the brackets are
returned from the response. Without the brackets, the snippet doesn't
seem to be correct.

[{"questions":{"420":"Is your Java Application a ME, SE or EE
application?"}},{"questions":{"440":"If your Java Application is an SE
application does it use Java Web Start?"}},{"questions":{"450":"If your
Java Application is a Java Web Application, list the application server
used for production"}},{"questions":{"490":"List any Java Web Services
Technologies Used"}},{"questions":{"500":"List any Java Web Application
Technologies Used for presentation"}},{"questions":{"510":"List any Java
EE Technologies used in your application"}}]

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 5:34 PM
To: Struts Users Mailing List
Subject: RE: AjaxTag 1.3 support?

...

That's probably an issue.

--- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> Yea, I think so -- I copied and pasted this from the log
file/console...
> 
> From: Dave Newton [mailto:[EMAIL PROTECTED] 
> 
> Is it generating those brackets around your JSON?
> 
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> 
> > Musachy, 
> > 
> > Thanks for your many replies... Does this JSON look like the right
> > format? As far as I can tell, it matches your snippet below -- but I
> get
> > the same dojo parting error.
> > 
> > [{"questions":{"420":"Is your Java Application a ME, SE or EE
> > application?"}},{"questions":{"440":"If your Java Application is an
SE
> > application does it use Java Web Start?"}},{"questions":{"450":"If
> your
> > Java Application is a Java Web Application, list the application
> server
> > used for production"}}]
> > 
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, February 04, 2008 3:52 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> > 
> > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
> > easiest way to generate the json is to have an object with a map
field
> > that matches the name of "dataFieldName" in the autocompleter tag:
> > 
> > class QuestionJson {
> >   private Map questions;
> >   
> > }
> > 
> > public QuestionJson getQuestionJson() {
> >   Question q= ... [from my list]
> >Map m = new HaswhMap();
> >m.put("Key1", q.getQuestion1());
> >m.put("Key2", q.getQuestion2());
> >return new QuestionJson(m);
> > }
> > 
> > 
> > 
> > that will generate something like:
> > 
> > {
> >   "questions": {
> >  "Key1" : "Question 1",
> >  "Key2" : "Question 2",
> >   }
> > }
> > 
> > //that's the idea, but I typed out of what I remember which is often
> not
> > good :)
> > 
> > musachy
> > 
> > On Feb 4, 2008 4:34 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy,
> > >
> > > I'm still not getting it...
> > > I am now serializing a list of maps with the entity id and text I
> > > want...
> > >
> > > Map m= new HashMap();
> > > Question q= ... [from my list]
> > > m.put("id", q.getId().toString());
> > > m.put("text", q.getText());
> > > newList.add(m);
> > >
> > > And my JSON result looks:
> > >
> > > [JSON][{"text":"Is your Java Application a ME, SE or EE
> > > application?","id":"420"},{"text":"If your Java Application is an
SE
> > > application does it use Java Web Start?","id":"440"},{"text":"If
> your
> > > Java Application is a Java Web Application, list the application
> > server
> > > used for production","id":"450"},{"text":"List any Java Web
Services
> > > Technologies Used","id":"490"},{"text":"List any Java Web
> Application
> > > Technologies Used for presentation","id":"500"},{"text":"List any
> Java
> > > EE Technologies used in your application","id":"510"}]
> > >
> > > I added the @JSON annotation as such:
> > >
> > > @JSON(name="question")
> > > public List> getNewList(){
> > > return newList;
> > > }
> > >
> > > But it appears to be ignored.
> > >
> > > MG
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > >
> > > Sent: Monday, February 04, 2008 2:53 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > Take a look here:
> > >
> > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 3:43 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > So, if you have an array of Entity objects, in my case question:
> > > >
> > > > How can I produce?
> > > >  {
> > > >  "question" : [
> > > >  ["1","question 1 text..."],
> > > >  ["2","question 2 text..."]
> > > >
> > > >  ]
> > > >  }
> > > >
> > > > -Original Message-
> > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 04, 2008 2:37 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re:

RE: AjaxTag 1.3 support?

2008-02-04 Thread Dave Newton
...

That's probably an issue.

--- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> Yea, I think so -- I copied and pasted this from the log file/console...
> 
> From: Dave Newton [mailto:[EMAIL PROTECTED] 
> 
> Is it generating those brackets around your JSON?
> 
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> 
> > Musachy, 
> > 
> > Thanks for your many replies... Does this JSON look like the right
> > format? As far as I can tell, it matches your snippet below -- but I
> get
> > the same dojo parting error.
> > 
> > [{"questions":{"420":"Is your Java Application a ME, SE or EE
> > application?"}},{"questions":{"440":"If your Java Application is an SE
> > application does it use Java Web Start?"}},{"questions":{"450":"If
> your
> > Java Application is a Java Web Application, list the application
> server
> > used for production"}}]
> > 
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, February 04, 2008 3:52 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> > 
> > The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
> > easiest way to generate the json is to have an object with a map field
> > that matches the name of "dataFieldName" in the autocompleter tag:
> > 
> > class QuestionJson {
> >   private Map questions;
> >   
> > }
> > 
> > public QuestionJson getQuestionJson() {
> >   Question q= ... [from my list]
> >Map m = new HaswhMap();
> >m.put("Key1", q.getQuestion1());
> >m.put("Key2", q.getQuestion2());
> >return new QuestionJson(m);
> > }
> > 
> > 
> > 
> > that will generate something like:
> > 
> > {
> >   "questions": {
> >  "Key1" : "Question 1",
> >  "Key2" : "Question 2",
> >   }
> > }
> > 
> > //that's the idea, but I typed out of what I remember which is often
> not
> > good :)
> > 
> > musachy
> > 
> > On Feb 4, 2008 4:34 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy,
> > >
> > > I'm still not getting it...
> > > I am now serializing a list of maps with the entity id and text I
> > > want...
> > >
> > > Map m= new HashMap();
> > > Question q= ... [from my list]
> > > m.put("id", q.getId().toString());
> > > m.put("text", q.getText());
> > > newList.add(m);
> > >
> > > And my JSON result looks:
> > >
> > > [JSON][{"text":"Is your Java Application a ME, SE or EE
> > > application?","id":"420"},{"text":"If your Java Application is an SE
> > > application does it use Java Web Start?","id":"440"},{"text":"If
> your
> > > Java Application is a Java Web Application, list the application
> > server
> > > used for production","id":"450"},{"text":"List any Java Web Services
> > > Technologies Used","id":"490"},{"text":"List any Java Web
> Application
> > > Technologies Used for presentation","id":"500"},{"text":"List any
> Java
> > > EE Technologies used in your application","id":"510"}]
> > >
> > > I added the @JSON annotation as such:
> > >
> > > @JSON(name="question")
> > > public List> getNewList(){
> > > return newList;
> > > }
> > >
> > > But it appears to be ignored.
> > >
> > > MG
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > >
> > > Sent: Monday, February 04, 2008 2:53 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > Take a look here:
> > >
> > > http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 3:43 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > So, if you have an array of Entity objects, in my case question:
> > > >
> > > > How can I produce?
> > > >  {
> > > >  "question" : [
> > > >  ["1","question 1 text..."],
> > > >  ["2","question 2 text..."]
> > > >
> > > >  ]
> > > >  }
> > > >
> > > > -Original Message-
> > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 04, 2008 2:37 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: AjaxTag 1.3 support?
> > > >
> > > > yes, but the output will depend on what you feed the JSON result.
> > > >
> > > > musachy
> > > >
> > > > On Feb 4, 2008 3:20 PM, Griffith, Michael *
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Musachy,
> > > > >
> > > > > I must have missed your point. Isn't the idea of using the JSON
> > > > plug-in
> > > > > so you don't have to iterate and create the list? If I have an
> > array
> > > > or
> > > > > Entity objects or maps, isn't there a way that the plug-in will
> > > create
> > > > > the JSON specified below?
> > > > >
> > > > > MG
> > > > >
> > > > > -Original Message-
> > > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > > Sent: Monday, February 04, 2008 1:56 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: Re: AjaxTag 1.3 support?
> > > > >
> > > > >
> > > > > to use the dataFIeldName, you have to return something like:
> > > > >
> > > > > {
> > > > > "sta

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Yea, I think so -- I copied and pasted this from the log file/console...


-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 5:02 PM
To: Struts Users Mailing List
Subject: RE: AjaxTag 1.3 support?

Is it generating those brackets around your JSON?

Dave

--- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:

> Musachy, 
> 
> Thanks for your many replies... Does this JSON look like the right
> format? As far as I can tell, it matches your snippet below -- but I
get
> the same dojo parting error.
> 
> [{"questions":{"420":"Is your Java Application a ME, SE or EE
> application?"}},{"questions":{"440":"If your Java Application is an SE
> application does it use Java Web Start?"}},{"questions":{"450":"If
your
> Java Application is a Java Web Application, list the application
server
> used for production"}}]
> 
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 04, 2008 3:52 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
> 
> The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
> easiest way to generate the json is to have an object with a map field
> that matches the name of "dataFieldName" in the autocompleter tag:
> 
> class QuestionJson {
>   private Map questions;
>   
> }
> 
> public QuestionJson getQuestionJson() {
>   Question q= ... [from my list]
>Map m = new HaswhMap();
>m.put("Key1", q.getQuestion1());
>m.put("Key2", q.getQuestion2());
>return new QuestionJson(m);
> }
> 
> 
> 
> that will generate something like:
> 
> {
>   "questions": {
>  "Key1" : "Question 1",
>  "Key2" : "Question 2",
>   }
> }
> 
> //that's the idea, but I typed out of what I remember which is often
not
> good :)
> 
> musachy
> 
> On Feb 4, 2008 4:34 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy,
> >
> > I'm still not getting it...
> > I am now serializing a list of maps with the entity id and text I
> > want...
> >
> > Map m= new HashMap();
> > Question q= ... [from my list]
> > m.put("id", q.getId().toString());
> > m.put("text", q.getText());
> > newList.add(m);
> >
> > And my JSON result looks:
> >
> > [JSON][{"text":"Is your Java Application a ME, SE or EE
> > application?","id":"420"},{"text":"If your Java Application is an SE
> > application does it use Java Web Start?","id":"440"},{"text":"If
your
> > Java Application is a Java Web Application, list the application
> server
> > used for production","id":"450"},{"text":"List any Java Web Services
> > Technologies Used","id":"490"},{"text":"List any Java Web
Application
> > Technologies Used for presentation","id":"500"},{"text":"List any
Java
> > EE Technologies used in your application","id":"510"}]
> >
> > I added the @JSON annotation as such:
> >
> > @JSON(name="question")
> > public List> getNewList(){
> > return newList;
> > }
> >
> > But it appears to be ignored.
> >
> > MG
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> >
> > Sent: Monday, February 04, 2008 2:53 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > Take a look here:
> >
> > http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> >
> > musachy
> >
> > On Feb 4, 2008 3:43 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > So, if you have an array of Entity objects, in my case question:
> > >
> > > How can I produce?
> > >  {
> > >  "question" : [
> > >  ["1","question 1 text..."],
> > >  ["2","question 2 text..."]
> > >
> > >  ]
> > >  }
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 2:37 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > yes, but the output will depend on what you feed the JSON result.
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 3:20 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > Musachy,
> > > >
> > > > I must have missed your point. Isn't the idea of using the JSON
> > > plug-in
> > > > so you don't have to iterate and create the list? If I have an
> array
> > > or
> > > > Entity objects or maps, isn't there a way that the plug-in will
> > create
> > > > the JSON specified below?
> > > >
> > > > MG
> > > >
> > > > -Original Message-
> > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 04, 2008 1:56 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: AjaxTag 1.3 support?
> > > >
> > > >
> > > > to use the dataFIeldName, you have to return something like:
> > > >
> > > > {
> > > > "state" : [
> > > > ["Alabama","AL"],
> > > > ["Alaska","AK"]
> > > > ]
> > > > }
> > > >
> > > > if you are using 2.1 check this link:
> > > >
> > > >
> > >
> >
>
http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > > > criptRecipes-Aut

RE: AjaxTag 1.3 support?

2008-02-04 Thread Dave Newton
Is it generating those brackets around your JSON?

Dave

--- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:

> Musachy, 
> 
> Thanks for your many replies... Does this JSON look like the right
> format? As far as I can tell, it matches your snippet below -- but I get
> the same dojo parting error.
> 
> [{"questions":{"420":"Is your Java Application a ME, SE or EE
> application?"}},{"questions":{"440":"If your Java Application is an SE
> application does it use Java Web Start?"}},{"questions":{"450":"If your
> Java Application is a Java Web Application, list the application server
> used for production"}}]
> 
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
> Sent: Monday, February 04, 2008 3:52 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
> 
> The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
> easiest way to generate the json is to have an object with a map field
> that matches the name of "dataFieldName" in the autocompleter tag:
> 
> class QuestionJson {
>   private Map questions;
>   
> }
> 
> public QuestionJson getQuestionJson() {
>   Question q= ... [from my list]
>Map m = new HaswhMap();
>m.put("Key1", q.getQuestion1());
>m.put("Key2", q.getQuestion2());
>return new QuestionJson(m);
> }
> 
> 
> 
> that will generate something like:
> 
> {
>   "questions": {
>  "Key1" : "Question 1",
>  "Key2" : "Question 2",
>   }
> }
> 
> //that's the idea, but I typed out of what I remember which is often not
> good :)
> 
> musachy
> 
> On Feb 4, 2008 4:34 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy,
> >
> > I'm still not getting it...
> > I am now serializing a list of maps with the entity id and text I
> > want...
> >
> > Map m= new HashMap();
> > Question q= ... [from my list]
> > m.put("id", q.getId().toString());
> > m.put("text", q.getText());
> > newList.add(m);
> >
> > And my JSON result looks:
> >
> > [JSON][{"text":"Is your Java Application a ME, SE or EE
> > application?","id":"420"},{"text":"If your Java Application is an SE
> > application does it use Java Web Start?","id":"440"},{"text":"If your
> > Java Application is a Java Web Application, list the application
> server
> > used for production","id":"450"},{"text":"List any Java Web Services
> > Technologies Used","id":"490"},{"text":"List any Java Web Application
> > Technologies Used for presentation","id":"500"},{"text":"List any Java
> > EE Technologies used in your application","id":"510"}]
> >
> > I added the @JSON annotation as such:
> >
> > @JSON(name="question")
> > public List> getNewList(){
> > return newList;
> > }
> >
> > But it appears to be ignored.
> >
> > MG
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> >
> > Sent: Monday, February 04, 2008 2:53 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > Take a look here:
> >
> > http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> >
> > musachy
> >
> > On Feb 4, 2008 3:43 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > So, if you have an array of Entity objects, in my case question:
> > >
> > > How can I produce?
> > >  {
> > >  "question" : [
> > >  ["1","question 1 text..."],
> > >  ["2","question 2 text..."]
> > >
> > >  ]
> > >  }
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 2:37 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > yes, but the output will depend on what you feed the JSON result.
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 3:20 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > Musachy,
> > > >
> > > > I must have missed your point. Isn't the idea of using the JSON
> > > plug-in
> > > > so you don't have to iterate and create the list? If I have an
> array
> > > or
> > > > Entity objects or maps, isn't there a way that the plug-in will
> > create
> > > > the JSON specified below?
> > > >
> > > > MG
> > > >
> > > > -Original Message-
> > > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 04, 2008 1:56 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: AjaxTag 1.3 support?
> > > >
> > > >
> > > > to use the dataFIeldName, you have to return something like:
> > > >
> > > > {
> > > > "state" : [
> > > > ["Alabama","AL"],
> > > > ["Alaska","AK"]
> > > > ]
> > > > }
> > > >
> > > > if you are using 2.1 check this link:
> > > >
> > > >
> > >
> >
> http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > > > criptRecipes-Autocompleter
> > > >
> > > > otherwise just an array of arrays should do:
> > > >
> > > > [
> > > > ["Alabama", "AL"],
> > > > ["Alaska", "AK"]
> > > > ]
> > > >
> > > > musachy
> > > >
> > > > On Feb 4, 2008 2:46 PM, Griffith, Michael *
> > > > 

Struts 2 Spring sitemesh hangs on tomcat 6 and jboss

2008-02-04 Thread Emil.I

Hello,
You guys had this, happen when i deploy my war file to tomcat, the
application hangs seems waiting for 
reply forever. I deployed it on jboss ok for a while, then again after a
while just hangs. Increasing memory
in tomcat to 512 did not help. 
I got some params interceptor errors (setting action properties) and 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name
'org.apache.struts2.dispatcher.ServletDispatcherResult': Unsatisfied
dependency expressed through constructor argument with index 0 of type
[java.lang.String]: No unique bean of type [java.lang.String] is defined:
Unsatisfied dependency of type [class java.lang.String]: expected at least 1
matching bean

could those errors hang the web app?
In my jboss console i see the following

http-127.0.0.1-8080

Max threads: 250 Current thread count: 9 Current thread busy: 7
Max processing time: 5598 ms Processing time: 40.755 s Request count: 191
Error count: 74 Bytes received: 0.00 MB Bytes sent: 7.90 MB
Stage   TimeB Sent  B Recv  Client  VHost   Request
S   976784 ms   0 KB0 KB127.0.0.1   localhost   GET 
/web-console/ServerInfo.jsp
HTTP/1.1
S   1059384 ms  0 KB0 KB127.0.0.1   localhost   GET
/JobSearch-1.0/job/home.action HTTP/1.1
S   1115877 ms  0 KB0 KB127.0.0.1   localhost   GET
/JobSearch-1.0/job/showCustomerRegistration.action HTTP/1.1
S   708182 ms   0 KB0 KB127.0.0.1   localhost   GET 
/JobSearch-1.0/job/home.action
HTTP/1.1
S   773187 ms   0 KB0 KB127.0.0.1   localhost   GET
/JobSearch-1.0/job/search.action HTTP/1.1
S   701843 ms   0 KB0 KB127.0.0.1   localhost   GET 
/JobSearch-1.0/job/home.action
HTTP/1.1
S   0 ms0 KB0 KB127.0.0.1   localhost   GET
/web-console/status?full=true&jsessionid=69486E0BE0C24698F891065A3DC42CC3
HTTP/1.1
R   ?   ?   ?   ?   ?   ?
R   ?   ?   ?   ?   ?   ?


any suggestions?


-- 
View this message in context: 
http://www.nabble.com/Struts-2-Spring-sitemesh-hangs-on-tomcat-6-and-jboss-tp15279283p15279283.html
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: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Musachy, 

Thanks for your many replies... Does this JSON look like the right
format? As far as I can tell, it matches your snippet below -- but I get
the same dojo parting error.

[{"questions":{"420":"Is your Java Application a ME, SE or EE
application?"}},{"questions":{"440":"If your Java Application is an SE
application does it use Java Web Start?"}},{"questions":{"450":"If your
Java Application is a Java Web Application, list the application server
used for production"}}]

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 3:52 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
easiest way to generate the json is to have an object with a map field
that matches the name of "dataFieldName" in the autocompleter tag:

class QuestionJson {
  private Map questions;
  
}

public QuestionJson getQuestionJson() {
  Question q= ... [from my list]
   Map m = new HaswhMap();
   m.put("Key1", q.getQuestion1());
   m.put("Key2", q.getQuestion2());
   return new QuestionJson(m);
}



that will generate something like:

{
  "questions": {
 "Key1" : "Question 1",
 "Key2" : "Question 2",
  }
}

//that's the idea, but I typed out of what I remember which is often not
good :)

musachy

On Feb 4, 2008 4:34 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Musachy,
>
> I'm still not getting it...
> I am now serializing a list of maps with the entity id and text I
> want...
>
> Map m= new HashMap();
> Question q= ... [from my list]
> m.put("id", q.getId().toString());
> m.put("text", q.getText());
> newList.add(m);
>
> And my JSON result looks:
>
> [JSON][{"text":"Is your Java Application a ME, SE or EE
> application?","id":"420"},{"text":"If your Java Application is an SE
> application does it use Java Web Start?","id":"440"},{"text":"If your
> Java Application is a Java Web Application, list the application
server
> used for production","id":"450"},{"text":"List any Java Web Services
> Technologies Used","id":"490"},{"text":"List any Java Web Application
> Technologies Used for presentation","id":"500"},{"text":"List any Java
> EE Technologies used in your application","id":"510"}]
>
> I added the @JSON annotation as such:
>
> @JSON(name="question")
> public List> getNewList(){
> return newList;
> }
>
> But it appears to be ignored.
>
> MG
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
>
> Sent: Monday, February 04, 2008 2:53 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> Take a look here:
>
> http://cwiki.apache.org/S2PLUGINS/json-plugin.html
>
> musachy
>
> On Feb 4, 2008 3:43 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > So, if you have an array of Entity objects, in my case question:
> >
> > How can I produce?
> >  {
> >  "question" : [
> >  ["1","question 1 text..."],
> >  ["2","question 2 text..."]
> >
> >  ]
> >  }
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 2:37 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > yes, but the output will depend on what you feed the JSON result.
> >
> > musachy
> >
> > On Feb 4, 2008 3:20 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy,
> > >
> > > I must have missed your point. Isn't the idea of using the JSON
> > plug-in
> > > so you don't have to iterate and create the list? If I have an
array
> > or
> > > Entity objects or maps, isn't there a way that the plug-in will
> create
> > > the JSON specified below?
> > >
> > > MG
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 1:56 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > >
> > > to use the dataFIeldName, you have to return something like:
> > >
> > > {
> > > "state" : [
> > > ["Alabama","AL"],
> > > ["Alaska","AK"]
> > > ]
> > > }
> > >
> > > if you are using 2.1 check this link:
> > >
> > >
> >
>
http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > > criptRecipes-Autocompleter
> > >
> > > otherwise just an array of arrays should do:
> > >
> > > [
> > > ["Alabama", "AL"],
> > > ["Alaska", "AK"]
> > > ]
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 2:46 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > Musachy
> > > >
> > > > Here is the autocompleter tag and the JSON returned...
> > > >
> > > > 
> > > >  > > > value="/search/searchByText.action"/>
> > > >  > > > name="text"
> > > > dataFieldName="text"
> > > > loadOnTextChange="true"
> > > > indicator="indicator"
> > > > dropdownHeight="300"
> > > > cssStyle="width: 200px;"

Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
The rule to use a map (simplest one) was added on 2.1, on 2.0.x the
easiest way to generate the json is to have an object with a map field
that matches the name of "dataFieldName" in the autocompleter tag:

class QuestionJson {
  private Map questions;
  
}

public QuestionJson getQuestionJson() {
  Question q= ... [from my list]
   Map m = new HaswhMap();
   m.put("Key1", q.getQuestion1());
   m.put("Key2", q.getQuestion2());
   return new QuestionJson(m);
}



that will generate something like:

{
  "questions": {
 "Key1" : "Question 1",
 "Key2" : "Question 2",
  }
}

//that's the idea, but I typed out of what I remember which is often not good :)

musachy

On Feb 4, 2008 4:34 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Musachy,
>
> I'm still not getting it...
> I am now serializing a list of maps with the entity id and text I
> want...
>
> Map m= new HashMap();
> Question q= ... [from my list]
> m.put("id", q.getId().toString());
> m.put("text", q.getText());
> newList.add(m);
>
> And my JSON result looks:
>
> [JSON][{"text":"Is your Java Application a ME, SE or EE
> application?","id":"420"},{"text":"If your Java Application is an SE
> application does it use Java Web Start?","id":"440"},{"text":"If your
> Java Application is a Java Web Application, list the application server
> used for production","id":"450"},{"text":"List any Java Web Services
> Technologies Used","id":"490"},{"text":"List any Java Web Application
> Technologies Used for presentation","id":"500"},{"text":"List any Java
> EE Technologies used in your application","id":"510"}]
>
> I added the @JSON annotation as such:
>
> @JSON(name="question")
> public List> getNewList(){
> return newList;
> }
>
> But it appears to be ignored.
>
> MG
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
>
> Sent: Monday, February 04, 2008 2:53 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> Take a look here:
>
> http://cwiki.apache.org/S2PLUGINS/json-plugin.html
>
> musachy
>
> On Feb 4, 2008 3:43 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > So, if you have an array of Entity objects, in my case question:
> >
> > How can I produce?
> >  {
> >  "question" : [
> >  ["1","question 1 text..."],
> >  ["2","question 2 text..."]
> >
> >  ]
> >  }
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 2:37 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > yes, but the output will depend on what you feed the JSON result.
> >
> > musachy
> >
> > On Feb 4, 2008 3:20 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy,
> > >
> > > I must have missed your point. Isn't the idea of using the JSON
> > plug-in
> > > so you don't have to iterate and create the list? If I have an array
> > or
> > > Entity objects or maps, isn't there a way that the plug-in will
> create
> > > the JSON specified below?
> > >
> > > MG
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 1:56 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > >
> > > to use the dataFIeldName, you have to return something like:
> > >
> > > {
> > > "state" : [
> > > ["Alabama","AL"],
> > > ["Alaska","AK"]
> > > ]
> > > }
> > >
> > > if you are using 2.1 check this link:
> > >
> > >
> >
> http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > > criptRecipes-Autocompleter
> > >
> > > otherwise just an array of arrays should do:
> > >
> > > [
> > > ["Alabama", "AL"],
> > > ["Alaska", "AK"]
> > > ]
> > >
> > > musachy
> > >
> > > On Feb 4, 2008 2:46 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > Musachy
> > > >
> > > > Here is the autocompleter tag and the JSON returned...
> > > >
> > > > 
> > > >  > > > value="/search/searchByText.action"/>
> > > >  > > > name="text"
> > > > dataFieldName="text"
> > > > loadOnTextChange="true"
> > > > indicator="indicator"
> > > > dropdownHeight="300"
> > > > cssStyle="width: 200px;"
> > > > searchType="substring"
> > > > autoComplete="false"
> > > > showDownArrow="false"
> > > > loadMinimumCount="3"/>
> > > >  > > > src="${pageContext.request.contextPath}/images/indicator.gif"
> > > > alt="Loading..." style="display:none"/>
> > > >
> > > >
> > > > [JSON][{"id":420,"questionType":{"declaringClass":"class
> > > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> > > > Application a ME, SE or EE
> > > > application?"},{"id":440,"questionType":{"declaringClass":"class
> > > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > > Application is

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Musachy, 

Ok, I had a parameter set in the JSON plugin, that I think was effecting
the serialization (root) ...

I removed it and now my JSON looks like this:

[JSON]{"question":[{"text":"Is your Java Application a ME, SE or EE
application?","id":"420"},{"text":"If your Java Application is an SE
application does it use Java Web Start?","id":"440"},{"text":"If your
Java Application is a Java Web Application, list the application server
used for production","id":"450"},{"text":"List any Java Web Services
Technologies Used","id":"490"},{"text":"List any Java Web Application
Technologies Used for presentation","id":"500"},{"text":"List any Java
EE Technologies used in your application","id":"510"}]}

My autocompleter looks like this:


And I am still getting the JSON Parsing error: FATAL exception raised:
TypeError: Value undefined (result of expression
this.data[x][0].toLowerCase) is not object.
 
What am I doing wrong?

MG

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 2:53 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

Take a look here:

http://cwiki.apache.org/S2PLUGINS/json-plugin.html

musachy

On Feb 4, 2008 3:43 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> So, if you have an array of Entity objects, in my case question:
>
> How can I produce?
>  {
>  "question" : [
>  ["1","question 1 text..."],
>  ["2","question 2 text..."]
>
>  ]
>  }
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 2:37 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> yes, but the output will depend on what you feed the JSON result.
>
> musachy
>
> On Feb 4, 2008 3:20 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy,
> >
> > I must have missed your point. Isn't the idea of using the JSON
> plug-in
> > so you don't have to iterate and create the list? If I have an array
> or
> > Entity objects or maps, isn't there a way that the plug-in will
create
> > the JSON specified below?
> >
> > MG
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 1:56 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> >
> > to use the dataFIeldName, you have to return something like:
> >
> > {
> > "state" : [
> > ["Alabama","AL"],
> > ["Alaska","AK"]
> > ]
> > }
> >
> > if you are using 2.1 check this link:
> >
> >
>
http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > criptRecipes-Autocompleter
> >
> > otherwise just an array of arrays should do:
> >
> > [
> > ["Alabama", "AL"],
> > ["Alaska", "AK"]
> > ]
> >
> > musachy
> >
> > On Feb 4, 2008 2:46 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy
> > >
> > > Here is the autocompleter tag and the JSON returned...
> > >
> > > 
> > >  > > value="/search/searchByText.action"/>
> > >  > > name="text"
> > > dataFieldName="text"
> > > loadOnTextChange="true"
> > > indicator="indicator"
> > > dropdownHeight="300"
> > > cssStyle="width: 200px;"
> > > searchType="substring"
> > > autoComplete="false"
> > > showDownArrow="false"
> > > loadMinimumCount="3"/>
> > >  > > src="${pageContext.request.contextPath}/images/indicator.gif"
> > > alt="Loading..." style="display:none"/>
> > >
> > >
> > > [JSON][{"id":420,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> > > Application a ME, SE or EE
> > > application?"},{"id":440,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > Application is an SE application does it use Java Web
> > > Start?"},{"id":450,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > Application is a Java Web Application, list the application server
> > used
> > > for production"},{"id":490,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java
Web
> > > Services Technologies
> > > Used"},{"id":500,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java
Web
> > > Application Technologies Used for
> > > presentation"},{"id":510,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> > > Technologies used in your application"}]
> > >
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 1:22 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > funny thing is that now I remember the code(duh!), 

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Musachy, 

I'm still not getting it... 
I am now serializing a list of maps with the entity id and text I
want... 

Map m= new HashMap();
Question q= ... [from my list]
m.put("id", q.getId().toString());
m.put("text", q.getText());
newList.add(m);

And my JSON result looks:

[JSON][{"text":"Is your Java Application a ME, SE or EE
application?","id":"420"},{"text":"If your Java Application is an SE
application does it use Java Web Start?","id":"440"},{"text":"If your
Java Application is a Java Web Application, list the application server
used for production","id":"450"},{"text":"List any Java Web Services
Technologies Used","id":"490"},{"text":"List any Java Web Application
Technologies Used for presentation","id":"500"},{"text":"List any Java
EE Technologies used in your application","id":"510"}]

I added the @JSON annotation as such:

@JSON(name="question")
public List> getNewList(){
return newList;
}

But it appears to be ignored.

MG

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 2:53 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

Take a look here:

http://cwiki.apache.org/S2PLUGINS/json-plugin.html

musachy

On Feb 4, 2008 3:43 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> So, if you have an array of Entity objects, in my case question:
>
> How can I produce?
>  {
>  "question" : [
>  ["1","question 1 text..."],
>  ["2","question 2 text..."]
>
>  ]
>  }
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 2:37 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> yes, but the output will depend on what you feed the JSON result.
>
> musachy
>
> On Feb 4, 2008 3:20 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy,
> >
> > I must have missed your point. Isn't the idea of using the JSON
> plug-in
> > so you don't have to iterate and create the list? If I have an array
> or
> > Entity objects or maps, isn't there a way that the plug-in will
create
> > the JSON specified below?
> >
> > MG
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 1:56 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> >
> > to use the dataFIeldName, you have to return something like:
> >
> > {
> > "state" : [
> > ["Alabama","AL"],
> > ["Alaska","AK"]
> > ]
> > }
> >
> > if you are using 2.1 check this link:
> >
> >
>
http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > criptRecipes-Autocompleter
> >
> > otherwise just an array of arrays should do:
> >
> > [
> > ["Alabama", "AL"],
> > ["Alaska", "AK"]
> > ]
> >
> > musachy
> >
> > On Feb 4, 2008 2:46 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy
> > >
> > > Here is the autocompleter tag and the JSON returned...
> > >
> > > 
> > >  > > value="/search/searchByText.action"/>
> > >  > > name="text"
> > > dataFieldName="text"
> > > loadOnTextChange="true"
> > > indicator="indicator"
> > > dropdownHeight="300"
> > > cssStyle="width: 200px;"
> > > searchType="substring"
> > > autoComplete="false"
> > > showDownArrow="false"
> > > loadMinimumCount="3"/>
> > >  > > src="${pageContext.request.contextPath}/images/indicator.gif"
> > > alt="Loading..." style="display:none"/>
> > >
> > >
> > > [JSON][{"id":420,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> > > Application a ME, SE or EE
> > > application?"},{"id":440,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > Application is an SE application does it use Java Web
> > > Start?"},{"id":450,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > Application is a Java Web Application, list the application server
> > used
> > > for production"},{"id":490,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java
Web
> > > Services Technologies
> > > Used"},{"id":500,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java
Web
> > > Application Technologies Used for
> > > presentation"},{"id":510,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> > > Technologies used in your application"}]
> > >
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 1:22 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> 

Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
Take a look here:

http://cwiki.apache.org/S2PLUGINS/json-plugin.html

musachy

On Feb 4, 2008 3:43 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> So, if you have an array of Entity objects, in my case question:
>
> How can I produce?
>  {
>  "question" : [
>  ["1","question 1 text..."],
>  ["2","question 2 text..."]
>
>  ]
>  }
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 2:37 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> yes, but the output will depend on what you feed the JSON result.
>
> musachy
>
> On Feb 4, 2008 3:20 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy,
> >
> > I must have missed your point. Isn't the idea of using the JSON
> plug-in
> > so you don't have to iterate and create the list? If I have an array
> or
> > Entity objects or maps, isn't there a way that the plug-in will create
> > the JSON specified below?
> >
> > MG
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 1:56 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> >
> > to use the dataFIeldName, you have to return something like:
> >
> > {
> > "state" : [
> > ["Alabama","AL"],
> > ["Alaska","AK"]
> > ]
> > }
> >
> > if you are using 2.1 check this link:
> >
> >
> http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> > criptRecipes-Autocompleter
> >
> > otherwise just an array of arrays should do:
> >
> > [
> > ["Alabama", "AL"],
> > ["Alaska", "AK"]
> > ]
> >
> > musachy
> >
> > On Feb 4, 2008 2:46 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Musachy
> > >
> > > Here is the autocompleter tag and the JSON returned...
> > >
> > > 
> > >  > > value="/search/searchByText.action"/>
> > >  > > name="text"
> > > dataFieldName="text"
> > > loadOnTextChange="true"
> > > indicator="indicator"
> > > dropdownHeight="300"
> > > cssStyle="width: 200px;"
> > > searchType="substring"
> > > autoComplete="false"
> > > showDownArrow="false"
> > > loadMinimumCount="3"/>
> > >  > > src="${pageContext.request.contextPath}/images/indicator.gif"
> > > alt="Loading..." style="display:none"/>
> > >
> > >
> > > [JSON][{"id":420,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> > > Application a ME, SE or EE
> > > application?"},{"id":440,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > Application is an SE application does it use Java Web
> > > Start?"},{"id":450,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > > Application is a Java Web Application, list the application server
> > used
> > > for production"},{"id":490,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> > > Services Technologies
> > > Used"},{"id":500,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> > > Application Technologies Used for
> > > presentation"},{"id":510,"questionType":{"declaringClass":"class
> > > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> > > Technologies used in your application"}]
> > >
> > >
> > > -Original Message-
> > > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 1:22 PM
> > > To: Struts Users Mailing List
> > > Subject: Re: AjaxTag 1.3 support?
> > >
> > > funny thing is that now I remember the code(duh!), it is in the
> struts
> > > widget. It seems like the json is empty. Paste the section of your
> jsp
> > > with the autocompleter and the json that your action is returning.
> > >
> > > regards
> > > musachy
> > >
> > > On Feb 4, 2008 2:16 PM, Griffith, Michael *
> > > <[EMAIL PROTECTED]> wrote:
> > > > Jeromy,
> > > >
> > > > Thanks for your help. I was able to finally get the autocompleter
> to
> > > > work with the example you provided.
> > > >
> > > > Strange behavior -- I can only get the autocompleter to work if
> the
> > > list
> > > > (array) is of the type String. If I try to return an array of my
> > > Entity
> > > > objects, or a Map I get the dojo error:
> > > >
> > > > FATAL exception raised: TypeError: Value undefined (result of
> > > expression
> > > > this.data[x][0].toLowerCase) is not object.
> > > >
> > > > I tried specifying the attribute dataField on the autocompleter,
> and
> > > it
> > > > didn't work either.
> > > >
> > > > I should be able to serialize the entity objects right? The JSON
> > that
> > > > was passed back to the browser looked like it serialized my
> objects
> > 

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
So, if you have an array of Entity objects, in my case question:

How can I produce?
 {
 "question" : [
 ["1","question 1 text..."],
 ["2","question 2 text..."]
 ]
 }

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 2:37 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

yes, but the output will depend on what you feed the JSON result.

musachy

On Feb 4, 2008 3:20 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Musachy,
>
> I must have missed your point. Isn't the idea of using the JSON
plug-in
> so you don't have to iterate and create the list? If I have an array
or
> Entity objects or maps, isn't there a way that the plug-in will create
> the JSON specified below?
>
> MG
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 1:56 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
> to use the dataFIeldName, you have to return something like:
>
> {
> "state" : [
> ["Alabama","AL"],
> ["Alaska","AK"]
> ]
> }
>
> if you are using 2.1 check this link:
>
>
http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> criptRecipes-Autocompleter
>
> otherwise just an array of arrays should do:
>
> [
> ["Alabama", "AL"],
> ["Alaska", "AK"]
> ]
>
> musachy
>
> On Feb 4, 2008 2:46 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy
> >
> > Here is the autocompleter tag and the JSON returned...
> >
> > 
> >  > value="/search/searchByText.action"/>
> >  > name="text"
> > dataFieldName="text"
> > loadOnTextChange="true"
> > indicator="indicator"
> > dropdownHeight="300"
> > cssStyle="width: 200px;"
> > searchType="substring"
> > autoComplete="false"
> > showDownArrow="false"
> > loadMinimumCount="3"/>
> >  > src="${pageContext.request.contextPath}/images/indicator.gif"
> > alt="Loading..." style="display:none"/>
> >
> >
> > [JSON][{"id":420,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> > Application a ME, SE or EE
> > application?"},{"id":440,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > Application is an SE application does it use Java Web
> > Start?"},{"id":450,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > Application is a Java Web Application, list the application server
> used
> > for production"},{"id":490,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> > Services Technologies
> > Used"},{"id":500,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> > Application Technologies Used for
> > presentation"},{"id":510,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> > Technologies used in your application"}]
> >
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 1:22 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > funny thing is that now I remember the code(duh!), it is in the
struts
> > widget. It seems like the json is empty. Paste the section of your
jsp
> > with the autocompleter and the json that your action is returning.
> >
> > regards
> > musachy
> >
> > On Feb 4, 2008 2:16 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Jeromy,
> > >
> > > Thanks for your help. I was able to finally get the autocompleter
to
> > > work with the example you provided.
> > >
> > > Strange behavior -- I can only get the autocompleter to work if
the
> > list
> > > (array) is of the type String. If I try to return an array of my
> > Entity
> > > objects, or a Map I get the dojo error:
> > >
> > > FATAL exception raised: TypeError: Value undefined (result of
> > expression
> > > this.data[x][0].toLowerCase) is not object.
> > >
> > > I tried specifying the attribute dataField on the autocompleter,
and
> > it
> > > didn't work either.
> > >
> > > I should be able to serialize the entity objects right? The JSON
> that
> > > was passed back to the browser looked like it serialized my
objects
> > just
> > > fine.
> > >
> > > Again, thanks to all the people who replied to my question.
> > >
> > > MG
> > >
> > >
> > > -Original Message-
> > > From: Hodgins, Grant [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 12:31 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: AjaxTag 1.3 support?
> > >
> > > Thanks for the insight Jeremy.
> > >
> > > I totally agree that writing to the response is not an elegant
> > soluti

Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
yes, but the output will depend on what you feed the JSON result.

musachy

On Feb 4, 2008 3:20 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Musachy,
>
> I must have missed your point. Isn't the idea of using the JSON plug-in
> so you don't have to iterate and create the list? If I have an array or
> Entity objects or maps, isn't there a way that the plug-in will create
> the JSON specified below?
>
> MG
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 1:56 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
> to use the dataFIeldName, you have to return something like:
>
> {
> "state" : [
> ["Alabama","AL"],
> ["Alaska","AK"]
> ]
> }
>
> if you are using 2.1 check this link:
>
> http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
> criptRecipes-Autocompleter
>
> otherwise just an array of arrays should do:
>
> [
> ["Alabama", "AL"],
> ["Alaska", "AK"]
> ]
>
> musachy
>
> On Feb 4, 2008 2:46 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Musachy
> >
> > Here is the autocompleter tag and the JSON returned...
> >
> > 
> >  > value="/search/searchByText.action"/>
> >  > name="text"
> > dataFieldName="text"
> > loadOnTextChange="true"
> > indicator="indicator"
> > dropdownHeight="300"
> > cssStyle="width: 200px;"
> > searchType="substring"
> > autoComplete="false"
> > showDownArrow="false"
> > loadMinimumCount="3"/>
> >  > src="${pageContext.request.contextPath}/images/indicator.gif"
> > alt="Loading..." style="display:none"/>
> >
> >
> > [JSON][{"id":420,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> > Application a ME, SE or EE
> > application?"},{"id":440,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > Application is an SE application does it use Java Web
> > Start?"},{"id":450,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> > Application is a Java Web Application, list the application server
> used
> > for production"},{"id":490,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> > Services Technologies
> > Used"},{"id":500,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> > Application Technologies Used for
> > presentation"},{"id":510,"questionType":{"declaringClass":"class
> > gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> > Technologies used in your application"}]
> >
> >
> > -Original Message-
> > From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 1:22 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > funny thing is that now I remember the code(duh!), it is in the struts
> > widget. It seems like the json is empty. Paste the section of your jsp
> > with the autocompleter and the json that your action is returning.
> >
> > regards
> > musachy
> >
> > On Feb 4, 2008 2:16 PM, Griffith, Michael *
> > <[EMAIL PROTECTED]> wrote:
> > > Jeromy,
> > >
> > > Thanks for your help. I was able to finally get the autocompleter to
> > > work with the example you provided.
> > >
> > > Strange behavior -- I can only get the autocompleter to work if the
> > list
> > > (array) is of the type String. If I try to return an array of my
> > Entity
> > > objects, or a Map I get the dojo error:
> > >
> > > FATAL exception raised: TypeError: Value undefined (result of
> > expression
> > > this.data[x][0].toLowerCase) is not object.
> > >
> > > I tried specifying the attribute dataField on the autocompleter, and
> > it
> > > didn't work either.
> > >
> > > I should be able to serialize the entity objects right? The JSON
> that
> > > was passed back to the browser looked like it serialized my objects
> > just
> > > fine.
> > >
> > > Again, thanks to all the people who replied to my question.
> > >
> > > MG
> > >
> > >
> > > -Original Message-
> > > From: Hodgins, Grant [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, February 04, 2008 12:31 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: AjaxTag 1.3 support?
> > >
> > > Thanks for the insight Jeremy.
> > >
> > > I totally agree that writing to the response is not an elegant
> > solution.
> > > But sometimes we choose quick solutions that work when a project
> > > deadline looms.
> > >
> > > The reason I initially chose AjaxTags was that the example for the
> > > autocompleter combo in Struts Showcase didn't work in IE6(the last
> > one):
> > > http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
> > >
> > > Grant
> > >
> > > _

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Musachy,

I must have missed your point. Isn't the idea of using the JSON plug-in
so you don't have to iterate and create the list? If I have an array or
Entity objects or maps, isn't there a way that the plug-in will create
the JSON specified below?

MG

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 1:56 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

to use the dataFIeldName, you have to return something like:

{
"state" : [
["Alabama","AL"],
["Alaska","AK"]
]
}

if you are using 2.1 check this link:

http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaS
criptRecipes-Autocompleter

otherwise just an array of arrays should do:

[
["Alabama", "AL"],
["Alaska", "AK"]
]

musachy

On Feb 4, 2008 2:46 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Musachy
>
> Here is the autocompleter tag and the JSON returned...
>
> 
>  value="/search/searchByText.action"/>
>  name="text"
> dataFieldName="text"
> loadOnTextChange="true"
> indicator="indicator"
> dropdownHeight="300"
> cssStyle="width: 200px;"
> searchType="substring"
> autoComplete="false"
> showDownArrow="false"
> loadMinimumCount="3"/>
>  src="${pageContext.request.contextPath}/images/indicator.gif"
> alt="Loading..." style="display:none"/>
>
>
> [JSON][{"id":420,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> Application a ME, SE or EE
> application?"},{"id":440,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> Application is an SE application does it use Java Web
> Start?"},{"id":450,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> Application is a Java Web Application, list the application server
used
> for production"},{"id":490,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> Services Technologies
> Used"},{"id":500,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> Application Technologies Used for
> presentation"},{"id":510,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> Technologies used in your application"}]
>
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 1:22 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> funny thing is that now I remember the code(duh!), it is in the struts
> widget. It seems like the json is empty. Paste the section of your jsp
> with the autocompleter and the json that your action is returning.
>
> regards
> musachy
>
> On Feb 4, 2008 2:16 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Jeromy,
> >
> > Thanks for your help. I was able to finally get the autocompleter to
> > work with the example you provided.
> >
> > Strange behavior -- I can only get the autocompleter to work if the
> list
> > (array) is of the type String. If I try to return an array of my
> Entity
> > objects, or a Map I get the dojo error:
> >
> > FATAL exception raised: TypeError: Value undefined (result of
> expression
> > this.data[x][0].toLowerCase) is not object.
> >
> > I tried specifying the attribute dataField on the autocompleter, and
> it
> > didn't work either.
> >
> > I should be able to serialize the entity objects right? The JSON
that
> > was passed back to the browser looked like it serialized my objects
> just
> > fine.
> >
> > Again, thanks to all the people who replied to my question.
> >
> > MG
> >
> >
> > -Original Message-
> > From: Hodgins, Grant [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 12:31 PM
> > To: Struts Users Mailing List
> > Subject: RE: AjaxTag 1.3 support?
> >
> > Thanks for the insight Jeremy.
> >
> > I totally agree that writing to the response is not an elegant
> solution.
> > But sometimes we choose quick solutions that work when a project
> > deadline looms.
> >
> > The reason I initially chose AjaxTags was that the example for the
> > autocompleter combo in Struts Showcase didn't work in IE6(the last
> one):
> > http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
> >
> > Grant
> >
> > 
> >
> > From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> > Sent: Fri 2/1/2008 4:35 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> >
> >
> > My 2c:
> > I think this is a bad solution and shouldn't be encouraged.  It's
> > marginally better than writing a custom servlet.
> >
> > Struts2 ResultTypes [1] are designed specifically for controlling
the
> > type and content of results from 

Re: DAO pattern

2008-02-04 Thread Manos Batsis

Zhang, Larry (L.) wrote:

I have a user object whose data is from three resources: Db2, LDAP, and
other flat file. Per dao pattern, do you think I should have three daos
or one dao to encapsulate the data access implications? 


Depends on what is easier for you. This will not effect your code if you 
your DAOs implement a common interface and your code uses a DAO Factory 
to obtain the right DAO instance implementing that interface.


Personally, I have the habit of making one DAO per business entity, so I 
would join the three you mention into one. This or the opposite is 
mostly useful as a convention shared between members etc.


Cheers,

Manos

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



Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
to use the dataFIeldName, you have to return something like:

{
"state" : [
["Alabama","AL"],
["Alaska","AK"]
]
}

if you are using 2.1 check this link:

http://cwiki.apache.org/WW/ajax-and-javascript-recipes.html#AjaxandJavaScriptRecipes-Autocompleter

otherwise just an array of arrays should do:

[
["Alabama", "AL"],
["Alaska", "AK"]
]

musachy

On Feb 4, 2008 2:46 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Musachy
>
> Here is the autocompleter tag and the JSON returned...
>
> 
>  value="/search/searchByText.action"/>
>  name="text"
> dataFieldName="text"
> loadOnTextChange="true"
> indicator="indicator"
> dropdownHeight="300"
> cssStyle="width: 200px;"
> searchType="substring"
> autoComplete="false"
> showDownArrow="false"
> loadMinimumCount="3"/>
>  src="${pageContext.request.contextPath}/images/indicator.gif"
> alt="Loading..." style="display:none"/>
>
>
> [JSON][{"id":420,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
> Application a ME, SE or EE
> application?"},{"id":440,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> Application is an SE application does it use Java Web
> Start?"},{"id":450,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
> Application is a Java Web Application, list the application server used
> for production"},{"id":490,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> Services Technologies
> Used"},{"id":500,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
> Application Technologies Used for
> presentation"},{"id":510,"questionType":{"declaringClass":"class
> gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
> Technologies used in your application"}]
>
>
> -Original Message-
> From: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 1:22 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> funny thing is that now I remember the code(duh!), it is in the struts
> widget. It seems like the json is empty. Paste the section of your jsp
> with the autocompleter and the json that your action is returning.
>
> regards
> musachy
>
> On Feb 4, 2008 2:16 PM, Griffith, Michael *
> <[EMAIL PROTECTED]> wrote:
> > Jeromy,
> >
> > Thanks for your help. I was able to finally get the autocompleter to
> > work with the example you provided.
> >
> > Strange behavior -- I can only get the autocompleter to work if the
> list
> > (array) is of the type String. If I try to return an array of my
> Entity
> > objects, or a Map I get the dojo error:
> >
> > FATAL exception raised: TypeError: Value undefined (result of
> expression
> > this.data[x][0].toLowerCase) is not object.
> >
> > I tried specifying the attribute dataField on the autocompleter, and
> it
> > didn't work either.
> >
> > I should be able to serialize the entity objects right? The JSON that
> > was passed back to the browser looked like it serialized my objects
> just
> > fine.
> >
> > Again, thanks to all the people who replied to my question.
> >
> > MG
> >
> >
> > -Original Message-
> > From: Hodgins, Grant [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 04, 2008 12:31 PM
> > To: Struts Users Mailing List
> > Subject: RE: AjaxTag 1.3 support?
> >
> > Thanks for the insight Jeremy.
> >
> > I totally agree that writing to the response is not an elegant
> solution.
> > But sometimes we choose quick solutions that work when a project
> > deadline looms.
> >
> > The reason I initially chose AjaxTags was that the example for the
> > autocompleter combo in Struts Showcase didn't work in IE6(the last
> one):
> > http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
> >
> > Grant
> >
> > 
> >
> > From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> > Sent: Fri 2/1/2008 4:35 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> >
> >
> > My 2c:
> > I think this is a bad solution and shouldn't be encouraged.  It's
> > marginally better than writing a custom servlet.
> >
> > Struts2 ResultTypes [1] are designed specifically for controlling the
> > type and content of results from actions to separate the view from the
> > model, even if the "view" is XML data.  Accessing the response and
> > writing to it directly isn't necessary except in the rarest of cases.
> >
> > For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
> > [2] will serialize your action into JSON automatically
> > The XSL ResultType will serialize your action into XML if you provide
> a
> > stylesheet [3]
> > The REST plugin 

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Musachy

Here is the autocompleter tag and the JSON returned...


 




[JSON][{"id":420,"questionType":{"declaringClass":"class
gov.hhs.fda.datacall.model.QuestionType"},"text":"Is your Java
Application a ME, SE or EE
application?"},{"id":440,"questionType":{"declaringClass":"class
gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
Application is an SE application does it use Java Web
Start?"},{"id":450,"questionType":{"declaringClass":"class
gov.hhs.fda.datacall.model.QuestionType"},"text":"If your Java
Application is a Java Web Application, list the application server used
for production"},{"id":490,"questionType":{"declaringClass":"class
gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
Services Technologies
Used"},{"id":500,"questionType":{"declaringClass":"class
gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java Web
Application Technologies Used for
presentation"},{"id":510,"questionType":{"declaringClass":"class
gov.hhs.fda.datacall.model.QuestionType"},"text":"List any Java EE
Technologies used in your application"}]

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 1:22 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

funny thing is that now I remember the code(duh!), it is in the struts
widget. It seems like the json is empty. Paste the section of your jsp
with the autocompleter and the json that your action is returning.

regards
musachy

On Feb 4, 2008 2:16 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Jeromy,
>
> Thanks for your help. I was able to finally get the autocompleter to
> work with the example you provided.
>
> Strange behavior -- I can only get the autocompleter to work if the
list
> (array) is of the type String. If I try to return an array of my
Entity
> objects, or a Map I get the dojo error:
>
> FATAL exception raised: TypeError: Value undefined (result of
expression
> this.data[x][0].toLowerCase) is not object.
>
> I tried specifying the attribute dataField on the autocompleter, and
it
> didn't work either.
>
> I should be able to serialize the entity objects right? The JSON that
> was passed back to the browser looked like it serialized my objects
just
> fine.
>
> Again, thanks to all the people who replied to my question.
>
> MG
>
>
> -Original Message-
> From: Hodgins, Grant [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 12:31 PM
> To: Struts Users Mailing List
> Subject: RE: AjaxTag 1.3 support?
>
> Thanks for the insight Jeremy.
>
> I totally agree that writing to the response is not an elegant
solution.
> But sometimes we choose quick solutions that work when a project
> deadline looms.
>
> The reason I initially chose AjaxTags was that the example for the
> autocompleter combo in Struts Showcase didn't work in IE6(the last
one):
> http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
>
> Grant
>
> 
>
> From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> Sent: Fri 2/1/2008 4:35 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
>
> My 2c:
> I think this is a bad solution and shouldn't be encouraged.  It's
> marginally better than writing a custom servlet.
>
> Struts2 ResultTypes [1] are designed specifically for controlling the
> type and content of results from actions to separate the view from the
> model, even if the "view" is XML data.  Accessing the response and
> writing to it directly isn't necessary except in the rarest of cases.
>
> For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
> [2] will serialize your action into JSON automatically
> The XSL ResultType will serialize your action into XML if you provide
a
> stylesheet [3]
> The REST plugin includes code to serialize your action into XML using
> Xstream. [4]
>
> My point is, your action can setup a model (eg. a javabean matching
the
> model expected by AjaxTag), and the ResultType can serialize it to the
> output stream.  In this case I'd create a custom result type using
> XStream, but you could also use a XML template in a Tile, or have a
> ResultType that accesses the instance created by AjaxXMLBuilder.
>
> [1] http://struts.apache.org/2.0.11/docs/result-types.html
> [2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> [3] http://struts.apache.org/2.0.11/docs/xsl-result.html
> [4] http://xstream.codehaus.org/
> [5] http://struts.apache.org/2.0.11/docs/result-configuration.html
>
> regards
> Jeromy Evans
>
> Hodgins, Grant wrote:
> > I was able to get the AjaxTags stuff working (with Tiles2 although I
> don't think that matters at all).
> >
> > As Dave said, your action should return null since you want the
action
> to return XML in the response.
> >
> > Instead, in addition to returning a null result, I simply wrote the
> xml to the response:
> >
> > AjaxXmlBuilder xml = new AjaxXmlBuilder();
> >
> > ... build your xml response ...
> >
> > response.setContentType("text/xml;

[OT] Re: DAO pattern

2008-02-04 Thread Antonio Petrelli
2008/2/4, Zhang, Larry (L.) <[EMAIL PROTECTED]>:
> Sorry if this is not too on topic.
>
> I have a user object whose data is from three resources: Db2, LDAP, and
> other flat file. Per dao pattern, do you think I should have three daos
> or one dao to encapsulate the data access implications?

It depends.
If you can have the user object from one source at a time, then the
best approach IMHO is one interface/3 implementations.
If you are getting this user object from these sources at the same
time, use one DAO, and manage connections inside it.

Ciao
Antonio

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



DAO pattern

2008-02-04 Thread Zhang, Larry (L.)
Sorry if this is not too on topic.

I have a user object whose data is from three resources: Db2, LDAP, and
other flat file. Per dao pattern, do you think I should have three daos
or one dao to encapsulate the data access implications? 


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



Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
funny thing is that now I remember the code(duh!), it is in the struts
widget. It seems like the json is empty. Paste the section of your jsp
with the autocompleter and the json that your action is returning.

regards
musachy

On Feb 4, 2008 2:16 PM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Jeromy,
>
> Thanks for your help. I was able to finally get the autocompleter to
> work with the example you provided.
>
> Strange behavior -- I can only get the autocompleter to work if the list
> (array) is of the type String. If I try to return an array of my Entity
> objects, or a Map I get the dojo error:
>
> FATAL exception raised: TypeError: Value undefined (result of expression
> this.data[x][0].toLowerCase) is not object.
>
> I tried specifying the attribute dataField on the autocompleter, and it
> didn't work either.
>
> I should be able to serialize the entity objects right? The JSON that
> was passed back to the browser looked like it serialized my objects just
> fine.
>
> Again, thanks to all the people who replied to my question.
>
> MG
>
>
> -Original Message-
> From: Hodgins, Grant [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 04, 2008 12:31 PM
> To: Struts Users Mailing List
> Subject: RE: AjaxTag 1.3 support?
>
> Thanks for the insight Jeremy.
>
> I totally agree that writing to the response is not an elegant solution.
> But sometimes we choose quick solutions that work when a project
> deadline looms.
>
> The reason I initially chose AjaxTags was that the example for the
> autocompleter combo in Struts Showcase didn't work in IE6(the last one):
> http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
>
> Grant
>
> 
>
> From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> Sent: Fri 2/1/2008 4:35 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
>
> My 2c:
> I think this is a bad solution and shouldn't be encouraged.  It's
> marginally better than writing a custom servlet.
>
> Struts2 ResultTypes [1] are designed specifically for controlling the
> type and content of results from actions to separate the view from the
> model, even if the "view" is XML data.  Accessing the response and
> writing to it directly isn't necessary except in the rarest of cases.
>
> For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
> [2] will serialize your action into JSON automatically
> The XSL ResultType will serialize your action into XML if you provide a
> stylesheet [3]
> The REST plugin includes code to serialize your action into XML using
> Xstream. [4]
>
> My point is, your action can setup a model (eg. a javabean matching the
> model expected by AjaxTag), and the ResultType can serialize it to the
> output stream.  In this case I'd create a custom result type using
> XStream, but you could also use a XML template in a Tile, or have a
> ResultType that accesses the instance created by AjaxXMLBuilder.
>
> [1] http://struts.apache.org/2.0.11/docs/result-types.html
> [2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html
> [3] http://struts.apache.org/2.0.11/docs/xsl-result.html
> [4] http://xstream.codehaus.org/
> [5] http://struts.apache.org/2.0.11/docs/result-configuration.html
>
> regards
> Jeromy Evans
>
> Hodgins, Grant wrote:
> > I was able to get the AjaxTags stuff working (with Tiles2 although I
> don't think that matters at all).
> >
> > As Dave said, your action should return null since you want the action
> to return XML in the response.
> >
> > Instead, in addition to returning a null result, I simply wrote the
> xml to the response:
> >
> > AjaxXmlBuilder xml = new AjaxXmlBuilder();
> >
> > ... build your xml response ...
> >
> > response.setContentType("text/xml; charset=iso-8859-1");
> > response.setHeader("Cache-Control", "no-store, max-age=0, no-cache,
> must-revalidate");
> > response.addHeader("Cache-Control", "post-check=0, pre-check=0");
> > response.setHeader("Pragma", "no-cache");
> >
> > PrintWriter pw = response.getWriter();
> > pw.write(xml.toString());
> > pw.close();
> >
> > Hope this helps.
> >
> > Grant
> >
> > 
> >
> > From: Griffith, Michael * [mailto:[EMAIL PROTECTED]
> > Sent: Fri 2/1/2008 3:48 PM
> > To: Struts Users Mailing List
> > Subject: RE: AjaxTag 1.3 support?
> >
> >
> >
> > Dave,
> >
> > Thanks for the reply. I guess I should have said freemarker instead of
> > sitemesh...?  At any rate, when the docs don't match the release, it's
> a
> > bad thing.
> >
> > I shouldn't need to do any of this should I? Can you point me at a
> > simple, minimalist example of the  tag?
> >
> > mg
> >
> > -Original Message-
> > From: Dave Newton [mailto:[EMAIL PROTECTED]
> > Sent: Friday, February 01, 2008 5:42 PM
> > To: Struts Users Mailing List
> > Subject: Re: AjaxTag 1.3 support?
> >
> > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> >
> >> public class QuestionAction extends BaseAction implements
> >> ModelDriven, Preparable, ServletRequestAw

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Jeromy, 

Thanks for your help. I was able to finally get the autocompleter to
work with the example you provided. 

Strange behavior -- I can only get the autocompleter to work if the list
(array) is of the type String. If I try to return an array of my Entity
objects, or a Map I get the dojo error:

FATAL exception raised: TypeError: Value undefined (result of expression
this.data[x][0].toLowerCase) is not object.

I tried specifying the attribute dataField on the autocompleter, and it
didn't work either.  

I should be able to serialize the entity objects right? The JSON that
was passed back to the browser looked like it serialized my objects just
fine.

Again, thanks to all the people who replied to my question.

MG

-Original Message-
From: Hodgins, Grant [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 12:31 PM
To: Struts Users Mailing List
Subject: RE: AjaxTag 1.3 support?

Thanks for the insight Jeremy.
 
I totally agree that writing to the response is not an elegant solution.
But sometimes we choose quick solutions that work when a project
deadline looms.
 
The reason I initially chose AjaxTags was that the example for the
autocompleter combo in Struts Showcase didn't work in IE6(the last one):
http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
 
Grant



From: Jeromy Evans [mailto:[EMAIL PROTECTED]
Sent: Fri 2/1/2008 4:35 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?



My 2c:
I think this is a bad solution and shouldn't be encouraged.  It's
marginally better than writing a custom servlet.

Struts2 ResultTypes [1] are designed specifically for controlling the
type and content of results from actions to separate the view from the
model, even if the "view" is XML data.  Accessing the response and
writing to it directly isn't necessary except in the rarest of cases.

For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
[2] will serialize your action into JSON automatically
The XSL ResultType will serialize your action into XML if you provide a
stylesheet [3]
The REST plugin includes code to serialize your action into XML using
Xstream. [4]

My point is, your action can setup a model (eg. a javabean matching the
model expected by AjaxTag), and the ResultType can serialize it to the
output stream.  In this case I'd create a custom result type using
XStream, but you could also use a XML template in a Tile, or have a
ResultType that accesses the instance created by AjaxXMLBuilder.

[1] http://struts.apache.org/2.0.11/docs/result-types.html
[2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html
[3] http://struts.apache.org/2.0.11/docs/xsl-result.html
[4] http://xstream.codehaus.org/
[5] http://struts.apache.org/2.0.11/docs/result-configuration.html

regards
Jeromy Evans

Hodgins, Grant wrote:
> I was able to get the AjaxTags stuff working (with Tiles2 although I
don't think that matters at all).
>
> As Dave said, your action should return null since you want the action
to return XML in the response.
> 
> Instead, in addition to returning a null result, I simply wrote the
xml to the response:
> 
> AjaxXmlBuilder xml = new AjaxXmlBuilder();
>
> ... build your xml response ...
>
> response.setContentType("text/xml; charset=iso-8859-1");
> response.setHeader("Cache-Control", "no-store, max-age=0, no-cache,
must-revalidate");
> response.addHeader("Cache-Control", "post-check=0, pre-check=0");
> response.setHeader("Pragma", "no-cache");
> 
> PrintWriter pw = response.getWriter();
> pw.write(xml.toString());
> pw.close();
> 
> Hope this helps.
> 
> Grant
>
> 
>
> From: Griffith, Michael * [mailto:[EMAIL PROTECTED]
> Sent: Fri 2/1/2008 3:48 PM
> To: Struts Users Mailing List
> Subject: RE: AjaxTag 1.3 support?
>
>
>
> Dave,
>
> Thanks for the reply. I guess I should have said freemarker instead of
> sitemesh...?  At any rate, when the docs don't match the release, it's
a
> bad thing.
>
> I shouldn't need to do any of this should I? Can you point me at a
> simple, minimalist example of the  tag?
>
> mg
>
> -Original Message-
> From: Dave Newton [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 01, 2008 5:42 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
>  
>> public class QuestionAction extends BaseAction implements
>> ModelDriven, Preparable, ServletRequestAware,
>> ServletResponseAware {
>>   public String getSearchTerm() throws Exception {
>>   System.out.println(" Question Search Term:" + qt);
>>   List results=
>>
> questionService.getQuestions(qt);
>  
>>   AjaxXmlBuilder builder= new AjaxXmlBuilder();
>>   builder.addItems(results, "questionType", "text");
>> 
>>response.setContentType("text/xml");
>>response.setHeader("Cache-Control", "no-cache");
>>ServletOutputStr

Re: [OT] Killer Scam

2008-02-04 Thread Antonio Petrelli
2008/2/4, Greg Reddin <[EMAIL PROTECTED]>:
> On Feb 4, 2008 4:47 AM, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> > I received an email scam in my apache.org email that is,
> > substantially, the first in this list:
> > http://www.scamorama.com/killer.html
> >
> > Did you receive such a letter?
>
> Yep, I got one. Somebody don't like Tiles I guess :-)

Or Apache in General. I have a name in mind, we'd better support him
in buying Yahoo...

Antonio

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



RE: AjaxTag 1.3 support?

2008-02-04 Thread Hodgins, Grant
Thanks for the insight Jeremy.
 
I totally agree that writing to the response is not an elegant solution. But 
sometimes we choose quick solutions that work when a project deadline looms.
 
The reason I initially chose AjaxTags was that the example for the 
autocompleter combo in Struts Showcase didn't work in IE6(the last one):
http://www.planetstruts.org/struts2-showcase/ajax/autocompleter/
 
Grant



From: Jeromy Evans [mailto:[EMAIL PROTECTED]
Sent: Fri 2/1/2008 4:35 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?



My 2c:
I think this is a bad solution and shouldn't be encouraged.  It's
marginally better than writing a custom servlet.

Struts2 ResultTypes [1] are designed specifically for controlling the
type and content of results from actions to separate the view from the
model, even if the "view" is XML data.  Accessing the response and
writing to it directly isn't necessary except in the rarest of cases.

For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
[2] will serialize your action into JSON automatically
The XSL ResultType will serialize your action into XML if you provide a
stylesheet [3]
The REST plugin includes code to serialize your action into XML using
Xstream. [4]

My point is, your action can setup a model (eg. a javabean matching the
model expected by AjaxTag), and the ResultType can serialize it to the
output stream.  In this case I'd create a custom result type using
XStream, but you could also use a XML template in a Tile, or have a
ResultType that accesses the instance created by AjaxXMLBuilder.

[1] http://struts.apache.org/2.0.11/docs/result-types.html
[2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html
[3] http://struts.apache.org/2.0.11/docs/xsl-result.html
[4] http://xstream.codehaus.org/
[5] http://struts.apache.org/2.0.11/docs/result-configuration.html

regards
Jeromy Evans

Hodgins, Grant wrote:
> I was able to get the AjaxTags stuff working (with Tiles2 although I don't 
> think that matters at all).
>
> As Dave said, your action should return null since you want the action to 
> return XML in the response.
> 
> Instead, in addition to returning a null result, I simply wrote the xml to 
> the response:
> 
> AjaxXmlBuilder xml = new AjaxXmlBuilder();
>
> ... build your xml response ...
>
> response.setContentType("text/xml; charset=iso-8859-1");
> response.setHeader("Cache-Control", "no-store, max-age=0, no-cache, 
> must-revalidate");
> response.addHeader("Cache-Control", "post-check=0, pre-check=0");
> response.setHeader("Pragma", "no-cache");
> 
> PrintWriter pw = response.getWriter();
> pw.write(xml.toString());
> pw.close();
> 
> Hope this helps.
> 
> Grant
>
> 
>
> From: Griffith, Michael * [mailto:[EMAIL PROTECTED]
> Sent: Fri 2/1/2008 3:48 PM
> To: Struts Users Mailing List
> Subject: RE: AjaxTag 1.3 support?
>
>
>
> Dave,
>
> Thanks for the reply. I guess I should have said freemarker instead of
> sitemesh...?  At any rate, when the docs don't match the release, it's a
> bad thing.
>
> I shouldn't need to do any of this should I? Can you point me at a
> simple, minimalist example of the  tag?
>
> mg
>
> -Original Message-
> From: Dave Newton [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 01, 2008 5:42 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
>  
>> public class QuestionAction extends BaseAction implements
>> ModelDriven, Preparable, ServletRequestAware,
>> ServletResponseAware {
>>   public String getSearchTerm() throws Exception {
>>   System.out.println(" Question Search Term:" + qt);
>>   List results=
>>
> questionService.getQuestions(qt);
>  
>>   AjaxXmlBuilder builder= new AjaxXmlBuilder();
>>   builder.addItems(results, "questionType", "text");
>> 
>>response.setContentType("text/xml");
>>response.setHeader("Cache-Control", "no-cache");
>>ServletOutputStream out = response.getOutputStream();
>>out.print(builder.toString());
>>out.close();
>> 
>>   return SUCCESS;
>>   }
>>
>> My struts mapping:
>>
>>   > namespace="/question">
>>   > class="...QuestionAction">
>>   > type="tiles">question.panel
>>   
>>   
>>
>
> If you're writing directly to the stream I doubt you'd even want to
> return
> anything other than a null from the action, no? What is the
> "question.panel"
> tile?
>
>  
>> The struts 2 Ajax documentation seems manic and dated. It seems the S2
>> Ajax implementation is tied closely to sitemesh, which I am not using.
>>
>
> SiteMesh? The Ajax implementation isn't tied to SiteMesh at all.
>
> Dated? Much of the S2 Ajax documentation is for S2.1, which isn't even
> released yet. If anything, it's pre-dated.
>

Re: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

2008-02-04 Thread Laurie Harper

Doesn't that need to be theme="ajax"?

Serge Bornow wrote:

Hello Jeromy,

I do have :  
Also, i use Netbeans to generate respective get/set method so they are 
JavaBean std compliant.


The issue for me unfortunately is getting the value back , it seems to 
lose it.

:(

Thanks for feedback though.

Serge

Jeromy Evans wrote:

Hi Serge,

You'll find many emails in this forum relating to DatePicker 
problems.  Some of the solutions are here: 
http://cwiki.apache.org/S2WIKI/vault.html


In this case though, is it possible you've forgotten the s:head tag at 
the top of the page?


Serge Bornow wrote:

Hi All,

I:'ve been battling this for many hours.
I hope someone can help.
Using JDK 1.5, Struts 2.0.11


My property:
shoot_date of type Date
has get and set and on execute()
set's the default date to today's date
setShoot_Date(new Date);

on the form:

even without displayformat it doesn't work.

what happens is that i click the submit button that submits an action 
that executes a method that tries to read the shoot_date and it's null.


Hence the error in my log:

java.text.ParseException: Unparseable date: ""
   at java.text.DateFormat.parse(DateFormat.java:337)
   at 
org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 




Does anyone have a good working example?

Thank you very much,

Serge


-
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: [OT] Killer Scam

2008-02-04 Thread bhaarat Sharma
i do see a shady construction truck outside my building

On 2/4/08, Greg Reddin <[EMAIL PROTECTED]> wrote:
That\'s awesome :-)
>
> On Feb 4, 2008 11:30 AM, Wes Wannemacher <[EMAIL PROTECTED]> wrote:
> > Sorry everyone, I guess I should take two lessons away from this -
> >
> > 1. No matter how frustrated you get with a project, you should never
> > take it out on other users.
> >
> > 2. I should do a bit more research on the integrity of the hitmen I
> > hire before agreeing to a contract.
> >
> > There is nothing to worry about, I already revoked the contract.
> >
> > -Wes
> >
> > Disclaimer: This is a JOKE! I am more of a do-it-yourself kind of guy
> > anyways, a contract hit wouldn\'t be my style.
> >
> > On 2/4/08, Greg Reddin <[EMAIL PROTECTED]> wrote:
> >
> > > On Feb 4, 2008 11:00 AM, bhaarat Sharma <[EMAIL PROTECTED]> wrote:
> > > > I didnt get it. or maybe i deleted it already.
> > > >
> > > > Anyone wana paste what it read?
> > >
> > > Antonio\'s post had the link:
> > >
> > > http://www.scamorama.com/killer.html
> > >
> > > Maybe you should be worried if you didn\'t get one :-)
> > >
> > > Greg
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Wesley Wannemacher
> > President, Head Engineer/Consultant
> > WanTii, Inc.
> > http://www.wantii.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]
>
>

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



Re: [OT] Killer Scam

2008-02-04 Thread Greg Reddin
That's awesome :-)

On Feb 4, 2008 11:30 AM, Wes Wannemacher <[EMAIL PROTECTED]> wrote:
> Sorry everyone, I guess I should take two lessons away from this -
>
> 1. No matter how frustrated you get with a project, you should never
> take it out on other users.
>
> 2. I should do a bit more research on the integrity of the hitmen I
> hire before agreeing to a contract.
>
> There is nothing to worry about, I already revoked the contract.
>
> -Wes
>
> Disclaimer: This is a JOKE! I am more of a do-it-yourself kind of guy
> anyways, a contract hit wouldn't be my style.
>
> On 2/4/08, Greg Reddin <[EMAIL PROTECTED]> wrote:
>
> > On Feb 4, 2008 11:00 AM, bhaarat Sharma <[EMAIL PROTECTED]> wrote:
> > > I didnt get it. or maybe i deleted it already.
> > >
> > > Anyone wana paste what it read?
> >
> > Antonio's post had the link:
> >
> > http://www.scamorama.com/killer.html
> >
> > Maybe you should be worried if you didn't get one :-)
> >
> > Greg
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Wesley Wannemacher
> President, Head Engineer/Consultant
> WanTii, Inc.
> http://www.wantii.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: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Actually, I thought I would post the entire debug message here, in case
that is helpful:

DEBUG: DEPRECATED: dojo.widget.Manager.getImplementationName Could not
locate widget implementation for "html" in "html.widget" registered to
namespace "html". Developers must specify correct namespaces for all
non-Dojo widgets -- will be removed in version: 0.5
DEBUG: dojo.widget.Parse: error:TypeError: Value [object Object] (result
of expression impl) is not a constructor. Cannot be used with new.
FATAL exception raised: TypeError: Value undefined (result of expression
this.data[x][0].toLowerCase) is not object.

MG

-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 11:06 AM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

I think that error is coming from your jsp, not the JSON generation.
Do you have "this.data[x][0].toLowerCase" somewhere?

musachy

On Feb 4, 2008 11:57 AM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Jeromy,
>
> Again, thanks for the reply. I appreciate your help!
>
> Following your example below, I can see the JSON result in the app
> server console when the action called, but I get the following error
in
> the browser:
>
> FATAL exception raised: TypeError: Value undefined (result of
expression
> this.data[x][0].toLowerCase) is not object.
>
> What is this telling me?
>
> -- my Struts mapping:
>  namespace="/search">
>  class="...QuestionSearchAction">
> 
> list
> 
> 
> 
>
> -- My Form:
> 
>  loadOnTextChange="true" loadMinimumCount="3"/>
>
>
> -- My Action:
> public class QuestionSearchAction extends BaseAction {
>
> /**
>  *
>  */
> private static final long serialVersionUID =
> 1127012585409657094L;
>
> Question[] list;
> private QuestionService questionService;
>
> public void setQuestionService(QuestionService
questionService)
> {
> this.questionService = questionService;
> }
>
> public String execute() {
> List all= questionService.getQuestions();
> list= all.toArray( new Question[all.size()]);
> return SUCCESS;
>  }
>
> public Question[] getList(){
> return list;
> }
>
> }
>
>
> Cheers!
> mg
>
> -Original Message-
> From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 02, 2008 6:15 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
> I completely agree with Dave so I'll take a different tact.
>
> Based on this example:
>
http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet
> erTag,
> I would also take the approach of returning a JSON Result via the JSON
> Plugin.  Only the configuration changes for an XML result.
>
> So, my form looks like this:
>
> 
> 
>
> So, my struts.xml contains the corresponding action definition with a
> JSON result:
>
> 
>
>
>   list
>
>
>  
>
> And my action method looks like this:
>
> private ACEntry[] list;
>
> public String execute() {
> list = populateList()
> return "success";
>  }
>
> public ACEntry[] getList() {
>return list;
> }
>
> ---
> In summary, the autocompleter does a get to /JSONList.action
> Struts2 executes the execute method of ListAction
> The execute method creates a structure that will populate the
> autocompleter
> The action returns a JSON result type
> The JSON plugin converts the root object (the list property only
rather
> than the whole action) to a JSON structure
> The JSON plugin returns the application/json content to the
> autocompleter
>
> I'll leave it to you to determine what the list structure should like
> like.  As it'll probably be re-use I'd create a bean for the purpose.
> Use the FireBug plugin for firefox to inspect the format of the JSON
> result to ensure it matches the format required by the javascript
> library (or even better, write a unit test).
> This will work with any javascript library that accepts JSON - you
just
> have to provide an appropriate structure.  It will also work with any
> library that requires an XML response, except you'd use an XML result
> type like I previously described in this thread.
>
> I hope that helps.  Struts2 is really well suited at providing
non-html
> responses if you take the time to understand the ResultType
> architecture.
>
> cheers,
>  Jeromy Evans
>
> Dave Newton wrote:
> > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> >
> >> Thanks for the comprehensive reply. Looking at the documentation
and
> the
> >> example app, I am still not sure how to configure my
action/response.
> I
> >> am using tiles 2.
> >>
> >
> > As previously stated if you are writing directly to the response you
> need to
> > return null from the action. I am still not sure why you're using a
> tile
> > definitio

RE: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Musachy, 

The error displays in the browser, true, but I believe this is because I
have:  set to show debug.

So this is an ajax/dojo message...?

I don't have any code such as: "this.data[x][0].toLowerCase" anywhere in
the JSP or javascript sources.

Oh, and I have given up on AjaxTags -- it seems silly to include another
library to do what is already built into struts. Now if I can just get
it to work...

Cheers!

MG
-Original Message-
From: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 04, 2008 11:06 AM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

I think that error is coming from your jsp, not the JSON generation.
Do you have "this.data[x][0].toLowerCase" somewhere?

musachy

On Feb 4, 2008 11:57 AM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Jeromy,
>
> Again, thanks for the reply. I appreciate your help!
>
> Following your example below, I can see the JSON result in the app
> server console when the action called, but I get the following error
in
> the browser:
>
> FATAL exception raised: TypeError: Value undefined (result of
expression
> this.data[x][0].toLowerCase) is not object.
>
> What is this telling me?
>
> -- my Struts mapping:
>  namespace="/search">
>  class="...QuestionSearchAction">
> 
> list
> 
> 
> 
>
> -- My Form:
> 
>  loadOnTextChange="true" loadMinimumCount="3"/>
>
>
> -- My Action:
> public class QuestionSearchAction extends BaseAction {
>
> /**
>  *
>  */
> private static final long serialVersionUID =
> 1127012585409657094L;
>
> Question[] list;
> private QuestionService questionService;
>
> public void setQuestionService(QuestionService
questionService)
> {
> this.questionService = questionService;
> }
>
> public String execute() {
> List all= questionService.getQuestions();
> list= all.toArray( new Question[all.size()]);
> return SUCCESS;
>  }
>
> public Question[] getList(){
> return list;
> }
>
> }
>
>
> Cheers!
> mg
>
> -Original Message-
> From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 02, 2008 6:15 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
> I completely agree with Dave so I'll take a different tact.
>
> Based on this example:
>
http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet
> erTag,
> I would also take the approach of returning a JSON Result via the JSON
> Plugin.  Only the configuration changes for an XML result.
>
> So, my form looks like this:
>
> 
> 
>
> So, my struts.xml contains the corresponding action definition with a
> JSON result:
>
> 
>
>
>   list
>
>
>  
>
> And my action method looks like this:
>
> private ACEntry[] list;
>
> public String execute() {
> list = populateList()
> return "success";
>  }
>
> public ACEntry[] getList() {
>return list;
> }
>
> ---
> In summary, the autocompleter does a get to /JSONList.action
> Struts2 executes the execute method of ListAction
> The execute method creates a structure that will populate the
> autocompleter
> The action returns a JSON result type
> The JSON plugin converts the root object (the list property only
rather
> than the whole action) to a JSON structure
> The JSON plugin returns the application/json content to the
> autocompleter
>
> I'll leave it to you to determine what the list structure should like
> like.  As it'll probably be re-use I'd create a bean for the purpose.
> Use the FireBug plugin for firefox to inspect the format of the JSON
> result to ensure it matches the format required by the javascript
> library (or even better, write a unit test).
> This will work with any javascript library that accepts JSON - you
just
> have to provide an appropriate structure.  It will also work with any
> library that requires an XML response, except you'd use an XML result
> type like I previously described in this thread.
>
> I hope that helps.  Struts2 is really well suited at providing
non-html
> responses if you take the time to understand the ResultType
> architecture.
>
> cheers,
>  Jeromy Evans
>
> Dave Newton wrote:
> > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> >
> >> Thanks for the comprehensive reply. Looking at the documentation
and
> the
> >> example app, I am still not sure how to configure my
action/response.
> I
> >> am using tiles 2.
> >>
> >
> > As previously stated if you are writing directly to the response you
> need to
> > return null from the action. I am still not sure why you're using a
> tile
> > definition here.
> >
> >
> >
> >> It seems I need to return my result in JSON format correct? By
> returning
> >> a JSON String from the action, how to I configure my response?
> >>
> >
> > As Jeremy 

Re: [OT] Killer Scam

2008-02-04 Thread Wes Wannemacher
Sorry everyone, I guess I should take two lessons away from this -

1. No matter how frustrated you get with a project, you should never
take it out on other users.

2. I should do a bit more research on the integrity of the hitmen I
hire before agreeing to a contract.

There is nothing to worry about, I already revoked the contract.

-Wes

Disclaimer: This is a JOKE! I am more of a do-it-yourself kind of guy
anyways, a contract hit wouldn't be my style.

On 2/4/08, Greg Reddin <[EMAIL PROTECTED]> wrote:
> On Feb 4, 2008 11:00 AM, bhaarat Sharma <[EMAIL PROTECTED]> wrote:
> > I didnt get it. or maybe i deleted it already.
> >
> > Anyone wana paste what it read?
>
> Antonio's post had the link:
>
> http://www.scamorama.com/killer.html
>
> Maybe you should be worried if you didn't get one :-)
>
> Greg
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

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



RE: Struts validator

2008-02-04 Thread Alexandru BARBAT
Hi,

You can override method 
 public String getValidationKey(ActionMapping mapping,
   HttpServletRequest request) {..}

>From your ValidatorForm (it doesn't matter if it is dyna or not)

And return different validation keys for each button pressed.

Validation key identify the rules of validation.

The validation file will look then something like:


 


   





 




alex

-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 01, 2008 6:29 PM
To: Struts Users Mailing List
Subject: RE: Struts validator

--- "Zhang, Larry (L.)" <[EMAIL PROTECTED]> wrote:
> No, I am using struts 1.1,

Oh, wow.

Does validwhen[1] not exist in S1.1? You can always create a custom
validator
as well if you find your validation stretches what's easy to do with the
existing validation configuration possibilities. You may also be able to
combine declarative validation (via XML) and Java-based validation, although
it's been a pretty long time since I've thought about that :)

Dave

[1] http://struts.apache.org/1.1/userGuide/dev_validator.html (about 1/3 of
the way down)


-
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: question on mapping

2008-02-04 Thread Giovanni Azua
Thanks this looks like what I was looking for. I will have to see how to 
define a custom stack

and use the two together ...

regards,
Giovanni

Jeromy Evans wrote:
Will CodeBehind give what you need?  I'm not sure with your use of 
wildcards.
It gives "pages with no mapping": a default do-nothing action that 
provides access to s2 tags & resources...but not to a default tile AFAIK


http://struts.apache.org/2.0.11/docs/codebehind-plugin.html

Giovanni Azua wrote:

hi,

Suppose you have a struts.xml mapping that looks like:

class="com.sag.optimizer.ui.web.action.form.Form{1}Action">

  webui.form{1}
  webui.failed
  In several cases I will probably want to provide a 
valid non empty implementation of a corresponding Form{1}Action.class 
but in some cases I don't want to have to provide any but a default 
implementation e.g. FormGenericAction that just extends 
ActionSupport. Is there any way to do that?


My coverage reports are getting uglier and this is one of the reasons :)

regards,
Giovanni

-
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: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
I think that error is coming from your jsp, not the JSON generation.
Do you have "this.data[x][0].toLowerCase" somewhere?

musachy

On Feb 4, 2008 11:57 AM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Jeromy,
>
> Again, thanks for the reply. I appreciate your help!
>
> Following your example below, I can see the JSON result in the app
> server console when the action called, but I get the following error in
> the browser:
>
> FATAL exception raised: TypeError: Value undefined (result of expression
> this.data[x][0].toLowerCase) is not object.
>
> What is this telling me?
>
> -- my Struts mapping:
>  namespace="/search">
>  class="...QuestionSearchAction">
> 
> list
> 
> 
> 
>
> -- My Form:
> 
>  loadOnTextChange="true" loadMinimumCount="3"/>
>
>
> -- My Action:
> public class QuestionSearchAction extends BaseAction {
>
> /**
>  *
>  */
> private static final long serialVersionUID =
> 1127012585409657094L;
>
> Question[] list;
> private QuestionService questionService;
>
> public void setQuestionService(QuestionService questionService)
> {
> this.questionService = questionService;
> }
>
> public String execute() {
> List all= questionService.getQuestions();
> list= all.toArray( new Question[all.size()]);
> return SUCCESS;
>  }
>
> public Question[] getList(){
> return list;
> }
>
> }
>
>
> Cheers!
> mg
>
> -Original Message-
> From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 02, 2008 6:15 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
> I completely agree with Dave so I'll take a different tact.
>
> Based on this example:
> http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet
> erTag,
> I would also take the approach of returning a JSON Result via the JSON
> Plugin.  Only the configuration changes for an XML result.
>
> So, my form looks like this:
>
> 
> 
>
> So, my struts.xml contains the corresponding action definition with a
> JSON result:
>
> 
>
>
>   list
>
>
>  
>
> And my action method looks like this:
>
> private ACEntry[] list;
>
> public String execute() {
> list = populateList()
> return "success";
>  }
>
> public ACEntry[] getList() {
>return list;
> }
>
> ---
> In summary, the autocompleter does a get to /JSONList.action
> Struts2 executes the execute method of ListAction
> The execute method creates a structure that will populate the
> autocompleter
> The action returns a JSON result type
> The JSON plugin converts the root object (the list property only rather
> than the whole action) to a JSON structure
> The JSON plugin returns the application/json content to the
> autocompleter
>
> I'll leave it to you to determine what the list structure should like
> like.  As it'll probably be re-use I'd create a bean for the purpose.
> Use the FireBug plugin for firefox to inspect the format of the JSON
> result to ensure it matches the format required by the javascript
> library (or even better, write a unit test).
> This will work with any javascript library that accepts JSON - you just
> have to provide an appropriate structure.  It will also work with any
> library that requires an XML response, except you'd use an XML result
> type like I previously described in this thread.
>
> I hope that helps.  Struts2 is really well suited at providing non-html
> responses if you take the time to understand the ResultType
> architecture.
>
> cheers,
>  Jeromy Evans
>
> Dave Newton wrote:
> > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> >
> >> Thanks for the comprehensive reply. Looking at the documentation and
> the
> >> example app, I am still not sure how to configure my action/response.
> I
> >> am using tiles 2.
> >>
> >
> > As previously stated if you are writing directly to the response you
> need to
> > return null from the action. I am still not sure why you're using a
> tile
> > definition here.
> >
> >
> >
> >> It seems I need to return my result in JSON format correct? By
> returning
> >> a JSON String from the action, how to I configure my response?
> >>
> >
> > As Jeremy said this is, however, probably a bad idea, considering that
> the
> > same outcome can be achieved in several different ways.
> >
> > Using a JSON result will serialize your action to JSON automagically.
> You'd
> > use a "json" result (via the JSON plugin), not a tile. Or you could
> build the
> > JSON manually and configure a FreeMarker result.
> >
> >
> >> If I use the tiles response type, I get a dojo parsing error because
> the
> >> whole page is returned from the reply.
> >>
> >
> > Sure.
> >
> >
> >> The example in the example app isn't very clear to me, as the action
> >> returns a .JS file

Re: [OT] Killer Scam

2008-02-04 Thread Greg Reddin
On Feb 4, 2008 11:00 AM, bhaarat Sharma <[EMAIL PROTECTED]> wrote:
> I didnt get it. or maybe i deleted it already.
>
> Anyone wana paste what it read?

Antonio's post had the link:

http://www.scamorama.com/killer.html

Maybe you should be worried if you didn't get one :-)

Greg

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



Re: AjaxTag 1.3 support?

2008-02-04 Thread Musachy Barroso
sorry to be late to this discussion. Dave and Jeromy are right on the
spot. I would advise not to use ajaxtags project and go with what
Struts 2 provides, or use YUI which will play nicely with JSON.

musachy

On Feb 4, 2008 11:57 AM, Griffith, Michael *
<[EMAIL PROTECTED]> wrote:
> Jeromy,
>
> Again, thanks for the reply. I appreciate your help!
>
> Following your example below, I can see the JSON result in the app
> server console when the action called, but I get the following error in
> the browser:
>
> FATAL exception raised: TypeError: Value undefined (result of expression
> this.data[x][0].toLowerCase) is not object.
>
> What is this telling me?
>
> -- my Struts mapping:
>  namespace="/search">
>  class="...QuestionSearchAction">
> 
> list
> 
> 
> 
>
> -- My Form:
> 
>  loadOnTextChange="true" loadMinimumCount="3"/>
>
>
> -- My Action:
> public class QuestionSearchAction extends BaseAction {
>
> /**
>  *
>  */
> private static final long serialVersionUID =
> 1127012585409657094L;
>
> Question[] list;
> private QuestionService questionService;
>
> public void setQuestionService(QuestionService questionService)
> {
> this.questionService = questionService;
> }
>
> public String execute() {
> List all= questionService.getQuestions();
> list= all.toArray( new Question[all.size()]);
> return SUCCESS;
>  }
>
> public Question[] getList(){
> return list;
> }
>
> }
>
>
> Cheers!
> mg
>
> -Original Message-
> From: Jeromy Evans [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 02, 2008 6:15 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
>
> I completely agree with Dave so I'll take a different tact.
>
> Based on this example:
> http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet
> erTag,
> I would also take the approach of returning a JSON Result via the JSON
> Plugin.  Only the configuration changes for an XML result.
>
> So, my form looks like this:
>
> 
> 
>
> So, my struts.xml contains the corresponding action definition with a
> JSON result:
>
> 
>
>
>   list
>
>
>  
>
> And my action method looks like this:
>
> private ACEntry[] list;
>
> public String execute() {
> list = populateList()
> return "success";
>  }
>
> public ACEntry[] getList() {
>return list;
> }
>
> ---
> In summary, the autocompleter does a get to /JSONList.action
> Struts2 executes the execute method of ListAction
> The execute method creates a structure that will populate the
> autocompleter
> The action returns a JSON result type
> The JSON plugin converts the root object (the list property only rather
> than the whole action) to a JSON structure
> The JSON plugin returns the application/json content to the
> autocompleter
>
> I'll leave it to you to determine what the list structure should like
> like.  As it'll probably be re-use I'd create a bean for the purpose.
> Use the FireBug plugin for firefox to inspect the format of the JSON
> result to ensure it matches the format required by the javascript
> library (or even better, write a unit test).
> This will work with any javascript library that accepts JSON - you just
> have to provide an appropriate structure.  It will also work with any
> library that requires an XML response, except you'd use an XML result
> type like I previously described in this thread.
>
> I hope that helps.  Struts2 is really well suited at providing non-html
> responses if you take the time to understand the ResultType
> architecture.
>
> cheers,
>  Jeromy Evans
>
> Dave Newton wrote:
> > --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
> >
> >> Thanks for the comprehensive reply. Looking at the documentation and
> the
> >> example app, I am still not sure how to configure my action/response.
> I
> >> am using tiles 2.
> >>
> >
> > As previously stated if you are writing directly to the response you
> need to
> > return null from the action. I am still not sure why you're using a
> tile
> > definition here.
> >
> >
> >
> >> It seems I need to return my result in JSON format correct? By
> returning
> >> a JSON String from the action, how to I configure my response?
> >>
> >
> > As Jeremy said this is, however, probably a bad idea, considering that
> the
> > same outcome can be achieved in several different ways.
> >
> > Using a JSON result will serialize your action to JSON automagically.
> You'd
> > use a "json" result (via the JSON plugin), not a tile. Or you could
> build the
> > JSON manually and configure a FreeMarker result.
> >
> >
> >> If I use the tiles response type, I get a dojo parsing error because
> the
> >> whole page is returned from the reply.
> >>
> >
> > Sure.
> >
> >
> >> The example in

Re: [OT] Killer Scam

2008-02-04 Thread bhaarat Sharma
I didnt get it. or maybe i deleted it already.

Anyone wana paste what it read?

On 2/4/08, Greg Reddin <[EMAIL PROTECTED]> wrote:
On Feb 4, 2008 4:47 AM, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> > I received an email scam in my apache.org email that is,
> > substantially, the first in this list:
> > http://www.scamorama.com/killer.html
> >
> > Did you receive such a letter?
>
> Yep, I got one. Somebody don\'t like Tiles I guess :-)
>
> Greg
>
> -
> 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: AjaxTag 1.3 support?

2008-02-04 Thread Griffith, Michael *
Jeromy, 

Again, thanks for the reply. I appreciate your help! 

Following your example below, I can see the JSON result in the app
server console when the action called, but I get the following error in
the browser:

FATAL exception raised: TypeError: Value undefined (result of expression
this.data[x][0].toLowerCase) is not object.

What is this telling me?

-- my Struts mapping:



list




-- My Form:
 



-- My Action:
public class QuestionSearchAction extends BaseAction {

/**
 * 
 */
private static final long serialVersionUID =
1127012585409657094L;

Question[] list;
private QuestionService questionService;

public void setQuestionService(QuestionService questionService)
{
this.questionService = questionService;
}

public String execute() {
List all= questionService.getQuestions(); 
list= all.toArray( new Question[all.size()]);
return SUCCESS;
 }

public Question[] getList(){
return list;
}

}


Cheers!
mg

-Original Message-
From: Jeromy Evans [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 02, 2008 6:15 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

I completely agree with Dave so I'll take a different tact. 

Based on this example: 
http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet
erTag, 
I would also take the approach of returning a JSON Result via the JSON 
Plugin.  Only the configuration changes for an XML result.

So, my form looks like this:




So, my struts.xml contains the corresponding action definition with a 
JSON result:


   
   
  list
   
   
 

And my action method looks like this:

private ACEntry[] list;

public String execute() {
list = populateList()
return "success";
 }

public ACEntry[] getList() {
   return list;
}

---
In summary, the autocompleter does a get to /JSONList.action
Struts2 executes the execute method of ListAction
The execute method creates a structure that will populate the
autocompleter
The action returns a JSON result type
The JSON plugin converts the root object (the list property only rather 
than the whole action) to a JSON structure
The JSON plugin returns the application/json content to the
autocompleter

I'll leave it to you to determine what the list structure should like 
like.  As it'll probably be re-use I'd create a bean for the purpose. 
Use the FireBug plugin for firefox to inspect the format of the JSON 
result to ensure it matches the format required by the javascript 
library (or even better, write a unit test).
This will work with any javascript library that accepts JSON - you just 
have to provide an appropriate structure.  It will also work with any 
library that requires an XML response, except you'd use an XML result 
type like I previously described in this thread.

I hope that helps.  Struts2 is really well suited at providing non-html 
responses if you take the time to understand the ResultType
architecture.

cheers,
 Jeromy Evans

Dave Newton wrote:
> --- "Griffith, Michael *" <[EMAIL PROTECTED]> wrote:
>   
>> Thanks for the comprehensive reply. Looking at the documentation and
the
>> example app, I am still not sure how to configure my action/response.
I
>> am using tiles 2.
>> 
>
> As previously stated if you are writing directly to the response you
need to
> return null from the action. I am still not sure why you're using a
tile
> definition here.
>
>
>   
>> It seems I need to return my result in JSON format correct? By
returning
>> a JSON String from the action, how to I configure my response?
>> 
>
> As Jeremy said this is, however, probably a bad idea, considering that
the
> same outcome can be achieved in several different ways.
>
> Using a JSON result will serialize your action to JSON automagically.
You'd
> use a "json" result (via the JSON plugin), not a tile. Or you could
build the
> JSON manually and configure a FreeMarker result.
>
>   
>> If I use the tiles response type, I get a dojo parsing error because
the
>> whole page is returned from the reply. 
>> 
>
> Sure.
>
>   
>> The example in the example app isn't very clear to me, as the action
>> returns a .JS file with the result hard coded, and not using any
>> template like tiles I might add.
>> 
>
> What example are you referring to? 
>
>
http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocomplet
erTag?
>
> When making an Ajax request for a component like 
it's
> unlikely you'd want to return anything other than JSON. (Other
components or
> component libraries may want other formats like XML or whatever.)
Unless your
> tile definition is creating JSON it's not going to work, and it's
unlikely
> that would be the best way to generate th

Re: [OT] Killer Scam

2008-02-04 Thread Greg Reddin
On Feb 4, 2008 4:47 AM, Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> I received an email scam in my apache.org email that is,
> substantially, the first in this list:
> http://www.scamorama.com/killer.html
>
> Did you receive such a letter?

Yep, I got one. Somebody don't like Tiles I guess :-)

Greg

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



Re: question on mapping

2008-02-04 Thread Jeromy Evans
Will CodeBehind give what you need?  I'm not sure with your use of 
wildcards.
It gives "pages with no mapping": a default do-nothing action that 
provides access to s2 tags & resources...but not to a default tile AFAIK


http://struts.apache.org/2.0.11/docs/codebehind-plugin.html

Giovanni Azua wrote:

hi,

Suppose you have a struts.xml mapping that looks like:

class="com.sag.optimizer.ui.web.action.form.Form{1}Action">

  webui.form{1}
  webui.failed
  
In several cases I will probably want to provide a valid non empty 
implementation of a corresponding Form{1}Action.class but in some 
cases I don't want to have to provide any but a default implementation 
e.g. FormGenericAction that just extends ActionSupport. Is there any 
way to do that?


My coverage reports are getting uglier and this is one of the reasons :)

regards,
Giovanni

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



cannot find catalog?

2008-02-04 Thread woods5242-grizz
Hi,
We are using struts2 with the struts 1 plugin. I have been getting this error 
when posting to an action. I really am not sure where to start looking, any 
ideas?


[91000] [/].[action] Servlet.service() for servlet action threw exception
javax.servlet.ServletException: Cannot find catalog 'struts'
at 
org.apache.struts.chain.ComposableRequestProcessor.init(ComposableRequestProcessor.java:161)
at 
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:620)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1910)
at org.openmrm.core.view.web.MrmActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.openmrm.core.view.web.SetCharacterEncodingFilter.doFilter(Unknown 
Source)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:414)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:204)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)



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



Re: [OT] Killer Scam

2008-02-04 Thread Musachy Barroso
oh I was just reading it. Struts 2 team, you are going down! :)

musachy

On Feb 4, 2008 7:06 AM, Dave Newton <[EMAIL PROTECTED]> wrote:
> --- Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> > I received an email scam in my apache.org email that is,
> > substantially, the first in this list:
> > http://www.scamorama.com/killer.html
> >
> > Did you receive such a letter?
>
> I got one this morning.
>
> Of course, I'm a pretty skilled knife- and stick-fighter and have fairly
> current firearm and bodyguard training, so I was more eager than anything
> else :D
>
> If you get any background information on whoever sent it, please send it my
> way; I don't have the time to dig at the moment.
>
> Dave
>
>
>
>
> -
> 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]



question on mapping

2008-02-04 Thread Giovanni Azua

hi,

Suppose you have a struts.xml mapping that looks like:

class="com.sag.optimizer.ui.web.action.form.Form{1}Action">

  webui.form{1}
  webui.failed
   

In several cases I will probably want to provide a valid non empty 
implementation of a corresponding Form{1}Action.class but in some cases 
I don't want to have to provide any but a default implementation e.g. 
FormGenericAction that just extends ActionSupport. Is there any way to 
do that?


My coverage reports are getting uglier and this is one of the reasons :)

regards,
Giovanni

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



tomcat can't see french resource bundle

2008-02-04 Thread wessam

i've a strange problem
my application is done with struts, working local with JDeveloper IDE which
has OC4J embedded server
when i change locale to french local the labels are read correctly

but when i deploy on tomcat labels from resource bundle are read in english
though labels are retrieved from database are read in french normally which
means that local is set to french

any sugesstions please ?
-- 
View this message in context: 
http://www.nabble.com/tomcat-can%27t-see-french-resource-bundle-tp15268739p15268739.html
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: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

2008-02-04 Thread Jeromy Evans

Here is an example where I use it successfully:



but in this specific case defaultAnswerDate, startDate and 
incomingAnswer are all String properties whose values are in RFC3339 
format ("-MM-dd").
This doesn't account for the blank error you're experiencing.  As Dave 
mentioned, the most likely case for that is a property name mismatch.


Serge Bornow wrote:

Hello Jeromy,

I do have :  
Also, i use Netbeans to generate respective get/set method so they are 
JavaBean std compliant.


The issue for me unfortunately is getting the value back , it seems to 
lose it.

:(

Thanks for feedback though.

Serge

Jeromy Evans wrote:

Hi Serge,

You'll find many emails in this forum relating to DatePicker 
problems.  Some of the solutions are here: 
http://cwiki.apache.org/S2WIKI/vault.html


In this case though, is it possible you've forgotten the s:head tag 
at the top of the page?


Serge Bornow wrote:

Hi All,

I:'ve been battling this for many hours.
I hope someone can help.
Using JDK 1.5, Struts 2.0.11


My property:
shoot_date of type Date
has get and set and on execute()
set's the default date to today's date
setShoot_Date(new Date);

on the form:

even without displayformat it doesn't work.

what happens is that i click the submit button that submits an 
action that executes a method that tries to read the shoot_date and 
it's null.


Hence the error in my log:

java.text.ParseException: Unparseable date: ""
   at java.text.DateFormat.parse(DateFormat.java:337)
   at 
org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 




Does anyone have a good working example?

Thank you very much,

Serge


-
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: Datetimepicker simple thing doesn't work java.text.ParseException: Unparseable date: ""

2008-02-04 Thread Serge Bornow

Hello Jeromy,

I do have :  
Also, i use Netbeans to generate respective get/set method so they are 
JavaBean std compliant.


The issue for me unfortunately is getting the value back , it seems to 
lose it.

:(

Thanks for feedback though.

Serge

Jeromy Evans wrote:

Hi Serge,

You'll find many emails in this forum relating to DatePicker 
problems.  Some of the solutions are here: 
http://cwiki.apache.org/S2WIKI/vault.html


In this case though, is it possible you've forgotten the s:head tag at 
the top of the page?


Serge Bornow wrote:

Hi All,

I:'ve been battling this for many hours.
I hope someone can help.
Using JDK 1.5, Struts 2.0.11


My property:
shoot_date of type Date
has get and set and on execute()
set's the default date to today's date
setShoot_Date(new Date);

on the form:

even without displayformat it doesn't work.

what happens is that i click the submit button that submits an action 
that executes a method that tries to read the shoot_date and it's null.


Hence the error in my log:

java.text.ParseException: Unparseable date: ""
   at java.text.DateFormat.parse(DateFormat.java:337)
   at 
org.apache.struts2.components.DateTimePicker.format(DateTimePicker.java:309) 




Does anyone have a good working example?

Thank you very much,

Serge


-
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: [OT] Killer Scam

2008-02-04 Thread Dave Newton
--- Antonio Petrelli <[EMAIL PROTECTED]> wrote:
> I received an email scam in my apache.org email that is,
> substantially, the first in this list:
> http://www.scamorama.com/killer.html
> 
> Did you receive such a letter?

I got one this morning.

Of course, I'm a pretty skilled knife- and stick-fighter and have fairly
current firearm and bodyguard training, so I was more eager than anything
else :D

If you get any background information on whoever sent it, please send it my
way; I don't have the time to dig at the moment.

Dave



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



Re: [OT] Killer Scam

2008-02-04 Thread Don Brown
Aw, I just thought I was special, and was so excited - my first death threat! :)

Don

On Feb 4, 2008 9:54 PM, Jeromy Evans <[EMAIL PROTECTED]> wrote:
> Hi Antonio, I received that spam for the first time today too on my
> address used on this list.  I guess it just went wild.
>
>
> Antonio Petrelli wrote:
> > I received an email scam in my apache.org email that is,
> > substantially, the first in this list:
> > http://www.scamorama.com/killer.html
> >
> > Did you receive such a letter?
> >
> > Antonio
> >
> > -
> > 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: [OT] Killer Scam

2008-02-04 Thread Jeromy Evans
Hi Antonio, I received that spam for the first time today too on my 
address used on this list.  I guess it just went wild.


Antonio Petrelli wrote:

I received an email scam in my apache.org email that is,
substantially, the first in this list:
http://www.scamorama.com/killer.html

Did you receive such a letter?

Antonio

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



extending BasicPreparerFactory

2008-02-04 Thread mteccles

Hi,

I found the DTD for tiles configuration at
http://struts.apache.org/struts-sandbox/tiles/tiles-core/dtddoc/index.html.

What I want to do is extend the BasicPreparerFactory and configure the
struts 2 application to use my class. The application uses the spring plugin
but tiles 2 is sandbox and does not integrate with spring yet. Therefore I
need to manage the instantiation of preparer classes in a custom factory
that behaves like the spring container. 

Somewhere in struts.xml or tiles.xml this can be configured??? 
-- 
View this message in context: 
http://www.nabble.com/extending-BasicPreparerFactory-tp15265714p15265714.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



[OT] Killer Scam

2008-02-04 Thread Antonio Petrelli
I received an email scam in my apache.org email that is,
substantially, the first in this list:
http://www.scamorama.com/killer.html

Did you receive such a letter?

Antonio

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