Author Login
Post Reply
user Digest 5 Feb 2008 03:48:41 -0000 Issue 7846
Topics (messages 182219 through 182228):
Re: AjaxTag 1.3 support?
182219 by: Griffith, Michael *
182221 by: Dave Newton
182222 by: Griffith, Michael *
182223 by: Dave Newton
182224 by: Griffith, Michael *
182225 by: Griffith, Michael *
182226 by: Musachy Barroso
Struts 2 Spring sitemesh hangs on tomcat 6 and jboss
182220 by: Emil.I
How to add login field in the image
182227 by: mohammed hussain
182228 by: Wes Wannemacher
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_182219.ezm (zipped)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:musachy@(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);
}
<s:autocompleter ... dataFieldName="questions" ../>
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 *
<Michael.Griffith@(protected):
> Musachy,
>
> I'm still not getting it...
> I am now serializing a list of maps with the entity id and text I
> want...
>
> Map<String,String> m= new HashMap<String,String>();
> 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<Map<String,String>> getNewList(){
> return newList;
> }
>
> But it appears to be ignored.
>
> MG
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@(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 *
> <Michael.Griffith@(protected):
> > 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:musachy@(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 *
> > <Michael.Griffith@(protected):
> > > 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:musachy@(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 *
> > > <Michael.Griffith@(protected):
> > > > Musachy
> > > >
> > > > Here is the autocompleter tag and the JSON returned...
> > > >
> > > > <s:label name="text" value="Search for Question Text:" />
> > > > <s:url id="search" namespace="/search"
> > > > value="/search/searchByText.action"/>
> > > > <s:autocompleter theme="ajax" href="%{search}"
> > > > name="text"
> > > > dataFieldName="text"
> > > > loadOnTextChange="true"
> > > > indicator="indicator"
> > > > dropdownHeight="300"
> > > > cssStyle="width: 200px;"
> > > > searchType="substring"
> > > > autoComplete="false"
> > > > showDownArrow="false"
> > > > loadMinimumCount="3"/>
> > > > <img id="indicator"
> > > > 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:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > 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:GrantHodgins@(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:jeromy.evans@(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:Michael.Griffith@(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 <s:autocompleter> tag?
> > > > > >
> > > > > > mg
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Dave Newton [mailto:newton.dave@(protected)]
> > > > > > Sent: Friday, February 01, 2008 5:42 PM
> > > > > > To: Struts Users Mailing List
> > > > > > Subject: Re: AjaxTag 1.3 support?
> > > > > >
> > > > > > --- "Griffith, Michael *" <Michael.Griffith@(protected)>
> wrote:
> > > > > >
> > > > > >> public class QuestionAction extends BaseAction implements
> > > > > >> ModelDriven<Question>, Preparable, ServletRequestAware,
> > > > > >> ServletResponseAware {
> > > > > >> public String getSearchTerm() throws Exception {
> > > > > >> System.out.println("**** Question Search
Term:"
> +
> > > > qt);
> > > > > >> List<Question> 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:
> > > > > >>
> > > > > >> <package name="question" extends="base-pkg"
> > > > > >> namespace="/question">
> > > > > >> <action name="get-term"
method="getSearchTerm"
> > > > > >> class="...QuestionAction">
> > > > > >> <result name="success"
> > > > > >> type="tiles">question.panel</result>
> > > > > >> </action>
> > > > > >> </package>
> > > > > >>
> > > > > >
> > > > > > 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.
> > > > > >
> > > > > > Dave
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> >
---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > > For additional commands, e-mail: user-help@(protected)
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> >
---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > > For additional commands, e-mail: user-help@(protected)
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > ----Notice Regarding Confidentiality----
> > > > > > This email, including any and all attachments, (this
"Email")
> is
> > > > > intended only for the party to whom it is addressed and may
> > contain
> > > > > information that is confidential or privileged. Sierra
Systems
> > > Group
> > > > > Inc. and its affiliates accept no responsibility for any loss
or
> > > > damage
> > > > > suffered by any person resulting from any unauthorized use of
or
> > > > > reliance upon this Email. If you are not the intended
> recipient,
> > > you
> > > > > are hereby notified that any dissemination, copying or other
use
> > of
> > > > this
> > > > > Email is prohibited. Please notify us of the error in
> > communication
> > > > by
> > > > > return email and destroy all copies of this Email. Thank you.
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
------------------------------------------------------------------------
> > > > > >
> > > > > >
> > > >
> >
---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > > For additional commands, e-mail: user-help@(protected)
> > > > > >
> > > > >
> > > >
> > >
> >
>
------------------------------------------------------------------------
> > > > > >
> > > > > > No virus found in this incoming message.
> > > > > > Checked by AVG Free Edition.
> > > > > > Version: 7.5.516 / Virus Database: 269.19.18/1255 - Release
> > Date:
> > > > > 1/02/2008 9:59 AM
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > For additional commands, e-mail: user-help@(protected)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > ----Notice Regarding Confidentiality----
> > > > > This email, including any and all attachments, (this "Email")
is
> > > > > intended only for the party to whom it is addressed and may
> > contain
> > > > > information that is confidential or privileged. Sierra
Systems
> > > Group
> > > > > Inc. and its affiliates accept no responsibility for any loss
or
> > > > damage
> > > > > suffered by any person resulting from any unauthorized use of
or
> > > > > reliance upon this Email. If you are not the intended
> recipient,
> > > you
> > > > > are hereby notified that any dissemination, copying or other
use
> > of
> > > > this
> > > > > Email is prohibited. Please notify us of the error in
> > communication
> > > > by
> > > > > return email and destroy all copies of this Email. Thank you.
> > > > >
> > > > >
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > > For additional commands, e-mail: user-help@(protected)
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > "Hey you! Would you help me to carry the stone?" Pink Floyd
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > For additional commands, e-mail: user-help@(protected)
> > > >
> > > >
> > > >
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > > For additional commands, e-mail: user-help@(protected)
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > "Hey you! Would you help me to carry the stone?" Pink Floyd
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_182221.ezm (zipped)Is it generating those brackets around your JSON?
Dave
--- "Griffith, Michael *" <Michael.Griffith@(protected):
> 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:musachy@(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);
> }
>
> <s:autocompleter ... dataFieldName="questions" ../>
>
> 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 *
> <Michael.Griffith@(protected):
> > Musachy,
> >
> > I'm still not getting it...
> > I am now serializing a list of maps with the entity id and text I
> > want...
> >
> > Map<String,String> m= new HashMap<String,String>();
> > 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<Map<String,String>> getNewList(){
> > return newList;
> > }
> >
> > But it appears to be ignored.
> >
> > MG
> >
> > -----Original Message-----
> > From: Musachy Barroso [mailto:musachy@(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 *
> > <Michael.Griffith@(protected):
> > > 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:musachy@(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 *
> > > <Michael.Griffith@(protected):
> > > > 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:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > Musachy
> > > > >
> > > > > Here is the autocompleter tag and the JSON returned...
> > > > >
> > > > > <s:label name="text" value="Search for Question Text:" />
> > > > > <s:url id="search" namespace="/search"
> > > > > value="/search/searchByText.action"/>
> > > > > <s:autocompleter theme="ajax" href="%{search}"
> > > > > name="text"
> > > > > dataFieldName="text"
> > > > > loadOnTextChange="true"
> > > > > indicator="indicator"
> > > > > dropdownHeight="300"
> > > > > cssStyle="width: 200px;"
> > > > > searchType="substring"
> > > > > autoComplete="false"
> > > > > showDownArrow="false"
> > > > > loadMinimumCount="3"/>
> > > > > <img id="indicator"
> > > > > 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
>
=== message truncated ===

Attachment:
user_182222.ezm (zipped)Yea, I think so -- I copied and pasted this from the log file/console...
-----Original Message-----
From: Dave Newton [mailto:newton.dave@(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 *" <Michael.Griffith@(protected):
> 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:musachy@(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);
> }
>
> <s:autocompleter ... dataFieldName="questions" ../>
>
> 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 *
> <Michael.Griffith@(protected):
> > Musachy,
> >
> > I'm still not getting it...
> > I am now serializing a list of maps with the entity id and text I
> > want...
> >
> > Map<String,String> m= new HashMap<String,String>();
> > 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<Map<String,String>> getNewList(){
> > return newList;
> > }
> >
> > But it appears to be ignored.
> >
> > MG
> >
> > -----Original Message-----
> > From: Musachy Barroso [mailto:musachy@(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 *
> > <Michael.Griffith@(protected):
> > > 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:musachy@(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 *
> > > <Michael.Griffith@(protected):
> > > > 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:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > Musachy
> > > > >
> > > > > Here is the autocompleter tag and the JSON returned...
> > > > >
> > > > > <s:label name="text" value="Search for Question Text:" />
> > > > > <s:url id="search" namespace="/search"
> > > > > value="/search/searchByText.action"/>
> > > > > <s:autocompleter theme="ajax" href="%{search}"
> > > > > name="text"
> > > > > dataFieldName="text"
> > > > > loadOnTextChange="true"
> > > > > indicator="indicator"
> > > > > dropdownHeight="300"
> > > > > cssStyle="width: 200px;"
> > > > > searchType="substring"
> > > > > autoComplete="false"
> > > > > showDownArrow="false"
> > > > > loadMinimumCount="3"/>
> > > > > <img id="indicator"
> > > > > 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
>
=== message truncated ===
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_182223.ezm (zipped)...
That's probably an issue.
--- "Griffith, Michael *" <Michael.Griffith@(protected):
> Yea, I think so -- I copied and pasted this from the log file/console...
>
> From: Dave Newton [mailto:newton.dave@(protected)]
>
> Is it generating those brackets around your JSON?
>
> --- "Griffith, Michael *" <Michael.Griffith@(protected):
>
> > 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:musachy@(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);
> > }
> >
> > <s:autocompleter ... dataFieldName="questions" ../>
> >
> > 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 *
> > <Michael.Griffith@(protected):
> > > Musachy,
> > >
> > > I'm still not getting it...
> > > I am now serializing a list of maps with the entity id and text I
> > > want...
> > >
> > > Map<String,String> m= new HashMap<String,String>();
> > > 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<Map<String,String>> getNewList(){
> > > return newList;
> > > }
> > >
> > > But it appears to be ignored.
> > >
> > > MG
> > >
> > > -----Original Message-----
> > > From: Musachy Barroso [mailto:musachy@(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 *
> > > <Michael.Griffith@(protected):
> > > > 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:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > 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:musachy@(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 *
> > > > > <Michael.Griffith@(protected):
> > > > > > Musachy
> > > > > >
> > > > > > Here is the autocompleter tag and the JSON returned...
> > > > > >
>
=== message truncated ===

Attachment:
user_182224.ezm (zipped)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:newton.dave@(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 *" <Michael.Griffith@(protected):
> Yea, I think so -- I copied and pasted this from the log
file/console...
>
> From: Dave Newton [mailto:newton.dave@(protected)]
>
> Is it generating those brackets around your JSON?
>
> --- "Griffith, Michael *" <Michael.Griffith@(protected):
>
> > 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:musachy@(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);
> > }
> >
> > <s:autocompleter ... dataFieldName="questions" ../>
> >
> > 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 *
> > <Michael.Griffith@(protected):
> > > Musachy,
> > >
> > > I'm still not getting it...
> > > I am now serializing a list of maps with the entity id and text I
> > > want...
> > >
> > > Map<String,String> m= new HashMap<String,String>();
> > > 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<Map<String,String>> getNewList(){
> > > return newList;
> > > }
> > >
> > > But it appears to be ignored.
> > >
> > > MG
> > >
> > > -----Original Message-----
> > > From: Musachy Barroso [mailto:musachy@(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 *
> > > <Michael.Griffith@(protected):
> > > > 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:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > 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:musachy@(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 *
> > > > > <Michael.Griffith@(protected):
> > > > > > Musachy
> > > > > >
> > > > > > Here is the autocompleter tag and the JSON returned...
> > > > > >
>
=== message truncated ===
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_182225.ezm (zipped)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:newton.dave@(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 *" <Michael.Griffith@(protected):
> Yea, I think so -- I copied and pasted this from the log
file/console...
>
> From: Dave Newton [mailto:newton.dave@(protected)]
>
> Is it generating those brackets around your JSON?
>
> --- "Griffith, Michael *" <Michael.Griffith@(protected):
>
> > 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:musachy@(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);
> > }
> >
> > <s:autocompleter ... dataFieldName="questions" ../>
> >
> > 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 *
> > <Michael.Griffith@(protected):
> > > Musachy,
> > >
> > > I'm still not getting it...
> > > I am now serializing a list of maps with the entity id and text I
> > > want...
> > >
> > > Map<String,String> m= new HashMap<String,String>();
> > > 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<Map<String,String>> getNewList(){
> > > return newList;
> > > }
> > >
> > > But it appears to be ignored.
> > >
> > > MG
> > >
> > > -----Original Message-----
> > > From: Musachy Barroso [mailto:musachy@(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 *
> > > <Michael.Griffith@(protected):
> > > > 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:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > 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:musachy@(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 *
> > > > > <Michael.Griffith@(protected):
> > > > > > Musachy
> > > > > >
> > > > > > Here is the autocompleter tag and the JSON returned...
> > > > > >
>
=== message truncated ===
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment:
user_182226.ezm (zipped)Right on.
On Feb 4, 2008 6:45 PM, Griffith, Michael *
<Michael.Griffith@(protected):
> 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:newton.dave@(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 *" <Michael.Griffith@(protected):
> > Yea, I think so -- I copied and pasted this from the log
> file/console...
> >
> > From: Dave Newton [mailto:newton.dave@(protected)]
> >
> > Is it generating those brackets around your JSON?
> >
> > --- "Griffith, Michael *" <Michael.Griffith@(protected):
> >
> > > 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:musachy@(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);
> > > }
> > >
> > > <s:autocompleter ... dataFieldName="questions" ../>
> > >
> > > 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 *
> > > <Michael.Griffith@(protected):
> > > > Musachy,
> > > >
> > > > I'm still not getting it...
> > > > I am now serializing a list of maps with the entity id and text I
> > > > want...
> > > >
> > > > Map<String,String> m= new HashMap<String,String>();
> > > > 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<Map<String,String>> getNewList(){
> > > > return newList;
> > > > }
> > > >
> > > > But it appears to be ignored.
> > > >
> > > > MG
> > > >
> > > > -----Original Message-----
> > > > From: Musachy Barroso [mailto:musachy@(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 *
> > > > <Michael.Griffith@(protected):
> > > > > 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:musachy@(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 *
> > > > > <Michael.Griffith@(protected):
> > > > > > 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:musachy@(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 *
> > > > > > <Michael.Griffith@(protected):
> > > > > > > Musachy
> > > > > > >
> > > > > > > Here is the autocompleter tag and the JSON returned...
> > > > > > >
> >
> === message truncated ===
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd

Attachment:
user_182220.ezm (zipped)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 Time B Sent B Recv Client VHost Request
S 976784 ms 0 KB 0 KB 127.0.0.1 localhost GET /web-console/ServerInfo.jsp
HTTP/1.1
S 1059384 ms 0 KB 0 KB 127.0.0.1 localhost GET
/JobSearch-1.0/job/home.action HTTP/1.1
S 1115877 ms 0 KB 0 KB 127.0.0.1 localhost GET
/JobSearch-1.0/job/showCustomerRegistration.action HTTP/1.1
S 708182 ms 0 KB 0 KB 127.0.0.1 localhost GET /JobSearch-1.0/job/home.action
HTTP/1.1
S 773187 ms 0 KB 0 KB 127.0.0.1 localhost GET
/JobSearch-1.0/job/search.action HTTP/1.1
S 701843 ms 0 KB 0 KB 127.0.0.1 localhost GET /JobSearch-1.0/job/home.action
HTTP/1.1
S 0 ms 0 KB 0 KB 127.0.0.1 localhost GET
/web-console/status?full=true&jsessionid=69486E0BE0C24698F891065A3DC42CC3
HTTP/1.1
R ? ? ? ? ? ?
R ? ? ? ? ? ?
any suggestions?
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_182227.ezm (zipped)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

Attachment:
user_182228.ezm (zipped)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