Variable substitution at resource property file

2013-12-27 Thread Albert Kao
I like to do variable substitution at the resource property file. I had tried this: Resource property file: common.name=What is the name? page.name.01=${common.name} Jsp file: bean:message key=page.name.01 / The browser displayed the desired message properly. i.e. What is the name? is displayed

variable substitution in html:textarea

2014-10-30 Thread Albert Kao
How to do variable substitution in html:textarea? e.g. Java code package util; public interface Literals {    public static final String LAST_NAME = lastName;} my.jsp %@ page import=util.Literals % html:textarea rows=20 cols=100 property=buffer value='%=Literals.LAST_NAME %'/html:textarea I

replace Java scriptlets in JSP page

2014-12-29 Thread Albert Kao
The following Java scriptlet code in a Struts jsp is working fine.  However, is it possible to change the jsp code so as to remove all the Java scriptlet codes? The .jsp code is like this:%   HttpSession httpSession = request.getSession(true);   MyClient myClient =

Re: replace Java scriptlets in JSP page

2014-12-30 Thread Albert Kao
--- http://in.linkedin.com/pub/sreekanth-s-nair/b/946/5a0/ https://github.com/sreekanthsnair  sreekanthsn...@hotmail.co.uk sreekanths...@gmail.com --- On Tue, Dec 30, 2014 at 4:47 AM, Albert Kao albertk...@yahoo.ca wrote

org.apache.jasper.JasperException struts-examples-master crud

2017-10-13 Thread albert kao
I downloaded struts-examples-master.zip from https://github.com/apache/struts-examples. Unzip it and run mvn. # mvn -version Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-03T15:39:06-04:00) Maven home: /home/alkao/maven/apache-maven-3.5.0 Java version: 1.8.0_144, vendor:

Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-08-26 Thread albert kao
I downloaded struts-examples-master.zip from https://github.com/apache/struts-examples. Unzip it and run mvn. # mvn -version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00) Maven home: /home/alkao/maven/apache-maven-3.3.9 Java version: 1.8.0_131, vendor:

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-04 Thread albert kao
like to see from where your tomcat load MethodUtils class! > > > On 9/2/2017 7:06 PM, albert kao wrote: > > My hello-world.war has the commons lang3 3.6: > > hello-world/WEB-INF/lib > > hello-world/WEB-INF/lib/commons-fileupload-1.3.3.jar > > hello-world/WEB-INF/lib

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-02 Thread albert kao
in your tomcat lib? Please check both. > > albert kao <albertk...@gmail.com> نوشت: > > >I downloaded struts-examples-master.zip from > >https://github.com/apache/struts-examples. > >Unzip it and run mvn. > > > ># mvn -version > >Apache Maven 3.3.9 (b

Re: Clicking helloworld link got java.lang.NoSuchMethodError: org.apache.commons.lang3.reflect.MethodUtils.getAnnotation

2017-09-05 Thread albert kao
HOME/Struts2/struts- > 2.5.12/lib:$CATALINA_HOME/lib:. > > If you would like to solve it like above, I think you may try below > instead ($CLASSPATH at end): > > export > CLASSPATH=$JAVA_HOME/lib:$HOME/Struts2/struts-2.5.12/ > lib:$CATALINA_HOME/lib:.:$CLASSPATH > > On

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

2017-11-13 Thread albert kao
As per your suggestion, changing struts2 version to 2.1.8 fix the problem. Thanks! On Sun, Nov 12, 2017 at 12:29 PM, Yasser Zamani <yasser.zam...@live.com> wrote: > > > On 11/12/2017 2:28 AM, albert kao wrote: > > java.lang.NullPointerException > > com.opensymph

NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

2017-11-11 Thread albert kao
I downloaded the source code of the book "Apache Struts 2 Web Application Development" by Dave Newton from the https://www.packtpub.com/books/content/support. Chapter 2 had compile error with Apache Maven 3.5.0. $ mvn -version Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;

Re: NullPointerException - com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209) of "Apache Struts 2 Web Application Development" book

2017-11-12 Thread albert kao
struts2 version: 2.1.6 On Sat, Nov 11, 2017 at 9:47 PM, Dave Newton <davelnew...@gmail.com> wrote: > What version of Struts 2 are you attempting to use? > > On Sat, Nov 11, 2017 at 5:58 PM albert kao <albertk...@gmail.com> wrote: > > > I downloaded the source cod

scopedModelDriven and ScopedModelDrivenInterceptor

2017-11-05 Thread albert kao
I am a Struts2 beginner. I saw the scopedModelDriven and ScopedModelDrivenInterceptor mentioned in chapter 14 "Migration from Struts Classic" in the "Struts 2 in Action" book by "Donald Brown, ...". The Struts2 documentation said: "public interface ScopedModelDriven extends ModelDriven

Error on line 25, column 9 in template/simple/radiomap.ftl

2017-11-06 Thread albert kao
My program below caused FreeMarker template error . Please help. Thanks. Java: import java.util.ArrayList; import java.util.List; tcma import com.mkyong.common.model.Language; import com.opensymphony.xwork2.ActionSupport; public class RadioButtonAction extends ActionSupport{ private List

Re: Error on line 25, column 9 in template/simple/radiomap.ftl

2017-11-08 Thread albert kao
Your suggestion is good! My problem is solved. However, the same error occurred when my jsp page is changed to the following. Please help. Thanks. On Mon, Nov 6, 2017 at 9:04 AM, Yasser Zamani wrote: > > > On 11/6/2017 4:37 PM, Yasser Zamani wrote: > > then define

When should SessionMap be used instead of Map?

2017-12-07 Thread albert kao
I am looking for an example that SessionMap should be used instead of Map. In the Struts 2 Getting Started HTTP Session tutorial ( https://struts.apache.org/getting-started/http-session.html), HelloWorldAction.java used private Map userSession; I used SessionMap to replace Map.

Re: Recent examples

2017-12-25 Thread albert kao
5 AM, Lukasz Lenart <lukaszlen...@apache.org> wrote: > 2017-12-21 14:02 GMT+01:00 albert kao <albertk...@gmail.com>: > > I had gone through the struts examples at > > https://github.com/apache/struts-examples, which are very good. > > Are there any recent (within this

run the class ComponentTagExampleTest

2018-01-05 Thread albert kao
I downloaded a zip file of Showcase App from https://github.com/apache/struts. Then I unzipped it and run mvn. I saw the class ComponentTagExampleTest. How to run it?

Recent examples

2017-12-21 Thread albert kao
I had gone through the struts examples at https://github.com/apache/struts-examples, which are very good. Are there any recent (within this year if possible), more complex examples or project good for learning (using best practices)? I googled but some are old and some are not that good for

Extra row appear in my jsp page after the Submit button is pressed

2018-03-11 Thread albert kao
I am debugging my test program. When my test page http://localhost:8080/Struts2Example/updatePerson appeared in the browser, it displayed A B C in its own textfield and a Submit button, which is expected. However, after I edited the textfields and pressed the Submit button. The following appeared

Re: Extra row appear in my jsp page after the Submit button is pressed

2018-03-12 Thread albert kao
Problem is fixed. Thanks! On Mon, Mar 12, 2018 at 1:36 AM, Yasser Zamani <yasserzam...@apache.org> wrote: > > > On 3/12/2018 6:03 AM, albert kao wrote: > >> name="persons[%{#stat.count}].name"/> > > I guess using #stat.index (instead

Triple select tag

2018-04-14 Thread albert kao
I am looking for a triple select tag component which is similar to the s:doubleselect tag ( https://struts.apache.org/tag-developers/doubleselect-tag.html). It renders three HTML select elements with the third one changing displayed values depending on selected entry of second one, and the second

Re: Triple select tag

2018-04-14 Thread albert kao
could possibly hook JS function to doubleOnSelect of first > component to highlight 3rd > but > would you have an example of 3 tag-components wired together? > > > Martin > > __ > > > > __

Jsp fields are null at startup

2018-03-02 Thread albert kao
My jsp fields username and password are null at startup (jsp page is loaded). Why? That make the "Invalid Username/Password. Please try again." message appear when the page is loaded. How to fix that? Login.jsp <%@ page contentType="text/html; charset=UTF-8"%> <%@ taglib prefix="s"

Re: A book of Struts

2018-10-25 Thread albert kao
I think two books are in order: First, S2 Basics / introduction : one single app development example. Later, S2 Advanced: advanced topics, deep customization, Internals, Spring integration, Javascript such as JQuery, etc. I suggest - moving Spring integration to the S2 Advanced book. - adding IDE

How to display both selected key and value of s:select

2018-12-22 Thread albert kao
I want to display both selected key and value of s:select. e.g. for the following codes, after I select key="2", value="Canada" and press the submit button. Only the key "Country: 2" is displayed in the registerResult.jsp as desired. How to make the value "Canada" to display also in the browser?

Re: How to display both selected key and value of s:select

2018-12-27 Thread albert kao
) { > foreach (c in countryList) if(c.countryId==selectedCountry) return c; > } > ... > } > > > > Thanks for using Struts. > > Kind Regards. > > >-Original Message- > >From: albert kao > >Sent: Saturday, December 22, 2018 6:39 PM > >To: Strut

How to import Struts Examples into Eclipse IDE inside a single project

2019-02-09 Thread albert kao
How to import Struts Examples into Eclipse IDE inside a single project? I tried this way but multiple projects (action-chaining, annotations, ..., wildcard-regex) appeared in Eclipse Package Explorer. I used "New Java project" to create the struts-examples-master project. I downloaded and

How to use s:iterator s:include s:param

2019-02-16 Thread albert kao
This display properly: I refactor to the following two files, which display nothing. I have other codes in items.jsp which confirms that items.jsp is being used in showitems.jsp. Please help. Thanks. items.jsp: showitems.jsp:

s:property #attr working in header.jsp but not HTTP 404.jsp

2019-11-15 Thread albert kao
This line displays the proper value "> in header.jsp: "> but displays an empty string in http404.jsp ("Page Not Found"): "> Please help. Thanks.

Re: s:property #attr working in header.jsp but not HTTP 404.jsp

2019-11-15 Thread albert kao
How to fix it? I like to use a variable instead of hard coding like this: "> On Fri, Nov 15, 2019 at 8:24 AM Lukasz Lenart wrote: > pt., 15 lis 2019 o 14:13 albert kao napisał(a): > > but displays an empty string > > in http404.jsp ("Page Not Found")

How to pass parameters to s:component inside s:iterator?

2019-10-05 Thread albert kao
How to pass parameters to s:component inside s:iterator? e.g. These simpilied codes pass the parameter "John" to items.jsp. However, the browser displays an empty string. items.jsp: />

How to auto submit a jsp page after loading

2019-10-03 Thread albert kao
How to auto submit a jsp page after loading is done? i.e. after a jsp page is completely loading, it will auto submit - advance to the next page without one of the Submit buttons is pressed or a link is clicked. This is desired for saving time when testing a web application.

How to set up the conditions to test web pages for HTTP status codes 403, 404, 500, 503

2021-06-17 Thread albert kao
I developed a web application with Java (Struts 2) and Web Experience Toolkit (WET - https://github.com/wet-boew/wet-boew), which is running on the WebLogic 12c server. When any one of the HTTP status codes 403, 404, 500, 503 occurs, my web application will display a corresponding web page. e.g.

Re: How to set up the conditions to test web pages for HTTP status codes 403, 404, 500, 503

2021-06-18 Thread albert kao
u, Jun 17, 2021 at 9:08 AM Lukasz Lenart wrote: > czw., 17 cze 2021 o 13:24 albert kao napisał(a): > > > > I developed a web application with Java (Struts 2) and Web Experience > > Toolkit (WET - https://github.com/wet-boew/wet-boew), which is running > on > > the WebLog

s:url s:a and s:text

2021-06-09 Thread albert kao
How to use s:url s:a and s:text together? I tried this jsp but it did not work because some s:text did not get substituted. "> .properties file comp.href=https://www.mycomp.com/client.html#x1 browser.window.title=Title common.test.button=Test I tried to modify this jsp but then it did not

How to pass value from AbstractInterceptor to ActionSupport classes

2022-02-02 Thread albert kao
My application likes to pass value from AbstractInterceptor to two ActionSupport classes (codes below). When the user presses the Back button of a browser, hasValue() return true for class Action1. When the user presses the Back button of a browser, hasValue() return null for class Action2. My log

Browser Back button intercept, no javascript

2022-01-25 Thread albert kao
If the user presses the Back button of a browser, my application likes to intercept that and display a text message at the current web page. How to do that without using javascript? The following codes show an approach with AbstractInterceptor. Please review whether it will work. If yes, how to