Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:02:27+00:00 2026-06-13T21:02:27+00:00

i am unable to populate my Struts2 select drop down in my jsp page.

  • 0

i am unable to populate my Struts2 select drop down in my jsp page.
Note: My jsp page loads through json response.
I have a select box inside a form. But i don’t t know how to populate it when my jsp page loads.

And in the same page i have a select dropdown in my Struts2 jquery grid,which i am able to populage but i don’t know how to populate a drop down for my form which are out side of the grid.

Please help me regarding this issue.

my jsp page

       <s:url id="selecturl" action="selectaction"/>  


   <s:url id="bookediturl" action="bookeditt"/>
   <s:url  id="bookremoteurl" action="booksetups"/>      
        <sjg:grid
        id="bookgrid"
        formIds="form2"
        reloadTopics="reloadMyGrid"
        caption="List of Cover Details"
        dataType="json"
        href="%{bookremoteurl}"
        pager="true"
        gridModel="gridModel"
        rowList="50,100,5000"
        rowNum="20"
        filter="true"
        filterOptions="{stringResult :false,searchOnEnter : false,enableClear : true,gridModel : true}"   
        rownumbers="true"
        editurl="%{bookediturl}"
        navigator="true" 
        editinline="true" 
        navigatorSearch="false"
        autowidth="false"   
        width= "1550" 
        viewrecords="true"  
        navigatorRefresh="true"
        navigatorDelete="true">


             <sjg:gridColumn name="id" index="locationId" title="ID" formatter="integer" sortable="false" key="true" 
                       search="false"  editable="true"  hidden="true"   /> 
              <sjg:gridColumn name="authLastname" index="authLastname" title="AuthorLastname" sortable="true" search="true" editrules="{required: true}"
                        editable="true" edittype="text" />  

        <sjg:gridColumn name="subjectId" title="Subject Name" editable="true" sortable="false" align="center" search="false" searchtype="select" 
        searchoptions="{dataUrl:'%{selecturl}'}"  edittype="select"     editoptions="{dataUrl:'%{selecturl}'}"  />   
        </sjg:grid>

<div id="myDivBox" style="display:none; width :300px;position: relative;top: -30px;left: 299px;button:0px;">
    <s:form action="searchkeywordss" id="form2"  theme="simple" cssClass="yform">
             <sj:textfield  placeholder="Enter keyword to search" cssClass="txtbox" size="42" maxLength="255" name="keywordsearch"/> 
             <sj:select    href="%{selecturl}"   name="countryselect" list="%{lstsub}"  listKey="id" listValue="subjectName"  theme="jquery" cssStyle="margin-top:4px;"/>
             <sj:a button="true" id="btnid"  cssStyle="position: relative;top: 0px;left: 09px;" onClickTopics="reloadMyGrid">Find</sj:a> 
      </s:form> 
</div> 

struts.xml

 <action name="booksetups" class="v.esoft.actions.bookdetails.BookdetailsAction" >
      <result name="success" type="json"/>
      <result name="login" type="redirect"> /index.jsp </result>
 </action>   
     <action name="selectaction" class="v.esoft.actions.bookdetails.SelectAction">
     <result name="success">/select.jsp</result>
 </action>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:02:29+00:00Added an answer on June 13, 2026 at 9:02 pm

    You should only use the sj:select like below

    <sj:select    href="%{selecturl}"   name="countryselect" list="subjectList"  listKey="id" listValue="subjectName"  theme="jquery" cssStyle="margin-top:4px;"/>
    

    where selecturl returns a json response, subjectList is name of list in the json reponse which contains the options

    Your selectaction should have a json response, but what you have now is an action returning a jsp so it would not work. If you cannot change it, you should create another action which returns json.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a asp list box in the aspx page.Through the external java script
I have 3 drop-down boxes, which work great. I'm able to choose the values
i have the below code which i'm unable to populate the total field in
My code is simply intending to populate two drop down lists with the names
I am trying to populate a drop-down list via PHP embedded in HTML. Here
I have set input type to be numberdecimal but also want to populate the
I have a listbox that I am trying to populate with the result of
Using jquery 1.7.1, I'm using json to populate the dropdown. The code works just
I have searched but been unable to find anything that does what I need.
I have a form which can populate from 1-100 elements based on a user's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.