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
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
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 =
---
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
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:
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:
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
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
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
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
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;
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
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
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
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
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.
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
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?
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
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
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
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
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
>
> __
>
>
>
> __
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"
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
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?
) {
> 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?
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
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:
This line displays the proper value
">
in header.jsp:
">
but displays an empty string
in http404.jsp ("Page Not Found"):
">
Please help.
Thanks.
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?
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 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.
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.
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
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
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
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
38 matches
Mail list logo