struts-1 , Table row data submit in struts 1.2

Table row data submit in struts 1.2


Tag: struts-1

I have a table with each rows contain checkbox (Like gmail inbox). I want to select few checkboxes and submit data in one go to action class. Please let me know how can i submit form using checkboxes.


First of all you must ensure that your form bean and your form action class are already working otherwise even if you prepare your jsp file you will not be able to check its correctness (Struts 1.2 drawback)

Here goes your jsp code

<%@ taglib uri="" prefix="html" %>
    <html:form action="/formAction" method="GET">
                <td>Data 1</td>
                    <html:checkbox property="chk" value="value1"></html:checkbox>dln</td>
                <td>Data 2</td>
                    <html:checkbox property="chk" value="value2"></html:checkbox>dln</td>
                <td>Data 3</td>
                    <html:checkbox property="chk" value="value3"></html:checkbox>dln</td>
                <td>Data 4</td>
                    <html:checkbox property="chk" value="value4"></html:checkbox>dln</td>
                    <html:submit value="Register"></html:submit>

Form Bean

public class MyFormBean extends ActionForm {
private String chk;
[...]//other fields
public String getChk() {
    return chk;

public void setChkString chk) {
    this.chk= chk;

[....] // other getters and setters }

Action class's execute method

MyFormBean myForm = (MyFormBean) form;
String chkVal = myForm.getChk();

Form Bean Entry in struts-config.xml

<form-bean name="myBean" type="pkg.MyFormBean"/>

Form Action Entry in struts-config.xml

<action path="/formAction" type="pkg.formAction" name="myBean" scope="request">


Scope attribute migration from Struts1 to Struts2

I am migrating an application from Struts1 to Struts2. I could migrate everything except the scope attribute from the below action tag of the Struts1 configuration file (struts-config.xml). Struts1 configuration: <action path="/DomainAndIPBlocking" type="com.tarangtech.da.struts.action.DomainBlockedListAction" name="DomainBlockForm" scope="session" input="/" validate="false"> <forward name="success" path="/jsp/SystemAdminConsol/DomainBlocking.jsp"/> </action> Migrated Struts2 configuration:...

How to persist form bean object value to retreive it later in Struts 1

Using Struts 1.3 I have a login form with username, password and a drop-down with some values like English,Deutsh and so on. When a form is submitted, the last value need to be persisted from the drop-down. Following the code sample. Form Bean : public class LoginForm extends ActionForm {...

Why do I need to open the before it is taken by the actual program?

I'm learning struts in school. I have a VERY basic hello world but there is one thing I don't seem to get right. I have the strut form, the strut action, the main jsp(working off of the welcomeStruts.jsp), and the struts-config.xml.. which are the four files I'm working with. Form...

Can Struts 2.3 be used with Struts 1.3?

we have 2 applications (Say AppA and AppB) that use Struts 1.3. I want to upgrade AppB to use struts 2.3, however I cannot make changes to AppA so it will have to remain in Struts 1.3. The problem is that AppB has some dependencies on AppA such as extending...

Cann't find ActionError class in Apache Struts 1.3.10

I follow the tutorial in book JakataStruts live (2004). I have code snippet: @Override public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if(firstName == null || firstName.trim().equals("")){ errors.add("firstName", new ActionError("userRegistration.firstName.problem")); } //... return errors; Netbeans IDE notice that: "Cannot find symbol". How to resolve the above...

Variable property name in html:text tag

I'm using struts-1 and want to use a concatinated string as a property name in a html:text tag. The string is composed of a static String and a parameter given from a jsp:include tag. The include part <jsp:include page="test.jsp"> <jsp:param name="language" value="DE" /> </jsp:include> The html:text Param: ${param.language} <html:text property="propertyDE"...

How can I test my Struts 1.2 web application without server?

I have a Struts 1.2 web application. It has service & DAO classes as well. How can I test each and every layer without any Web/Application server. I heard, Spring provides the same facility for Spring MVC application. How I can test my application end to end? Please suggest?

Combobox not show the correct language values in struts1

Im using ExtJS and Struts1 for an application, when user uses this app in english and displays the combobox (inside form), the selection is in another language (spanish) but not in english. After save the form and reload the page this parameter shows in english (but if user displays the...

Table row data submit in struts 1.2

I have a table with each rows contain checkbox (Like gmail inbox). I want to select few checkboxes and submit data in one go to action class. Please let me know how can i submit form using checkboxes.

What will be equivalent Struts2 code for the following select tag code in Struts1

I am new to Struts. I have to migrate code form Struts1 to Struts2 but confused in select tag of Struts2. Please help in writing the equivalent code in Struts2. <nested:select property="pmt_type0" onchange="openTable(this,0)"> <html:option value=""></html:option> <html:optionsCollection name="paymentTypesList" label="paymentTypeDescription" value="paymentTypeCode"/> </nested:select> ...

Struts1 and Tiles: why does this code doesn't go into infinite loop?

1) I'm looking at some code that is perhaps Struts1 and was wondering if someone can explain why I'm not getting an infinite loop, and instead, I'm being forwarded to a jsp page instead: struts-config.xml: <struts-config> <global-forwards> <forward name="a.t" path="/"/> </global-forwards> <action-mappings> <action path="/Search" type="path.SearchAction" scope="request" name="searchForm" validate="true"> <forward name="orders"...

How to send selected value from jsp page to action class?

I have this code in jsp page: <select id="DateReport" style="width: 150px;"> <option value="1"> 1 </option> <option value="2"> 2 </option> <option value="3"> 3 </option> </select> How do I send the selected value to action class in Struts 1.2?...

How to create a new(original) struts path?

I have tried overriding existing StrutsPortletAction before with their existing struts path with success. However, I can't seem to do the same if I were to try creating my own struts action path. <hook> <custom-jsp-dir>/custom_jsps</custom-jsp-dir> <struts-action> <struts-action-path>/portal/set_viewers/</struts-action-path> <struts-action-impl>com.mine.blogs.hook.BlogEntryViewerStrutsPortletAction</struts-action-impl> </struts-action> </hook> The eclispe IDE gives me this error...

What is equivalent Struts 1.3 tags for

I want equivalent Struts 1.3 tag for <s:property value="Content" escapeHtml="false" /> Currently I am trying something like <bean:write name="MyForm" property="Content" filter="false" ></bean:write> I want to hide/remove HTML tags from My Content - I am having data from CKEditor which is combination of HTML tags....