struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nani2ratna <>
Subject Struts2 JQuery select box
Date Thu, 04 Mar 2010 12:29:15 GMT


I am trying to use for loading
select box.
I just followed this link

Every thing is executing fine.
But the list not loading properly.
I am new to JSON.

I changed below jsp page which was working fine with normal select box.

my code is 

<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
	  <sj:head jqueryui="true" locale="za" jquerytheme="smoothness"/>
<div class="loginmodules">
<s:form action="updatePMDetails" id="updatePMDetails" namespace="/secure"
theme="simple" cssClass="form1">
	<fieldset class="form1bg">		
 	<legend>Product Master Description Details</legend>
			<dt><s:actionerror cssClass="error"/> </dt>
			<dd><s:fielderror cssClass="error"/> </dd>
	 		<dt><s:label id="label_skuid" key="pminfo.skuid"/></dt>
			<dd><s:textfield title="SKUID tooltip" id="skuid" name="prodmDatPm.skuid"
			<dt><s:label id="label_prodcat" key="pminfo.prodcat"/></dt>
			<dd><s:textfield id="prodcat" name="prodmDatPm.prodcat"
			<dt><s:label id="label_websitecate" key="pminfo.website_category"/></dt>
				<s:url id="remoteurl" action="JsonAction"/> 
				<sj:select href="%{remoteurl}" cssClass="category" list="prodCatList"
listKey="prodcat" listValue="prodcat_desc"

Above jsp got almost 100 fields. I just trancated it.


import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;


@ParentPackage(value = "pm-json")
public class JsonAction extends EcmAction {

	private static final long serialVersionUID = -3858830120549401006L;
	private List<PmProdCat> prodCatList;
	private ProdmDatPmService prodmDatPmService;

	public List<PmProdCat> getProdCatList() {
		return prodCatList;
	public void setProdCatList(List<PmProdCat> prodCatList) {
		this.prodCatList = prodCatList;
	public ProdmDatPmService getProdmDatPmService() {
		return prodmDatPmService;
	public void setProdmDatPmService(ProdmDatPmService prodmDatPmService) {
		this.prodmDatPmService = prodmDatPmService;
	@Actions( {
	    @Action(value = "/JsonAction", results = {
	      @Result(name = "success", type = "json")
	public String execute(){
		System.out.println("This is execute method in json action calss");
		prodCatList = new ArrayList<PmProdCat>();
		prodCatList = prodmDatPmService.getProdCatList();
		return SUCCESS;
	public String getJSON()
		System.out.println("This is getJSon method in json action calss");
	    return execute();


<package name="pm-json" extends="json-default">

When jsp loading, its calling my action class.
Action class calling service class and loading list into prodcatList.
But its not getting into list box.

Can anybody please explain whats the problem is.

Thanks in advance
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