struts-1

request.getCharacterEncoding() returns NULL… why?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 13:29:37
问题 A coworker of mine created a basic contact-us type form, which is mangling accented characters (è, é, à, etc). We're using KonaKart a Java e-commerce platform on Struts 1. I've narrowed the issue down to the data coming in through the HttpServletRequest object. Comparing a similar (properly functioning) form, I noticed that on the old form the request object's Character Encoding ( request.getCharacterEncoding() ) is returned as "UTF-8", but on the new form it is coming back as NULL, and the

The problems in error handling using Struts validation framework

空扰寡人 提交于 2019-12-18 09:21:11
问题 I have following defined in struts-config.xml: <struts-config> <form-beans> <form-bean name="LoginForm" type="com.actionform.LoginForm"/> </form-beans> <action-mappings> <!-- action for login --> <action input="/views/login.jsp" name="LoginForm" path="/Login" scope="session" type="com.actions.LoginAction" parameter="method" validate="true"> <forward name="success" path="/views/Frameset.html" /> </action> </action-mappings> <message-resources parameter="/WEB-INF/ApplicationResources"/> <!-- ==

How to use javascript to include struts html tag?

冷暖自知 提交于 2019-12-13 03:04:23
问题 I have a check box and a text box. I have used struts tags and Now i need to validate that if the check box is checked, i should gray out (disable) the text box. If it is unchecked the text box shold take phone numbers. I did lik this, i called a java script on click of check box and did a innerHtml based on wheather checkbox ix checked or not. var status_check=document.getElementById("line1Checked").checked; if(status_check==true){ document.getElementById("line1").readonly="true"; } else{

Struts 1.3 : Difference between name and attribute attributes in action tag within StrutsConfig.xml?

隐身守侯 提交于 2019-12-13 02:34:54
问题 What is the difference between name and attribute attributes in action tag within StrutsConfig.xml ? 回答1: name is the name of the form bean (an ActionForm of some sort). attribute is the name of the form bean in the session or request if it's different than the name. 来源: https://stackoverflow.com/questions/27424449/struts-1-3-difference-between-name-and-attribute-attributes-in-action-tag-with

Is it possible to access say the 3rd element in a collection with Struts?

社会主义新天地 提交于 2019-12-13 00:01:47
问题 Is there a way to do the following thing in Struts / JSP? <html:checkbox property="list.get(0).checked" /> Thank you in advance. 回答1: If you want to access the 3rd element in a list in JSTL, the syntax is just like arrays: <html:checkbox property="list[2].checked" /> Note that if you are new to JSTL/EL you'll have to add the appropriate jar to your classpath and reference the tag library. 来源: https://stackoverflow.com/questions/3062350/is-it-possible-to-access-say-the-3rd-element-in-a

How to configure pom for StrutsTestCase so that web.xml is found?

谁都会走 提交于 2019-12-12 12:30:15
问题 I'm using Maven 2 to build a Java - Sturts 1.2 - Spring 1.2 project. I'm trying to incorporate the StrutsTestCase extension of JUnit to allow testing of action classes. When I try to build, I get the following error: junit.framework.AssertionFailedError: The /WEB-INF/web.xml was not found. at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:344) at servletunit.struts.MockStrutsTestCase.tearDown(MockStrutsTestCase.java:130) In researching this, I've learned the

Handling session time-outs in Datatables (with server-side datasource processing)

∥☆過路亽.° 提交于 2019-12-12 09:52:21
问题 I have a datatables form that's backed by a server-side Ajax data source (which uses a struts action in the backend to process the request, fetch the data and send a JSON response). The server-side operation needs to run in authenticated mode, i.e. there needs to be an active session. What is the best way to handle session timeout errors in Datatables? At present it just shows a JSON formatting error, which is not the best option for the user. I do not want to go and change the datatables

Struts 1.x file upload when file size > 8MB

情到浓时终转凉″ 提交于 2019-12-12 02:36:49
问题 I want to upload a file(zipped excel) in my application. The file size is almost 8MB. So it gives size error. I have tried to upload a small file, it works fine. But for size> 1 MB, it does not work. Is there any work around for uploading big (zipped) files??? I am using Struts 1.x framework. Thanks in advance! 回答1: From http://tomcat.apache.org/tomcat-5.5-doc/config/http.html maxPostSize The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing.

HDIV - Multipart not configured - Struts 1.3

為{幸葍}努か 提交于 2019-12-12 01:53:19
问题 I am using HDIV to protect my web application from the csrf attacks. My application was long developed in Struts-1.3.10. The hyper links and normal pages works well, but except the multipart file upload pages. I get multipartconfig not present exception when I submit a page having the multipart file upload. I tried many way to configure it but nothing worked. There seems to be no good documents in their website. Their example too is full of bugs and their multipart example throws the same

Pass a bean like a property of another bean (struts 1.x)

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:33:23
问题 I have two forms (and the corresponding form beans), one on page1.jsp and another on page2.jsp (this second form is dinamically created via json). The form1 is of mypackage.MyActionForm1 type, while the form2 is of mypackage.MyActionForm2 type. In the Action executed when the first form is submitted, I create a MyActionForm2 and set the MyActionForm1 form as its property: MyActionForm2 secondBean = new MyActionForm2(); secondBean.setBeanProp(form1); request.setAttribute("secondbean",