Basic idea behind an action class

i got lot of information about classes in mvc archtecture withstruts framework. like mapping with form,for business logic,validation,controller servlet etc.
but i am not able to decide what is the basic role of an action class why it is significant for mvc architecture.
can somebody explain.
vj

Within MVC, Struts in general (and Action classes in particular) are controller classes. The responsibilities of a controller are to respond to user input, invoke model functionality and dispatch the results to an appropriate view (normally JSP). The controller is the 'plumbing' of your application. Action classes are the Struts method for implementing this (along with your struts-config.xml file).
- Saish

Similar Messages

  • Trying to find action class that acts behind the search button in a jsp

    Hi all,
    I am trying to change the Search Functionality of Standard B2B Web Shop. In B2B Web shop , if we click on Products tab on left hand side, we get a search box and if we search for a product, in standard system the search will return duplicates. If a product is assigned to more than one area in the catalog, it will show up on the results of the search more than one time.
    But my requirement is that I have to filter out the duplicates and display the link for the first instance found. For that I figured out the jsp and it is  b2b/organizer-content-product-search1.jsp and now I want to find out which action class it is calling.  Does anyone know which action class is it calling?
    Regards,
    Jessica Sam

    Hi Jessica,
    File b2b/organizer-content-product-search1.jsp call action="<isa:webappsURL name="b2b/nextquicksearch.do" />" you can find which class is calling in config.xml file. Below is the entry from config.xml file.
    <action path="/b2b/nextquicksearch" input="/b2b/organizer-content-product-search1.jsp" type="com.sap.isa.isacore.action.QuickSearchAction" name="quickSearchForm" validate="true">
                   <forward name="success" path="/b2b/organizer-content-product-search1.jsp"/>
                   <forward name="failed" path="/b2b/organizer-content-product-search.jsp"/>
              </action>
    It is calling com.sap.isa.isacore.action.QuickSearchAction Action class.  To get more idea and clear picture about how search is working in ISA please refer [Dev and Ext guide|https://websmp206.sap-ag.de/%7Esapdownload/011000358700000469462006E/SAP_ISA50_DevAndExtGuide.pdf]
    Please Goto Page 101-Generic Search It will give you more detail about how search is working in ISA.
    I hope this inofrmation will help you.
    eCommerce Developer

  • I need some help to develop the action class.

    my total concept is , browse a file and upload then after i want save that file in some folder in my system with same formatte (if u browse a 1.txt file then i want to save that file same c: temp/1.txt same formate )how can i do that? i know i have to develop the code in action class but what kind of code i have to develop.
    i suceed to upload the file but i dont have the idea to save that file in my system. but i dont know how can i save my file in the c:temp folder.?
    please help me.

    The authentication is something you can do with either https (secure the transport) or with WS-Security (Secure the message). You can add that with JDeveloper by using the context menu on a webservice.
    To create a webservice:
    - specify the xsd
    - create the wsdl
    - Generate a Java webservice using JDeveloper
    - implement the class to return the content of the request.
    Regards,
    Lonneke

  • Values from a jsp page are null in Action Class

    hi, i am working on an application...i have a jsp page with several inputs (type=text) and when a submit the form to to my action class all values      received are null.
    Here is a part of code:
    the jsp file: letter.jsp
    <form target="_self" action="/Test/editLetter.do" name="letterTF">
    <table>
    <tbody>
    <tr>
    <th>
    No of objects
    </th>
    <th>
    Weight
    </th>
    <th>
    Description
    </th>
    </tr>
    <tr>
    <td>
    Package
    <input name="package" id="package" type="checkbox">
    </td>
    <td>
    <input name="package_No" type="text" value="<%=currentBean.getPackageNo() %>"> <%-- from session...have to edit some date from a data base--%>
    </td>
    <td>
    <input name="package_weight" type="text" value="<%=currentBean.geWeight()%>">
    </td>
    <td>
    <input name="description" type="text" value="<%=currentBean.Description()%>"
    </td>
    </tr>
    <tr>
    ..................................................... <%-- It's a big form --%>
    </tr>
    <tr>
    <input type="submit" name="send" value="Send">
    </tr>
    </tbody>
    </table>
    </form>
    struts-config.xml:
    <form-bean
              name="letterTF"
              type="Test.LetterForm">
    </form-bean>
    <action path="/editLetter"
                   type="Test.LetterAction"
                   name="scrisoareTF"
                   input="/letter.jsp"
                   scope="request"
                   validate="false">
                   <forward name="success" path="/index_orders.jsp"/>
    </action>
    The ActionForm class:
    public class LetterForm extends ActionForm{
    private String package;
         private String package_No;
         private String package_weight;
         public void setPackage(String package){
    this.package = package
    public String getPackage(){
    return package;
    The action class:
    public class LetterAction extends Action{
    public ActionForward execute(     
                   ActionMapping mapping,
                   ActionForm form,
                   HttpServletRequest request,
                   HttpServletResponse response)
         throws Exception{
    String package;
    String package_No;
    String package_weight;
    LetterForm letterTF = (LetterForm) form;
    package = letterTF.getPackage();
    package_No = letterTF.getPackageNo()
    package_weight = letterTF.getPackageWeight();
    System.out.println("Package: "+package);//it will print Package: null
    System.out.println("Weight: "+weight);//it will print Weight: null
    System.out.println("Description "+description) //it will print Description: null
    As I observed its not making the set methods from LetterForm.java
    I am dealing with this bug for a couple of days an i didn't managed to break it. If anyone has an idea would he be so kind to share it with me.
    Thanks in advanced,
    David

    Basically your form beans are the place holders or containers for your jsp attributes. It has to be mapped in such a way that when the form is submitted the user entered values get populated on to your form bean.
    For Eg:
    JSP
    <html:form action="accountSearchResults.do">
    <html:text property="myName" size="15"/>
    //USE ONLY STRUTS TAGS IN JSP's. U CAN REFER TO
    //http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html
    //THE PROPERTY NAME "myName" SHOULD BE DEFINED IN
    //YOUR FORMBEAN WITH getMyName AND setMyName
    //METHODS DEFINED
    </html:form>
    struts-config.xml
    <form-beans>
         <form-bean name="addEditAccount" type="org.apache.struts.validator.LazyValidatorForm">
              <form-property name="myName" type="java.lang.String">
              </form-property>
         </form-bean>
    </form-beans>
    <action-mappings>
         <action path="/accountSearchResults" type="com.zzz.AccountSearchResultAction" name="addEditAccount" scope="request">
              <forward name="success" path="NextPage.jsp">
              </forward>
         </action>
    </action-mappings>
    Action Class
    Since we have defined the form bean as a lazyvalidator instance you can use:
    PropertyUtils.copyProperties(targetBean, form);to fetch the values entered by the user. Try to use struts tags in your jsp's and map the properties to your form bean variables. Hope that helps.
    SirG

  • Values from a jsp page are null in an Action class

    hi, i am working on an application...i have a jsp page with several inputs (type=text) and when a submit the form to to my action class all values received are null.
    Here is a part of code:
    the jsp file: letter.jsp
    <form target="_self" action="/Test/editLetter.do" name="letterTF">
    <table>
    <tbody>
    <tr>
    <th>
    No of objects
    </th>
    <th>
    Weight
    </th>
    <th>
    Description
    </th>
    </tr>
    <tr>
    <td>
    Package
    <input name="package" id="package" type="checkbox">
    </td>
    <td>
    <input name="package_No" type="text" value="<%=currentBean.getPackageNo() %>"> <%-- from session...have to edit some date from a data base--%>
    </td>
    <td>
    <input name="package_weight" type="text" value="<%=currentBean.geWeight()%>">
    </td>
    <td>
    <input name="description" type="text" value="<%=currentBean.Description()%>"
    </td></tr>
    <tr>
    ..................................................... <%-- It's a big form --%>
    </tr>
    <tr>
    <input type="submit" name="send" value="Send">
    </tr>
    </tbody>
    </table>
    </form>
    struts-config.xml:
    <form-bean
    name="letterTF"
    type="Test.LetterForm">
    </form-bean>
    <action path="/editLetter"
    type="Test.LetterAction"
    name="scrisoareTF"
    input="/letter.jsp"
    scope="request"
    validate="false">
    <forward name="success" path="/index_orders.jsp"/>
    </action>
    The ActionForm class:
    public class LetterForm extends ActionForm{
    private String package;
    private String package_No;
    private String package_weight;
    public void setPackage(String package){
    this.package = package
    public String getPackage(){
    return package;
    The action class:
    public class LetterAction extends Action{
    public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception{
    String package;
    String package_No;
    String package_weight;
    LetterForm letterTF = (LetterForm) form;
    package = letterTF.getPackage();
    package_No = letterTF.getPackageNo()
    package_weight = letterTF.getPackageWeight();
    System.out.println("Package: "+package);//it will print Package: null
    System.out.println("Weight: "+weight);//it will print Weight: null
    System.out.println("Description "+description) //it will print Description: null
    As I observed its not making the set methods from LetterForm.java
    I am dealing with this bug for a couple of days an i didn't managed to break it. If anyone has an idea or a solution would he be so kind to share it with me
    Thanks in advance,
    David

    Basically your form beans are the place holders or containers for your jsp attributes. It has to be mapped in such a way that when the form is submitted the user entered values get populated on to your form bean.
    For Eg:
    JSP
    <html:form action="accountSearchResults.do">
    <html:text property="myName" size="15"/>
    //USE ONLY STRUTS TAGS IN JSP's. U CAN REFER TO
    //http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html
    //THE PROPERTY NAME "myName" SHOULD BE DEFINED IN
    //YOUR FORMBEAN WITH getMyName AND setMyName
    //METHODS DEFINED
    </html:form>
    struts-config.xml
    <form-beans>
         <form-bean name="addEditAccount" type="org.apache.struts.validator.LazyValidatorForm">
              <form-property name="myName" type="java.lang.String">
              </form-property>
         </form-bean>
    </form-beans>
    <action-mappings>
         <action path="/accountSearchResults" type="com.zzz.AccountSearchResultAction" name="addEditAccount" scope="request">
              <forward name="success" path="NextPage.jsp">
              </forward>
         </action>
    </action-mappings>
    Action Class
    Since we have defined the form bean as a lazyvalidator instance you can use:
    PropertyUtils.copyProperties(targetBean, form);to fetch the values entered by the user. Try to use struts tags in your jsp's and map the properties to your form bean variables. Hope that helps.
    SirG

  • No response due to long running Action classes

    Hi,
    I have a small issue in my application.
    Please help providing the solution for the following problematic scenario faced in my application.
    My project is generally a report generation project,
    arch used: our-own architecture(similar to struts)
    Server: deployed in tomcat server..
    On clicking a button from X.jsp, it triggers the action with the request = REQ1
    so in my configuration Xml file it checks for it and executes the corresponding Action classes and it should display the Presentation(Jsp)
    What happens is , the action class execution is taking more than 10 min, becaz of which i am getting blank screen.
    From the action to jsp , it is executing without any error, which i could see in the log files..
    Actions taken:
    improved the performance of the query, but cudnt reduce much time..
    session time is 180min, and connection timeout set to an hr. - No change- It seems this doesnt have to do anything with this.
    my Observance:
    I guess, as per arch, it is executing till jsp, but it seems that HttpRequest is getting timedout becaz of long running actions.
    Please help to find the cause and approach method to resolve this issue.
    Note: no issues to wait till 10min.. but need to get the values (reports) in the screeen..
    Thanks in advance.....

    It sounds like either the server or perhaps a firewall is timing out after 5 minutes or so. If you can examine the log files for each such machine in the network, you might find that one is reporting a timeout. If this is the case, you can change the timeout to something greater than 5 minutes, but this is not advisable. Other applications should rightfully timeout if they 'hang' for more than 5 minutes or so and you don't want to interfere with that. One possible solution is to look up something like 'jsp keepalive' to see how to get the JSP page to periodically send a message to the server to keep the session alive using something like AJAX. I tried this and I couldn't find anything that worked. Another thing you can do is do performance tuning to speed things up, or only fetch a small subset of data for the user at a time by filtering (example: instead of returning the entire telephone book, have the user select A to Z for last name and only return the last name that begins with that letter. Another possibility is to cache the data and read from the cache. Then, periodically, refresh the cache from the database at say, midnight every night. Those are the only ideas I have.

  • Exception not throwing to action class in Unix environment

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

    Thanx for your reply.. I just found a solution and would like to share that with you. There are some default request parameters passed by the portal to the action class. "strutsAction" is one of them. If you print this parameters, you will see that it contains the complete url of your action. Now you can use String manipulation to extract the value of the parameters.
    I know its a crude solution. But it works fine.
    Best regards,
    Omer

  • EJB is not throwing exception to calling Action class in Unix environment

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

  • Concurrent multiple requests hitting action classes

    I have posted this issue in other forums, but i haven't got an answer that makes me satisfied.
    Here is the scenario.
    I have MVC architecture.
    I have several action classes forwarded to one JSP page. Basically, one JSP page is shared by multiple action classes. The model built in the action class is displayed in the JSP page something like request.getAttribute(DATA_MODEL_VAR). "DATA_MODEL_VAR" is just string variable. The JSP page is very simple.
    But I am just curious if there is any synchronization issue for JSP page. The JSP doesn't have isThreadSafe tag. I mean if there is any chance that the model built in A action class can be overriden by the model built in B action class if concurrent multiple requests are made to action class A and B. While I test some load testing, I found data (that doesn't even belong to a particular user) in JSP. That's why it makes me curious.
    It would be great if someone can give me some info or resources.
    Thank you.

    I have posted this issue in other forums, but i haven't got an answer that makes me satisfied.
    Here is the scenario.
    I have MVC architecture.
    I have several action classes forwarded to one JSP page. Basically, one JSP page is shared by multiple action classes. The model built in the action class is displayed in the JSP page something like request.getAttribute(DATA_MODEL_VAR). "DATA_MODEL_VAR" is just string variable. The JSP page is very simple.
    But I am just curious if there is any synchronization issue for JSP page. The JSP doesn't have isThreadSafe tag. I mean if there is any chance that the model built in A action class can be overriden by the model built in B action class if concurrent multiple requests are made to action class A and B. While I test some load testing, I found data (that doesn't even belong to a particular user) in JSP. That's why it makes me curious.
    It would be great if someone can give me some info or resources.
    Thank you.

  • What is the idea behind specifying the voice VLAN under the interface

    Hi,
    What is the idea behind specifying the voice VLAN under the interface? (Is it needed for both 802.1P and 802.1Q?)
    Regards
    M

    The voice vlan command is what tells the IP phone what VLAN it should use...
    The idea is that setting the native vlan on the port controls what VLAN the attached PC goes into, and the voice vlan tells the phone which VLAN it should go into.
    It doesn't have any direct relation to QoS, as the port could be configured to ignore or take action on QoS markings with or without the voice vlan command.
    Aaron

  • Please help..How to get the values from a for loop in  Action  class

    I have alist of students say A(name, class, subjects, teacher).
    I need to display all the items in the list A into JSP,
    and then also the details of (name, class, subjects, teacher).
    in the action class,
    After getting the list of students from the database with ORM Layer(Toplink),
    I set request.setAttribute("students",listOfStudents).
    And then Iterate over the list and pass the parameter as student ID to the functions
    getClass(), getSubject(), getTeacher().
    Collection listOfStudents=getStudents();
         request.setAttribute("students",listOfStudent);
    for (Iterator itr = lisOfStudents.iterator(); itr.hasNext();)
         Collection classOfStudent=getClass(studentID);
         request.setAttribute("class",classOfStudent);
         Collection subjectOfStudent=getSubject(studentID);
         request.setAttribute("subject",subjectOfStudent);
         Collection teacherOfStudent=getTeacher(studentID);
         request.setAttribute("teacher",teacherOfStudent);
    mapping.findForward("listOfStudentDetails);
    In JSP
    <c:forEach var="stud" items="${students}">
    //display name in Name Column
    //one student may have more than one subject
         <c:forEach var="sub" items="${subject}">
         .......//display the subjects of the student
    //and repeat the same for the other details
    </c:forEach>
    The problem I am facing is
    If the last student has no subjects, no teachers
    It is displaying null for all the other students.
    I am understanding that the values are getting overwitten in the loop and the is frwede to JSP with the recentmost values for the attributes.
    What could be a possible solution so that I retrieve the values for individual students and will be able to display on JSP?
    ((Please ignore any syntax in theabove example it is just a mock up created from the real problem)

    The issue here is while you are retrieving all the details, you are consistently overwriting them in the request.setAttribute() call before you get to the JSP to display them.
    Do you actually have a class/object called Student?
    That object should have attributes for classes, subjects, teachers (all of which are lists apparently)
    public class Student{
      String name;
      List classes;
      List subjects;
      List teachers;
      // appropriate getter/setter methods
    }Then you load each student, and populate its individual lists.
    That lets you pass the list of students, each student having its own lists for display.
    Hope this helps,
    evnafets

  • Passing values from a JSP to Action class

    Hi,
    I have one JSP in this I have two select boxes.
    The first select box is populated with default values.
    From the first select box I am selecting the value and moving to the other select box using java script.
    Now the value in the second select box has to be submitted alongwith some other values which I am getting.
    These values are to be submitted to a Action class and further to the form bean using struts.
    In the form tag in JSP I am calling the struts action class.
    The issue here is,I am able to get other values except the values in the second select box.
    I am using simple JSP page to get form values and submitting.
    I am not using struts tlds because of project constraints.
    Please advise on how to pass these values.
    Regards,
    Ram

    If the value from the select box isn't submitted, then it's not inside the form. Check the HTML output of your JSP to debug this problem.

  • Action Class

    My doubt is regarding the Action Class, now sun realesed the JSF1.0, and still do we have to return the Action class with the invoke() method (as in your example) from the action class?? or can we write a simple method in the bean class as follows
    public String changePassword(){
    System.out.println ("Change Password Button clicked Hi Hi");
    return "changepass";
    and based on the return string we can handle the navigation right??
    Another thing, If I am create a seperate class other than the bean class to handle the Actions, how can I get the values of the bean class from my Action class?

    >
    Another thing, If I am create a seperate class other
    than the bean class to handle the Actions, how can I
    get the values of the bean class from my Action class?I'm not sure whether i understood your question rightly.
    do you mean :
    JSF code like below
    <h:inputText value="#{bean1.name}"/>
    <h:commandButton value="update" action="#{bean2.update}"/>
    in above conditions, write managed bean like below:
    bean2.java
    public String update(){
            FacesContext context = FacesContext.getCurrentInstance();
            ApplicationFactory factory = (ApplicationFactory) FactoryFinder.
                               getFactory(FactoryFinder.APPLICATION_FACTORY);
            Application application = factory.getApplication();
            ValueBinding vb = application.createValueBinding("#{bean1}");
            Bean1 b1 =  (Bean1) vb.getValue(context);
            String name = b1.getName();
            return "success";
    }but i thought this is a strange request.

  • Values from JSP to Struts Action Class

    Dear All,
    Am working on a small struts project, i want to get values from JSP in the Action class, i tried with sending variables using request through URL, it works fine, any other way is there to send the values from JSP to action class. Am not having any input fields in the JSP.I have links.
    Thanks,
    vyrav.

    I have a dispatch action for that am calling the action like this viewfiles.do?parameter=edit, and i have to send a variable ID from the same page, so am doing like this through java script, viewfiles.do?parameter=edit&id=10. Am able to get the id in the dispatch action edit, but when i start tomcat with security manager its not calling the action itself and its giving accesscontrol exception, but when i directly type viewfiles.do in URL its calling the action.
    I dont know wats the problem, tomcat security manager not allowing this. Please help me.
    Thanks,
    vyrav.

  • How to send List from jsp to action class

    hi,
    i m fetching list from database and showing to jsp as follows:
    user can update that list i need to collect that updated list in next action class but i m not able to do that. can anybody suggest me any solution the code i m using is as follows:
    <html:form action="/myUpdate">
    <table>
    <tr>
         <td>
              <label><input type="text" property="name" name="name" value=""/></label>
         </td>
    </tr>
    <logic:iterate id="address" name="info" property="addressList" indexId="rowindex">
         <tr>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].houseno" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].roadname" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].city" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].state" />
         </td>
         <td>
         <input type="text" value="" name="address[<bean:write name="rowindex"/>].country" />
         </td>
         </tr>
         </logic:iterate>
    <tr>
         <html:submit/>
    </tr>
    </table>
    </html:form>
    here in privious action i m settting bean object in session with name 'info'. it is fetching data and disply it correctly but when i m trying to get this updated data in myUpdate action i m not getting list element.

    --------------- MyBean.java----------------------
    package form;
    import java.util.Iterator;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.log4j.Logger;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    * @author Sushant.Raut
    public class MyBean extends ActionForm {
         Logger log = Logger.getLogger(this.getClass());
         /* (non-Javadoc)
          * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
         @Override
         public void reset(ActionMapping mapping, HttpServletRequest request) {
              // TODO Auto-generated method stub
              super.reset(mapping, request);
              this.name = "";
         public String toString()
              System.out.println("name : " + this.name );
              for(Iterator<Address> iterator = addressList.iterator(); iterator.hasNext();)
                   Address address = (Address)iterator.next();
                   System.out.println("city : " + address.getCity());
              return null;
         private static final long serialVersionUID = 1L;
         private String name;
         private List<Address> addressList;
          * @return the names
         public MyBean()
              log.info("Bean Construtor is called.");
              System.out.println("MyBean:::::constructor is called.");
         public String getName() {
              log.info("Bean getName() is called");
              return name;
          * @param names the names to set
         public void setName(String name) {
              this.name = name;
              log.info("Bean setName() is called");
          * @return the address
         public List<Address> getAddressList() {
              log.info("Bean getAddressList() is called");
              return addressList;
          * @param address the address to set
         public void setAddressList(List<Address> address) {
              log.info("Bean setAddressList() is called");
              this.addressList = address;
         public Address getAddress(int index)
              log.info("Bean getAddress(int index) is called");
              while(index >= addressList.size())
                   addressList.add(new Address());
              return this.addressList.get(index);
         public void setAddress(int index, Address address)
              log.info("Bean setAddress(int index, Address address)) is called");
              this.addressList.add(index, address);
    }------------- Address.java------------
    package form;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionMapping;
    * @author Sushant.Raut
    public class Address {
         private String houseno;
         private String roadname;
         private String city;
         private String state;
         private String country;
         public Address(){}
          * @return the houseno
         public String getHouseno() {
              return houseno;
          * @param houseno the houseno to set
         public void setHouseno(String houseno) {
              this.houseno = houseno;
          * @return the roadname
         public String getRoadname() {
              return roadname;
          * @param roadname the roadname to set
         public void setRoadname(String roadname) {
              this.roadname = roadname;
          * @return the city
         public String getCity() {
              return city;
          * @param city the city to set
         public void setCity(String city) {
              this.city = city;
          * @return the state
         public String getState() {
              return state;
          * @param state the state to set
         public void setState(String state) {
              this.state = state;
          * @return the country
         public String getCountry() {
              return country;
          * @param country the country to set
         public void setCountry(String country) {
              this.country = country;
         public void reset(ActionMapping mapping, HttpServletRequest request)
              this.city = "";
              this.country = "";
              this.houseno = "";
              this.roadname = "";
              this.state = "";
    }------ MyAction.java------
    package action;
    import java.util.ArrayList;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.log4j.Logger;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import form.Address;
    import form.MyBean;
    * @author Sushant.Raut
    public class MyAction extends Action {
         Logger log = Logger.getLogger(this.getClass());
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)throws Exception{
              MyBean myBean = new MyBean();
              log.info("Bean is Initialised.");
              String name = "sushant";
              Address address = new Address();
              address.setCity("city1");
              address.setCountry("India");
              address.setHouseno("1111");
              address.setRoadname("xyz Road");
              address.setState("MH");
              Address address1 = new Address();
              address1.setCity("Hyderabad");
              address1.setCountry("India");
              address1.setHouseno("2222");
              address1.setRoadname("ABC Road");
              address1.setState("AP");
              List<Address> addressSet = new ArrayList<Address>();
              addressSet.add(address);
              addressSet.add(address1);
              myBean.setName(name);
              myBean.setAddressList(addressSet);
              request.getSession().setAttribute("info", myBean);
              log.info("Bean is bound to session.");
              System.out.println("MyBean object is bound to session.");
              System.out.println(myBean);
              return mapping.findForward("success");
    }-------- show.jsp-----------
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
         <html:form action="/myUpdate">
              <table>
                   <tr>
                        <td>
                             <label><html:text property="name" name="info"/></label>
                        </td>
                   </tr>
                   <logic:iterate id="address" name="info" property="addressList" indexId="rowindex">
                        <tr>
                             <td>
                                  <html:text property="houseno" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="roadname" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="city" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="state" name="address" indexed="true"/>
                             </td>
                             <td>
                                  <html:text property="country" name="address" indexed="true"/>
                             </td>
                        </tr>
                   </logic:iterate>
                   <tr>
                        <html:submit title="Submit"/>
                   </tr>
              </table>
         </html:form>
    </body>
    </html>

Maybe you are looking for