struts-1

Struts 1 - struts-taglib.jar is not being found by my web application

不打扰是莪最后的温柔 提交于 2019-12-23 03:19:12
问题 I am using Struts-1 . I have developed a struts-based web application. I am using struts tags in my JSP pages supplied in struts-taglib.jar by inserting the following lines in the JSP file: <%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %> <%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %> <%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %> Now the application is working fine when I run it on my localsystem but when I deploy it on a

HTML form POST method with querystring in action URL

☆樱花仙子☆ 提交于 2019-12-22 04:47:20
问题 Lets say I have a form with method=POST on my page. Now this form has some basic form elements like textbox, checkbox, etc It has action URL as http://example.com/someAction.do?param=value I do understand that this is actually a contradictory thing to do, but my question is will it work in practice. So my questions are; Since the form method is POST and I have a querystring as well in my URL (?param=value) Will it work correctly? i.e. will I be able to retrieve param=value on my receiving

How can I put a placeholder in a struts textfield tag?

≯℡__Kan透↙ 提交于 2019-12-22 02:54:53
问题 i got error because am using placeholder attribute in struts tags.... <html:text property="name" styleClass="form-control" placeholder="some text"/> how can resolve the problem,pls help me. Thanks in Advance. 回答1: Use jQuery attr like below: <html:text property="name" styleClass="form-control" styleId="abc" /> JavaScript code: $(function() { $("#abc").attr("placeholder", "some text"); }); 回答2: Just replace: <html:text property="name" styleClass="form-control" placeholder="some text" /> With:

How can I put a placeholder in a struts textfield tag?

*爱你&永不变心* 提交于 2019-12-22 02:53:12
问题 i got error because am using placeholder attribute in struts tags.... <html:text property="name" styleClass="form-control" placeholder="some text"/> how can resolve the problem,pls help me. Thanks in Advance. 回答1: Use jQuery attr like below: <html:text property="name" styleClass="form-control" styleId="abc" /> JavaScript code: $(function() { $("#abc").attr("placeholder", "some text"); }); 回答2: Just replace: <html:text property="name" styleClass="form-control" placeholder="some text" /> With:

Use validate method and validation xml together in Struts 1

ぃ、小莉子 提交于 2019-12-21 22:36:16
问题 I am unable to use validations in validate method and validations in validation.xml together , If I comment the validate() method then form validation.xml validation is working, else only the validations done in validate method alone is working! I am pasting the excerpts of code involved below, please do let me know on valuable suggestions: public class DvaUpdateBean extends ValidatorActionForm implements Serializable { //getter setters public ActionErrors validate(ActionMapping mapping,

Iterating over hashmap in JSP in struts application

主宰稳场 提交于 2019-12-21 09:54:22
问题 I have a HashMap object that I am getting on a JSP page. HashMap<Integer,Gift_product> gift_hm = new HashMap<Integer,Gift_product>(); gift_hm.put(17,new Gift_product("doll",67)); Now I need to iterate this and display content on JSP. The Gift_product class contains two fields: name and price . JSP output should be serial no. product name price 17 Doll 67 How can I achieve it? 回答1: Check out the struts <logic:iterate> tag. When iterating over a HashMap, each entry is a java.util.Map.Entry , to

Struts struts-config.xml action-mapping explained

只愿长相守 提交于 2019-12-21 05:06:14
问题 I am a noob to Struts framework. I am trying to understand how action-mapping works exactly. Suppose I have a JavaScript file that sends an AJAX request: $("button").click(function(){ $.ajax({url: "myTestUrl.do", success: function(result){ //do something with result }); }); and my struts-config.xml file looks like this: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts

Jquery Modal Forms with Struts 1.3

女生的网名这么多〃 提交于 2019-12-21 02:36:10
问题 I'm builing a web application using Struts 1.3 for a class project, and I'm having some problems with the AJAX compatibility of Struts 1.x (I hear 2.x is way better with AJAX and jQuery). Thank you for the reply, this is the updated problem: I'm currently using a jquery UI modal form in the same jsp, and want to send the form data to a Struts Action when the user presses "create new venue" using AJAX. How do I go about sending (and retrieving) the data between the form and the Struts action?

Difference between jsp expression tags <% and <%=

扶醉桌前 提交于 2019-12-20 11:07:02
问题 I more or less know the difference between <%! and <%, but I can't seem to find the difference between <%= and <%. I'm trying to avoid a null value error by introducing some logic into my expression that currently uses <%= ... %>. I get an error unless I replace the tags with <%...%>. However after my build I get a jsp error instead of the servlet error. I can't really paste my original code in here but the code inside <%= ... %> essentially retrieves a nested array object (more like array

Parameter “method” not working (Struts 1)

南笙酒味 提交于 2019-12-20 05:23:24
问题 I have the following action declared in my struts.xml: <action path="/updateAccountInfo" type="org.myCompany.UpdateAccountAction" name="myAccountForm" scope="session" validate="true" parameter="method" input="/updateAccountInfo.jsp"> <forward name="success" path="/updateAccountInfo.jsp" /> </action> In my JSP page, I have the following form: <html:form action="/updateAccountInfo.do"> <input type="hidden" name="method" value="sendMessage" /> In my java class, I have the following method: