Struts 1.x: How to output HTML string from an ActionForm paramete

We have the following ActionForm

public class DocListForm extends ActionForm {
private String multiPagesHtml = "your HTML string .....";
}

Then, in the jsp file we can use the following:
<bean:write name="docListForm" property="multiPagesHtml" filter="false"/>

with FILTER = FALSE

in order to display the HTML output of the multiPagesHTML

mySQL: UPSERT (INSERT OR UPDATE) between 2 tables

In order to INSERT new rows or UPDATE if the rows exist you can use the following SQL:

Step 1:
INSERT INTO PRODUCT_T (ID, NAME, DESCR)

SELECT T2.ID, T2.NAME, T2.DESCR FROM
(IMP_PRODUCT_T T2 LEFT OUTER JOIN PRODUCT_T T1 ON T2.ID = T1.ID)
WHERE T1.ID IS NULL;

Step 2:
UPDATE PRODUCT_T T1
INNER JOIN IMP_PRODUCT_T T2 ON T1.ID = T2.ID
SET T1.NAME = T2.NAME, T1.DESCR = T2.DESCR


Note: It has poor efficiency but it is standards compliant!!!

Struts 1.x with multipart form and UTF-8

In order to bypass the problem with UTF-8 character set in a multi-part form,
you have to create a new class ScyllaRequestProcessor that overwrites
the default controller RequestProcessor.

Step 1: Create a new class:

public class ScyllaRequestProcessor extends RequestProcessor {

public void process(HttpServletRequest request, HttpServletResponse
response) throws IOException,
ServletException {
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
super.process(request, response);
}
}

Step 2: Update the processorClass in struts-config.xml
<controller processorClass="tuc.isc.eprot.services.ScyllaRequestProcessor" />

MyEclipse with Tomcat: Bad version number in .class file

The above error occurs when the MyEclipse Compiler uses different version of JRE in relation with the Tomcat JRE version.

Please, for the MyEclipse check:
Windows > Preferences > Java
1. Compiler
2. Installed JREs

For the Apache Tomcat check in MyEclipse Server View:
Apache TOmcat > Configuration > Tomcat > Tomcat 5.x > JDK