<HTML: checkbox> is used to upload values to the action when you select the drop-down menu. How can this happen? After thinking for a long time, the results are searched on Google; they all say that the encoding method is not converted. At this time, I am very happy. I saved it, so I made up a class. As follows:
Package com. xicai. util;
Import java. Io. unsupportedencodingexception;
Import javax. servlet. http. httpservletrequest;
Import javax. servlet. http. httpservletresponse;
Import org. Apache. Struts. Action. requestprocessor;
Public class myrequestprocessor extends requestprocessor {
Protected Boolean processpreprocess (httpservletrequest request, httpservletresponse response ){
Try {
Request. setcharacterencoding ("gb2312 ");
} Catch (unsupportedencodingexception e ){
// Todo auto-generated Catch Block
E. printstacktrace ();
}
Return super. processpreprocess (request, response );
}
}
Be careful to deploy one side in myeclipse. After opening the URL result, when I select checkbox, the values in the action are still the same, "garbled ". Speechless! No way. You have to check whether there are any tricks on the Internet! Suddenly, I rushed into MM's blog. Hey! She has an article above to introduce strut's principles. After I carefully read her photo, I am still waiting for a long time. So let's look at the article. Hard work! As mentioned above, adding other Java classes requires adding a node to the struts-config.xml. I immediately ran to my project and added a node.
<Controller processorclass = "com. xicai. util. myrequestprocessor"> </controller> I deployed it again with curiosity! OK.