struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xianwinwin <>
Subject RE: struts2 and JSON integration problem (plugin)
Date Tue, 17 Jun 2008 18:22:21 GMT

you are right (I guess I was trying to be succinct), here's the deal, I wish to use JSON, for this, I downloaded the JAR
(jsonplugin-0.30) and had a reference to it (on my eclipse)

So, this is the previous code I was using that worked well:

    <package name="json-support" namespace="/" extends="struts-default">			
  		<default-interceptor-ref name="completeStack" />
		<action name="testComplete"
			<result type="json"/>


<%@ include file="/pages/layouts/taglibs.jsp" %>
<s:head theme="ajax" />

<s:form action="groupManagement_prepareCreate" cssStyle="font-size :	8pt;
font-family: verdana" method="post"  validate="true">
	<s:url id="json" value="/" />
	<s:autocompleter  href="%{json}" loadOnTextChange="true" 
loadMinimumCount="1"   showDownArrow="true" name="userKeys" theme="ajax"
	<s:submit action="groupManagement_Create"  label="insert" />

package com.struts.groups;


public class TestCompletionAction extends BaseSupport
	private String userKeys;
	public String execute()
		System.out.println("activated TestCompletionAction (exec) method");
		System.out.println("====>"+ userKeys);
		return SUCCESS;

	public String getUserKeys()
		return userKeys;

	public void setUserKeys(String userKeys)
		this.userKeys = userKeys;

when the user clicked something in the autocompleter - it invokes the method
above (so far so good)

Later, I realized that if I wish to populate a list, I need to use JSON
notation. the file, read some docs and I realized that the XML
file should do: extends="json-default"

but when I changed this line (from struts-default) nothing happens when I
type something in the autocompleter.

Thanks for any pointers.

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message