struts-1

cannot find my bean using the InitialContext.lookup() method

这一生的挚爱 提交于 2019-12-01 11:33:48
问题 I have tried to use struts 1.3 API to make a small application with EJB 3.0. Unfortunatelly i cannot use the @EJB annotation to call my bean object from inside my action class. I have solved this problem using different workarounds ( the first one is to use my global jndi name of my bean and the other is to call another class first and use the @EJB annotation from that class). Still these two workarounds have significant disadvantages. I would like to call my EJB directly from my action class

how to extract decimal number from string using javascript

て烟熏妆下的殇ゞ 提交于 2019-12-01 09:41:52
I want to extract decimal number 265.12 or 0.0 from alphanumeric string (say amount) having value $265.12+ or $265.12- or $0.0+ or $0.0- and use it apply struts logic tag in jsp . Not sure how to extract number maybe with help of javascript . You can use regex like this, Live Demo var amount = "$265.12+"; var doublenumber = Number(amount.replace(/[^0-9\.]+/g,"")); Without error checks, following will do: var string = "$123123.0980soigfusofui" var number = parseFloat(string.match(/[\d\.]+/)) 123123.098 You might be interested in this library for formatting money http://josscrowcroft.github.com

how to extract decimal number from string using javascript

社会主义新天地 提交于 2019-12-01 06:51:48
问题 I want to extract decimal number 265.12 or 0.0 from alphanumeric string (say amount) having value $265.12+ or $265.12- or $0.0+ or $0.0- and use it apply struts logic tag in jsp . Not sure how to extract number maybe with help of javascript . 回答1: You can use regex like this, Live Demo var amount = "$265.12+"; var doublenumber = Number(amount.replace(/[^0-9\.]+/g,"")); 回答2: Without error checks, following will do: var string = "$123123.0980soigfusofui" var number = parseFloat(string.match(/[

Include javascript file from inside WEB-INF [duplicate]

牧云@^-^@ 提交于 2019-11-30 15:51:45
问题 This question already has answers here : Referencing a resource placed in WEB-INF folder in JSP file returns HTTP 404 on resource (3 answers) Closed 3 years ago . I am developing a website in struts. My folder structure is as follows : Now, I have a jsp page register.jsp, in which I want to add jquery.validate.js file. I have followed suggestion from the following link : Can not include javascript file from WEB-INF directory in JSP. My code was as follows : <%@ taglib uri="http://struts

Java getter for non-existent attribute of class

[亡魂溺海] 提交于 2019-11-30 09:07:25
问题 I'm using some functionality in Java that I don't really understand so I want to read up on it so that I can use it more effectively. The problem is that I don't know what it is called so it makes it difficult to get more information on it: I have a class Foo defined like this: private String _name; private Bar _bar; //getters and setters And Bar : private String _code; //getters and setters public String get_isCodeSmith() { boolean rVal = _code.toLowerCase().contains("smith"); return rVal; }

how to use <bean:write > tag in strut 1.2?

℡╲_俬逩灬. 提交于 2019-11-30 03:57:16
问题 How to Use <bean:write> tag in Struts 1.2. In name attribute, what value have to be used? Is bean name your property name? 回答1: Javadoc for <bean:write>: Specifies the attribute name of the bean whose property is accessed to retrieve the value specified by property (if specified). If property is not specified, the value of this bean itself will be rendered. In essence, if you have a JavaBean (with getters and setters), Person person = new Person; request.setAttribute("person", person); by

Function to remove accents in postgreSQL [duplicate]

落爺英雄遲暮 提交于 2019-11-29 21:33:27
Possible Duplicate: Does PostgreSQL support “accent insensitive” collations? I'm trying to remove the accents so when I make a SELECT it ignores them. Example: SELECT * FROM table WHERE table.id ILIKE 'Jose'; It returns: José Jose Jósé Jóse or something like that. I found these functions and they wont work, I'm thinking it may be the fact that I'm using Struts 1.X, please check them out and tell me where I'm wrong or what other function should I use. FIRST FUNCTION CREATE OR REPLACE FUNCTION unaccent_string(text) RETURNS text AS $$ DECLARE input_string text := $1; BEGIN input_string :=

How to emulate nested:root from Struts 1 in Struts 2?

核能气质少年 提交于 2019-11-29 16:36:57
I am working on converting a Struts1 app to Struts2. I have a jsp that has several JSP included. This included JSPs all have the nested:root tag on it. I have found little to nothing on this particular tag except that is similar to html:root , so I've added the include statement in my main JSP and I added the html:form to the sub JSPs but it didn't work. I had initially just added s:form to the sub JSPs and the code in the sub jsp was passed along but none of the tags existing in the sub JSP were processed. All nested tags and all Struts1 tags should be removed/replaced with equivalent Struts2

The problems in error handling using Struts validation framework

怎甘沉沦 提交于 2019-11-29 16:06:45
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"/> <!-- ========================= Validator plugin ================================= --> <plug-in className="org

Function to remove accents in postgreSQL [duplicate]

妖精的绣舞 提交于 2019-11-28 18:58:40
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Does PostgreSQL support “accent insensitive” collations? I'm trying to remove the accents so when I make a SELECT it ignores them. Example: SELECT * FROM table WHERE table.id ILIKE 'Jose'; It returns: José Jose Jósé Jóse or something like that. I found these functions and they wont work, I'm thinking it may be the fact that I'm using Struts 1.X, please check them out and tell me where I'm wrong or what other