Re: Struts 6.1.1. // Ok to migrate to JDK 17, Spring 6, Hibernate 6?

2023-03-01 Thread John
I believe Spring6 and Hibernate6 are the branches including the JDK17 
javax to jakarta change.


John

On 3/1/2023 7:31 AM, Burton Rhodes wrote:
Well that's a good start.  We may begin testing this to see what 
happens.  Lukasz - many thanks as always.



-- Original Message --

From "Lukasz Lenart" 

To "Struts Users Mailing List" 
Date 3/1/2023 1:12:27 AM
Subject Re: Struts 6.1.1. // Ok to migrate to JDK 17, Spring 6, 
Hibernate 6?


wt., 28 lut 2023 o 13:11 Burton Rhodes  
napisał(a):


 Our team is considering a migration to Spring 6 and Hibernate 6 - 
which
 require JDK 17 and use the new jakarta packages (among other 
things). Is
 there anything within Struts 6.1.1 that would prevent such a 
migration?


Rather no, yet I'm not sure if Spring 6 and Hibernate do not require 
Jakarta API



Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Jakarta EE 9

2023-02-15 Thread John

Scary answer to business users - thanks for the honesty

On 2/12/2023 4:39 AM, Lukasz Lenart wrote:

śr., 8 lut 2023 o 21:41 John  napisał(a):

I'm not finding any announcement on a struts2 release resolving the
jakarta (two years ago) vs javax namespace problem. Is there a target
date for a resolution?

I'm still thinking about how to perform such a migration. I initially
thought to make the Core of Struts JavaX independent, yet this
requires introducing an additional abstraction layer to be backed
either by JavaX or Jakarta - this is a lot of work and some parts of
the code are strictly additive to JavaX which makes it almost
impossible to port.

Right now I'm more up to switching into JDK11 and Jakarta in Strus 7.x
and leaving Struts 6.x as is - JDK8 & JavaX.

Still there are some major issues to resolve:
- file-upload support, since Servlet API 3.1 it's possible to use
@MultipartConfig on servlets bun not on filters (Struts uses filters),
Commons Fileupload isn't released yet ->
https://issues.apache.org/jira/browse/FILEUPLOAD-309
- the Apache Tiles project has been retired, we copied all the sources
into the Struts Tiles plugin to keep it going, yet it will need
changes when switching to Jakarta namespace
https://github.com/apache/struts/pull/608

and there are probably other unwinded problems yet :)


Regards


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Jakarta EE 9

2023-02-08 Thread John
I'm not finding any announcement on a struts2 release resolving the 
jakarta (two years ago) vs javax namespace problem. Is there a target 
date for a resolution?


Thanks


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: OGNL in struts tag

2020-02-23 Thread John Bush
I understand the don't mix EL and Struts tags - and the use of 'top' in 
the valueStack.


I don't understand why the following first two don't provide like 
displaying HTML input tags.


Also why doesn't OGNL treat the third as a property of "a" and call the 
getter for formcolumnName.


Code


    
    
    


Result






Thanks - John Bush

On 2/23/2020 5:57 AM, Lukasz Lenart wrote:

pt., 21 lut 2020 o 04:05 M Huzaifah  napisał(a):


 

the jsp has error:

Struts Problem Report

Struts has detected an unhandled exception:

Messages:
/pages/common/genericform/genericMain.jsp (line: 165, column: 24) According to 
TLD or attribute directive in tag file, attribute name does not accept any 
expressions
File:   org/apache/jasper/compiler/DefaultErrorHandler.java
Line number:41

Yes, this is by design, we didn't want to base on ${} which is out of
Struts control and evaluated by a servlet container (Tag support
layer). That's why we used %{} instead, but ...


cause the error above, then i state attribute name on struts tag does not 
accept any expressions. if i test to just print like code bellow thats no 
problem:


 ${a.formcolumnName}

so, i read your documentation about the expression, then i change my code 
bellow:


 

it works perfectly, thank you Lucas.

... in such a case you don't have to use %{} at all, the "name"
attribute will be evaluated against ValueStack as an expression.
 tag pushes value into ValueStack (named "a" in your
case, but this is not required if not used), all the object's
properties are available in scope (inside) of the iterator by their
names, so this can be reduced to


 



Regards


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: convention plugin Issue

2019-12-19 Thread John Bush
I apologize for mistaking overriding method vs class in your 
description. I turned on debugging and it looks that all three classes 
are being found and struts actions are being created. The problem 
appears to be allowing the default process to create those - they get 
created with the same action name [hello-world] and namespace []. Struts 
in that case I believe takes the first encountered just like when using 
a struts.xml file. I don't use the Convention Plugin but I would suggest 
a solution might be to use the @Namespace annotation on the class or 
package. That way you would be able to specify a unique SCOPE when 
calling the action and get the result you need.


John

On 12/19/2019 12:52 AM, Zahid Rahman wrote:

This is not overriding method.



As you see when you declare the same functionality using the
struts.xml Then only that explicitly declared
method will be executed by the struts API [framework] in the
explicitly declared package.class.

Overriding methods in OOP means not using certain declared methods
from inherited classes and super impose on inherited methods by
writing your own methods.
So you use some methods from the inherited class not all [Pick and
choose, adapt]

This is randomly picking up a class by matching the  class names only.
There is no way to match packages names same as stuts.xml due to design of
annotation API. So I am suggesting do a match of same class names  [
validation  method in the annotations API ]  and raising an error to the
application developer of presence of duplicate class names.





On Thu, 19 Dec 2019 at 05:59, John Bush  wrote:


Overriding methods *is **a valid feature* in Java and probably all
object oriented languages. I'm confident, even at that lowest level, you
wouldn't be able to avoid methods being overridden. Above those layers
of code you have many more layers of code to provide the ability to
communicate with and over web technologies. Again with a high
probability of more methods being overridden. Eventually you get to the
Struts framework which is not flat. It is again layers of code, with
again a high probability of more methods being overridden.

IMHO A developer needs to understand the technology stack used including
the order of classpaths searched at execution time. A framework is
intended to help you do a job which implies you know what it's doing.

John

On 12/18/2019 9:48 AM, Lukasz Lenart wrote:

Feel free to register a ticket in JIRA, but this is something low
priority rather.


Regards
Lukasz

sob., 7 gru 2019 o 12:58 Zahid Rahman  napisał(a):

I think the convention plugin should perform a validation a check for

the

presence of multiple same class names within different
package names. That ambiguity has been shown by my test.
After all it is quite feasible and likely that we could have multiple

same

class names from different package names
from jars which have been placed on the classpath.
We cant have the convention plugin randomly (as shown by my test)
executing random code.

On Sat, 7 Dec 2019 at 10:51, Yasser Zamani 

wrote:

Hi,

I guess that the behavior of defining actions with same name and

namespace

is undefined. I think it's not an issue because Convention Plugin has

no

avenue to distinguish between them when you request
http://localhost:8080/hello-world.

Regards.


-Original Message-
From: Zahid Rahman 
Sent: Thursday, December 5, 2019 4:51 PM
To: Struts Users Mailing List 
Subject: convention plugin Issue

Hi,

On this page
https://struts.apache.org/plugins/convention/#setup

if I have  com.example.actions.HelloWorld.java
and
uk.mypackage.actions.HelloWorld.java
with  url http://localhost:8080/hello-world then
uk.mypackage.actions.HelloWorld.java  execute is run.

If I have
uk.example.actions.HelloWorld.java
and
com.example.actions.HelloWorld.java
then  com.example.actions.HelloWorld.java  execute is run.

uk.mypackage.actions.HelloWorld,java overrides the other two.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: convention plugin Issue

2019-12-18 Thread John Bush
Overriding methods *is **a valid feature* in Java and probably all 
object oriented languages. I'm confident, even at that lowest level, you 
wouldn't be able to avoid methods being overridden. Above those layers 
of code you have many more layers of code to provide the ability to 
communicate with and over web technologies. Again with a high 
probability of more methods being overridden. Eventually you get to the 
Struts framework which is not flat. It is again layers of code, with 
again a high probability of more methods being overridden.


IMHO A developer needs to understand the technology stack used including 
the order of classpaths searched at execution time. A framework is 
intended to help you do a job which implies you know what it's doing.


John

On 12/18/2019 9:48 AM, Lukasz Lenart wrote:

Feel free to register a ticket in JIRA, but this is something low
priority rather.


Regards
Lukasz

sob., 7 gru 2019 o 12:58 Zahid Rahman  napisał(a):

I think the convention plugin should perform a validation a check for the
presence of multiple same class names within different
package names. That ambiguity has been shown by my test.
After all it is quite feasible and likely that we could have multiple same
class names from different package names
from jars which have been placed on the classpath.
We cant have the convention plugin randomly (as shown by my test)
executing random code.

On Sat, 7 Dec 2019 at 10:51, Yasser Zamani  wrote:


Hi,

I guess that the behavior of defining actions with same name and namespace
is undefined. I think it's not an issue because Convention Plugin has no
avenue to distinguish between them when you request
http://localhost:8080/hello-world.

Regards.


-Original Message-
From: Zahid Rahman 
Sent: Thursday, December 5, 2019 4:51 PM
To: Struts Users Mailing List 
Subject: convention plugin Issue

Hi,

On this page
https://struts.apache.org/plugins/convention/#setup

if I have  com.example.actions.HelloWorld.java
and
uk.mypackage.actions.HelloWorld.java
with  url http://localhost:8080/hello-world then
uk.mypackage.actions.HelloWorld.java  execute is run.

If I have
uk.example.actions.HelloWorld.java
and
com.example.actions.HelloWorld.java
then  com.example.actions.HelloWorld.java  execute is run.

uk.mypackage.actions.HelloWorld,java overrides the other two.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: have plan to upgrade version of spring in struts 2 Spring plugin?

2019-12-15 Thread John Bush

Simon,

Note that it also states that you can declare newer versions of Spring 
if you wish. I currently support a number of web applications using the 
plugin and Spring v5.1.9 without any problems.


John

On 12/14/2019 4:16 AM, Yasser Zamani wrote:

Hi,

Thank you so much!

Yes we will upgrade Spring gradually during Struts 2.6.x releases - Struts 2.5 
is under maintenance mode only for security releases.

However, recent Struts 2.5.22 uses Spring 4.3.25.RELEASE [1]; doesn't it work 
for you?

Regards.

[1] https://mvnrepository.com/artifact/org.apache.struts/struts2-core/2.5.22


-Original Message-
From: Sai Man Yau 
Sent: Wednesday, December 11, 2019 7:58 AM
To: user@struts.apache.org
Subject: have plan to upgrade version of spring in struts 2 Spring plugin?

Dear Struts 2 Team,

Thanks for your hard work to maintain such great framework to sustain all other
developers. Thanks!!

Since struts is using spring is some of the component, I would like to ask will 
there
a plan to upgrade the spring dependencies for Struts 2 Spring plugin because of
the Spring has officially announced most of the versions will be EOL in coming
years. Thanks.

Reference quote:
"The current version (2.5.10.1) of the Struts 2 Spring plugin has transitive
dependencies to the Spring 4.1.6.RELEASE version. "

Regards,
Simon

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Jboss 7.2 gives 404 after deployment

2019-02-24 Thread John W. Himpel
Martin,

Thanks for the tip.

I was able to get further, but ran into more method not found issues.

I don't believe this is a struts issue, rather I believe it's an
impedence issue between classloader in JBoss 7 having requirements that
other JEE processors don't have and what maven produces (or my inputs
to maven).

I strongly suspect I will have more success moving this issue to the
JBoss user forum mailing list than continue bothering all of you.

Thanks for your help.

John

On Sun, 2019-02-24 at 16:48 +, Martin Gainty wrote:
> never say the r word..better to say he passed climbing everest but
> fell 10,000 feet into tibet
> 
> content/learning-0.0.1-SNAPSHOT.war/WEB-INF/lib/struts2-core-
> 2.5.20.jar/struts-default.xml:131:154
> 
> ensure struts-default.xml is located inside struts2-core-2.5.20.jar
> inside WEB-INF/lib folder
> (blow it apart with some zip tool/jar...physically copy struts-
> default.xml to WEB-INF/lib folder
> then rezip and deploy to WEB-INF/lib
> 
> *only if unpacking/repacking struts2-core-2.5.20.jar doesnt work
> after you restart the webapp*
> 
> in past versions i seem to recall copying a stock version of struts-
> default.xml into this folder
> WEB-INF/lib/struts2-core-2.5.20.jar!/struts-default.xml
> 
> you're almost at the top and ready to plant the flag
> 
> 
> From: John W. Himpel 
> Sent: Saturday, February 23, 2019 9:14 PM
> To: user@struts.apache.org
> Subject: Re: Jboss 7.2 gives 404 after deployment
> 
> On Sat, 2019-02-23 at 21:11 +, Martin Gainty wrote:
> > Unregistered web context: '/learning-0.0.1-SNAPSHOT' from server
> > 'default-server'
> > jboss is telling you the webapp /learning-0.0.1-SNAPSHOT was never
> > registered to JBoss wildlfly server default-server
> > 
> > if you're like me you would put all your web application
> > declarations
> > in WEB-INF/web.xml
> > 
> > if you're not like me you can just declare @WebServlet at the top
> > of
> > your servlet class
> > 
> > In all other scenarios such as deploying from eclipse or maven
> > deploy
> > please reference Jboss documentation at
> > http://docs.wildfly.org/14/Getting_Started_Developing_Applications_Guide.html
> > Getting Started Developing Applications Guide<
> > http://docs.wildfly.org/14/Getting_Started_Developing_Applications_Guide.html
> > The helloworld quickstart is comprised of a servlet and a CDI bean.
> > We also include an empty beans.xml file, which tells JBoss WildFly
> > to
> > look for beans in this application and to activate the
> > CDI.beans.xml
> > is located in WEB-INF/, which can be found in the src/main/webapp
> > directory. Also in this directory we include index.html which uses
> > a
> > simple meta refresh to send the users browser to the ...
> > docs.wildfly.org
> > 
> > 
> > hth
> > 
> > From: John W. Himpel 
> > Sent: Saturday, February 23, 2019 2:52 PM
> > To: user@struts.apache.org
> > Subject: Jboss 7.2 gives 404 after deployment
> > 
> > Greetings,
> > 
> > I have a very small Struts web app that I developed under Red Hat
> > Developer Studio.
> > 
> > I am using Struts 2.5.20, Jboss 7.2.0.
> > 
> > Right-click in on the project name in Red Hat Developer Studio,
> > select
> > properties->Web Project Settings and the Context root: shows a
> > "learning".
> > 
> > After deployment, in Firefox I enter the following url:  "
> > http://localhost:8080/learning/UserAction.action"; and I get a 404
> > response.  I have tried every variation of url strings that I can
> > think
> > of and everything returns a 404 response.
> > 
> > JBoss 7.2.0 standalone server.log
> > 
> > 2019-02-22 17:07:02,490 INFO  [org.jboss.as.repository]
> > (DeploymentScanner-threads - 1) WFLYDR0001: Content added at
> > location
> > /home/jwhimpel/EAP-
> > 7.2.0/standalone/data/content/b4/f3236590274c68445ad55b03656b282e04
> > 25
> > f1
> > /content
> > 2019-02-22 17:07:02,492 INFO  [org.wildfly.extension.undertow]
> > (ServerService Thread Pool -- 128) WFLYUT0022: Unregistered web
> > context: '/learning-0.0.1-SNAPSHOT' from server 'default-server'
> > 2019-02-22 17:07:02,550 INFO  [org.jboss.as.server.deployment] (MSC
> > service thread 1-4) WFLYSRV0028: Stopped deployment learning-0.0.1-
> > SNAPSHOT.war (runtime-name: learning-0.0.1-SNAPSHOT.war) in 58ms
> > 2019-02-22 17:07:02,551 INFO  [org.jboss.as.server.deplo

Re: Jboss 7.2 gives 404 after deployment

2019-02-23 Thread John W. Himpel
On Sat, 2019-02-23 at 21:11 +, Martin Gainty wrote:
> Unregistered web context: '/learning-0.0.1-SNAPSHOT' from server
> 'default-server'
> jboss is telling you the webapp /learning-0.0.1-SNAPSHOT was never
> registered to JBoss wildlfly server default-server
> 
> if you're like me you would put all your web application declarations
> in WEB-INF/web.xml
> 
> if you're not like me you can just declare @WebServlet at the top of
> your servlet class
> 
> In all other scenarios such as deploying from eclipse or maven deploy
> please reference Jboss documentation at
> http://docs.wildfly.org/14/Getting_Started_Developing_Applications_Guide.html
> Getting Started Developing Applications Guide<
> http://docs.wildfly.org/14/Getting_Started_Developing_Applications_Guide.html
> >
> The helloworld quickstart is comprised of a servlet and a CDI bean.
> We also include an empty beans.xml file, which tells JBoss WildFly to
> look for beans in this application and to activate the CDI.beans.xml
> is located in WEB-INF/, which can be found in the src/main/webapp
> directory. Also in this directory we include index.html which uses a
> simple meta refresh to send the users browser to the ...
> docs.wildfly.org
> 
> 
> hth
> 
> From: John W. Himpel 
> Sent: Saturday, February 23, 2019 2:52 PM
> To: user@struts.apache.org
> Subject: Jboss 7.2 gives 404 after deployment
> 
> Greetings,
> 
> I have a very small Struts web app that I developed under Red Hat
> Developer Studio.
> 
> I am using Struts 2.5.20, Jboss 7.2.0.
> 
> Right-click in on the project name in Red Hat Developer Studio,
> select
> properties->Web Project Settings and the Context root: shows a
> "learning".
> 
> After deployment, in Firefox I enter the following url:  "
> http://localhost:8080/learning/UserAction.action"; and I get a 404
> response.  I have tried every variation of url strings that I can
> think
> of and everything returns a 404 response.
> 
> JBoss 7.2.0 standalone server.log
> 
> 2019-02-22 17:07:02,490 INFO  [org.jboss.as.repository]
> (DeploymentScanner-threads - 1) WFLYDR0001: Content added at location
> /home/jwhimpel/EAP-
> 7.2.0/standalone/data/content/b4/f3236590274c68445ad55b03656b282e0425
> f1
> /content
> 2019-02-22 17:07:02,492 INFO  [org.wildfly.extension.undertow]
> (ServerService Thread Pool -- 128) WFLYUT0022: Unregistered web
> context: '/learning-0.0.1-SNAPSHOT' from server 'default-server'
> 2019-02-22 17:07:02,550 INFO  [org.jboss.as.server.deployment] (MSC
> service thread 1-4) WFLYSRV0028: Stopped deployment learning-0.0.1-
> SNAPSHOT.war (runtime-name: learning-0.0.1-SNAPSHOT.war) in 58ms
> 2019-02-22 17:07:02,551 INFO  [org.jboss.as.server.deployment] (MSC
> service thread 1-6) WFLYSRV0027: Starting deployment of "learning-
> 0.0.1-SNAPSHOT.war" (runtime-name: "learning-0.0.1-SNAPSHOT.war")
> 2019-02-22 17:07:05,345 INFO  [org.jboss.as.connector.deployers.jdbc]
> (MSC service thread 1-1) WFLYJCA0004: Deploying JDBC-compliant driver
> class org.hsqldb.jdbc.JDBCDriver (version 2.4)
> 2019-02-22 17:07:05,345 WARN  [org.jboss.weld.deployer] (MSC service
> thread 1-1) WFLYWELD0013: Deployment learning-0.0.1-SNAPSHOT.war
> contains CDI annotations but no bean archive was found (no beans.xml
> or
> class with bean defining annotations was present).
> 2019-02-22 17:07:05,365 INFO  [org.jboss.as.connector.deployers.jdbc]
> (MSC service thread 1-1) WFLYJCA0018: Started Driver service with
> driver-name = learning-0.0.1-
> SNAPSHOT.war_org.hsqldb.jdbc.JDBCDriver_2_4
> 2019-02-22 17:07:05,389 INFO  [org.wildfly.extension.undertow]
> (ServerService Thread Pool -- 156) WFLYUT0021: Registered web
> context:
> '/learning-0.0.1-SNAPSHOT' for server 'default-server'
> 2019-02-22 17:07:05,410 INFO  [org.jboss.as.server]
> (DeploymentScanner-
> threads - 1) WFLYSRV0016: Replaced deployment "learning-0.0.1-
> SNAPSHOT.war" with deployment "learning-0.0.1-SNAPSHOT.war"
> 2019-02-22 17:07:05,419 INFO  [org.jboss.as.repository]
> (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from
> location /home/jwhimpel/EAP-
> 7.2.0/standalone/data/content/8d/df8d999263bba04385d5ec7d9be0c010c651
> e9
> /content
> 
> struts.xml
>  "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
> "http://struts.apache.org/dtds/struts-2.5.dtd";>
> 
> 
> 
> regex:[a-zA-Z]* allowed-methods>
>  class="net.jlhimpel.learning.web.UserAction">
>  type="red

Jboss 7.2 gives 404 after deployment

2019-02-23 Thread John W. Himpel
Greetings,

I have a very small Struts web app that I developed under Red Hat
Developer Studio.

I am using Struts 2.5.20, Jboss 7.2.0.

Right-click in on the project name in Red Hat Developer Studio, select
properties->Web Project Settings and the Context root: shows a
"learning".

After deployment, in Firefox I enter the following url:  "
http://localhost:8080/learning/UserAction.action"; and I get a 404
response.  I have tried every variation of url strings that I can think
of and everything returns a 404 response.

JBoss 7.2.0 standalone server.log

2019-02-22 17:07:02,490 INFO  [org.jboss.as.repository]
(DeploymentScanner-threads - 1) WFLYDR0001: Content added at location
/home/jwhimpel/EAP-
7.2.0/standalone/data/content/b4/f3236590274c68445ad55b03656b282e0425f1
/content
2019-02-22 17:07:02,492 INFO  [org.wildfly.extension.undertow]
(ServerService Thread Pool -- 128) WFLYUT0022: Unregistered web
context: '/learning-0.0.1-SNAPSHOT' from server 'default-server'
2019-02-22 17:07:02,550 INFO  [org.jboss.as.server.deployment] (MSC
service thread 1-4) WFLYSRV0028: Stopped deployment learning-0.0.1-
SNAPSHOT.war (runtime-name: learning-0.0.1-SNAPSHOT.war) in 58ms
2019-02-22 17:07:02,551 INFO  [org.jboss.as.server.deployment] (MSC
service thread 1-6) WFLYSRV0027: Starting deployment of "learning-
0.0.1-SNAPSHOT.war" (runtime-name: "learning-0.0.1-SNAPSHOT.war")
2019-02-22 17:07:05,345 INFO  [org.jboss.as.connector.deployers.jdbc]
(MSC service thread 1-1) WFLYJCA0004: Deploying JDBC-compliant driver
class org.hsqldb.jdbc.JDBCDriver (version 2.4)
2019-02-22 17:07:05,345 WARN  [org.jboss.weld.deployer] (MSC service
thread 1-1) WFLYWELD0013: Deployment learning-0.0.1-SNAPSHOT.war
contains CDI annotations but no bean archive was found (no beans.xml or
class with bean defining annotations was present).
2019-02-22 17:07:05,365 INFO  [org.jboss.as.connector.deployers.jdbc]
(MSC service thread 1-1) WFLYJCA0018: Started Driver service with
driver-name = learning-0.0.1-
SNAPSHOT.war_org.hsqldb.jdbc.JDBCDriver_2_4
2019-02-22 17:07:05,389 INFO  [org.wildfly.extension.undertow]
(ServerService Thread Pool -- 156) WFLYUT0021: Registered web context:
'/learning-0.0.1-SNAPSHOT' for server 'default-server'
2019-02-22 17:07:05,410 INFO  [org.jboss.as.server] (DeploymentScanner-
threads - 1) WFLYSRV0016: Replaced deployment "learning-0.0.1-
SNAPSHOT.war" with deployment "learning-0.0.1-SNAPSHOT.war"
2019-02-22 17:07:05,419 INFO  [org.jboss.as.repository]
(DeploymentScanner-threads - 1) WFLYDR0002: Content removed from
location /home/jwhimpel/EAP-
7.2.0/standalone/data/content/8d/df8d999263bba04385d5ec7d9be0c010c651e9
/content

struts.xml
http://struts.apache.org/dtds/struts-2.5.dtd";>



regex:[a-zA-Z]*

listUser


/register.jsp


/register.jsp


listUser





web.xml

http://www.w3.org/2001/XMLSchema-instance";
 xmlns="http://xmnls.jcp.org/xml/ns/javaee";
 xmlns:web="http://xmnls.jcp.org/xml/ns/javaee/web-app_3_1.xsd";
 xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
http://xmnls.jcp.org/xml/ns/javaee/web-app_3_1.xsd";
 id="WebApp_ID"
 version="3.1"
>
  learning

  
struts2

org.apache.struts2.dispatcher.filter.StrutsPrep
areAndExecuteFilter


struts2
/*



index.jsp



pom.xml


http://maven.apache.org/POM/4.0.0"; xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
4.0.0
net.jlhimpel
learning
0.0.1-SNAPSHOT
war
learning


UTF-
8






maven-compiler-plugin
3.6.1

UTF-8
1.8
1.8



org.mortbay.jetty
jetty-maven-plugin
8.1.16.v20140903

CTRL+C
8999


xwork.loggerFactory
com.opensymphony.xwork2.util.logging
.log4j2.Log4j2LoggerFactory


10
${basedir}/src/main/webapp/<
/webAppSourceDirectory>

${basedir}/src/main/webapp/WEB-
INF/web.xml






learning




javax.servlet
javax.servlet-api
4.0.1
provided

Re: Question

2018-11-14 Thread John Bush
I would think it pertains to Struts 1 applications since the finding is 
for any use of Apache Commons FileUpload before 1.3.3. The latest 
version of Struts 1 used commons-fileupload-1.0.jar. Not many 
applications use the library so you may be able to just remove the jar 
from your application. If you don't find that's possible I have had 
success dropping in newer versions of commons-fileupload to replace the 
older. I haven't attempted it to a Struts 1 application though.


John B

On 11/14/2018 12:41 PM, Eric Reed wrote:

Struts 2.


-Original Message-
From: Deborah White
Sent: Wednesday, November 14, 2018 1:34 PM
To:user@struts.apache.org
Subject: Question

Hello, we have some very old internal apps that are still using Struts 1.  Does 
this alert apply to Struts 1 or only Struts 2?  It says 2.3.36 or prior so I'm 
not sure.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-131

CONFIDENTIALITY NOTICE: This communication with its contents may contain 
confidential and/or legally privileged information. It is solely for the use of 
the intended recipient(s). Unauthorized interception, review, use or disclosure 
is prohibited and may violate applicable laws including the Electronic 
Communications Privacy Act. If you are not the intended recipient, please 
contact the sender and destroy all copies of the communication.




Confidentiality Notice

This email including all attachments is confidential and intended solely for 
the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure under 
State and/or Federal law. Please notify the sender immediately if you have 
received this communication in error and delete this email from your system. If 
you are not the intended recipient you are notified that disclosing, copying, 
distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.


-
To unsubscribe, e-mail:user-unsubscr...@struts.apache.org
For additional commands, e-mail:user-h...@struts.apache.org





-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



struts2 freemarker.template.TemplateNotFoundException

2018-04-15 Thread john lee
Please help
I use struts2 to handle file upload, i already configured the following
a. /WEB-INF/lib    contains     commons-fileupload-1.3.2.jar    
commons-io-2.2.jar     
b. /WEB-INF/classes/struts.xml     
   
  
c. /var/apache-tomcat-7.0.34/webapps/mytest/WEB-INF/classes/dream
    mytest    application name    dream     package name
    contains
    template          /* folder name */    System  give me the error message as 
the following

SEVERE: Servlet.service() for servlet jsp threw 
exceptionfreemarker.template.TemplateNotFoundException: Template not found for 
name "/template/away from cold/file.ftl".The name was interpreted by this 
TemplateLoader: 
org.apache.struts2.views.freemarker.FreemarkerThemeTemplateLoader@1533de9.      
  at freemarker.template.Configuration.getTemplate(Configuration.java:1584)     
   at freemarker.template.Configuration.getTemplate(Configuration.java:1401)    
    at 
org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:97)
        at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:584)  
      at org.apache.struts2.components.UIBean.end(UIBean.java:538)        at 
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
        at 
org.apache.jsp.PropertyPhotoEdit_jsp._jspx_meth_s_005ffile_005f0(PropertyPhotoEdit_jsp.java:293)



Re: struts2 +rest service problem

2017-07-19 Thread john lee
I did add conventions plug-in, 

  From: Ken McWilliams 
 To: Struts Users Mailing List ; john lee 
 
 Sent: Wednesday, July 19, 2017 4:52 PM
 Subject: Re: struts2 +rest service problem
   
As mentioned in the other thread have you added the conventions plug-in? 

The indicated error indicates a failure of Struts2 to be able to find what it 
needs so your posted source should not be at issue. 

On Wed, Jul 19, 2017 at 3:13 PM, john lee  
wrote:


Please help for the struts2 + rest service 

http://beta-dev/ecommerce/ employee.xml




return the following error report

Struts Problem Report
Struts has detected an unhandled exception:
| Messages: |
   - com.thoughtworks.xstream. XStream
   - com/thoughtworks/xstream/ XStream
   - java.lang.reflect. InvocationTargetException
   - java.lang.RuntimeException: java.lang.reflect. InvocationTargetException
   - java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect. 
InvocationTargetException
   - java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.RuntimeException: java.lang.reflect. InvocationTargetException
 |
| File: | org/apache/catalina/loader/ WebappClassLoader.java |
| Line number: | 1,714 |


Stacktraces
java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect. 
InvocationTargetException    com.opensymphony.xwork2. inject.ContainerImpl$ 
MethodInjector.inject( ContainerImpl.java:301)
    com.opensymphony.xwork2. inject.ContainerImpl.inject( 
ContainerImpl.java:492)
    com.opensymphony.xwork2. inject.ContainerImpl$6.call( 
ContainerImpl.java:530)


source code:
cat Employee*.java
package xyz;
import xyz.*;
import java.util.Map;
import org.apache.struts2.rest. DefaultHttpHeaders;import 
org.apache.struts2.rest. HttpHeaders;import com.opensymphony.xwork2. 
ModelDriven;public class EmployeeController implements ModelDriven{     
   private static final long serialVersionUID = 1L;        private String id;   
     private Object model;        private EmployeeRepository employeeRepository 
= new EmployeeRepository();        private static Map map;     
   {                map = employeeRepository. findAllEmployee();        }       
 public HttpHeaders index() {                model = map;                return 
new DefaultHttpHeaders("index"). disableCaching();        }        public 
String add(){                Integer empId = Integer.parseInt(id);              
  Employee emp = new Employee(empId,"Ramesh", "PQR");                model = 
emp;                return "SUCCESS";        }        public String getId() {   
             return id;        }        public void setId(String id) {          
      model = employeeRepository. getEmployeeById(id);                this.id = 
id;        }        @Override        public Object getModel() {                
return model;        }} 
package xyz;
import java.util.*;import xyz.*;

public class Employee {        private Integer id;        private String name;  
      private String company;        public Employee(Integer id, String name, 
String company){                this.id =id;                this.name = name;   
             this.company = company;        }        public Integer getId() {   
             return id;        }        public void setId(Integer id) {         
       this.id = id;        }        public String getName() {                
return name;        }        public void setName(String name) {                
this.name = name;        }        public String getCompany() {                
return company;        }        public void setCompany(String company) {        
        this.company = company;        }} package xyz;

import java.util.*;import java.sql.Timestamp;import xyz.*;
import java.util.HashMap;import java.util.Map;
public class EmployeeRepository {        private static Map 
map = new HashMap();         public EmployeeRepository(){      
          map.put("111", new Employee(111, "Ram", "ABC"));                
map.put("222", new Employee(222, "Shyam", "EFG"));                
map.put("333", new Employee(333, "Mohan", "XYZ"));        }        public  
Employee getEmployeeById(String id){                return map.get(id);        
}        public  Map findAllEmployee(){                return 
map;        }} 

my configuration for struts.xml 




    

  




  




  

  

  

  

  

  








-- 
Sent from my C64 using a 300 baud modem


   

Re: struts2 with rest service

2017-07-19 Thread john lee
after i append, the problem is gone, but when i did test, have error message 
generated.
please see the thread.
thanks in advance.
john



  From: Ken McWilliams 
 To: Struts Users Mailing List ; john lee 
 
 Sent: Wednesday, July 19, 2017 4:11 PM
 Subject: Re: struts2 with rest service
   
Have you also included the struts2-conventions-plugin?

        
            org.apache.struts
            struts2-convention-plugin
            2.5.10.1
        

struts2-rest-plugin most definitely depends on struts2-conventions-plugin
but it isn't a declared dependency. I've thought that was strange for some
time. All the bean configurations such as struts.convention.action.suffix,
couldn't work otherwise.

On Wed, Jul 19, 2017 at 1:10 PM, john lee 
wrote:

> To whom it may concern,
> my struts+spring+hibernate+mysql works fine, but try to embed the rest
> service in the application and failed to start.
> my adding/change is the following
> WEB-INF/lib  (add the following jar)    json-lib-2.3-jdk15.jar
>    struts2-rest-plugin-2.3.32.jar
>
> WEB-INF/classes/struts.xml (add the following line with red font)
> 
>  
>  
>    name="struts.mapper.prefixMapping" value="/rest:rest,:struts"/>
> 
> 
>  value="rest-default"/>   value="example"/>
>  value="org.apache.struts2.spring.StrutsSpringObjectFactory"
> />
>  
> after start application, but in catalina.out see the following error, i
> did copy struts-plugin.xml into WEB-INF/classes/.
> thanks in advance
> john
>
> ***
> SEVERE: Exception starting filter struts2Unable to load configuration. -
> bean - jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-
> INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
> at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504)
>    at org.apache.struts2.dispatcher.ng.InitOperations.
> initDispatcher(InitOperations.java:74)        at
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
> init(StrutsPrepareAndExecuteFilter.java:57)        at
> org.apache.catalina.core.ApplicationFilterConfig.initFilter(
> ApplicationFilterConfig.java:278)        Caused by: Unable to load
> configuration. - bean - jar:file:/var/apache-tomcat-7.
> 0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.
> 3.32.jar!/struts-plugin.xml:30:130        at com.opensymphony.xwork2.
> config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
>      at 
>org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)
>      at org.apache.struts2.dispatcher.Dispatcher.init_
> PreloadConfiguration(Dispatcher.java:446)        at
> org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
> ... 15 moreCaused by: Unable to load bean: 
> type:com.opensymphony.xwork2.ActionProxyFactory
> class:org.apache.struts2.rest.RestActionProxyFactory - bean -
> jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-
> INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
> at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.
> register(XmlConfigurationProvider.java:247)        at
> org.apache.struts2.config.StrutsXmlConfigurationProvider.register(
> StrutsXmlConfigurationProvider.java:102)        at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(
> DefaultConfiguration.java:240)        at com.opensymphony.xwork2.
> config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
>      ... 18 moreCaused by: Bean type interface 
>com.opensymphony.xwork2.ActionProxyFactory
> with the name rest has already been loaded by bean -
> file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/
> classes/struts-plugin.xml:30:130 - bean - jar:file:/var/apache-tomcat-7.
> 0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.
> 3.32.jar!/struts-plugin.xml:30:130        at com.opensymphony.xwork2.
> config.providers.XmlConfigurationProvider.register(
> XmlConfigurationProvider.java:231)        ... 21 more
>



-- 
Sent from my C64 using a 300 baud modem


   

struts2 +rest service problem

2017-07-19 Thread john lee

Please help for the struts2 + rest service 

http://beta-dev/ecommerce/employee.xml




return the following error report

Struts Problem Report
Struts has detected an unhandled exception:
| Messages: |
   - com.thoughtworks.xstream.XStream
   - com/thoughtworks/xstream/XStream
   - java.lang.reflect.InvocationTargetException
   - java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
   - java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
   - java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 |
| File: | org/apache/catalina/loader/WebappClassLoader.java |
| Line number: | 1,714 |


Stacktraces
java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)
com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:530)


source code:
cat Employee*.java
package xyz;
import xyz.*;
import java.util.Map;
import org.apache.struts2.rest.DefaultHttpHeaders;import 
org.apache.struts2.rest.HttpHeaders;import 
com.opensymphony.xwork2.ModelDriven;public class EmployeeController implements 
ModelDriven{        private static final long serialVersionUID = 1L;    
    private String id;        private Object model;        private 
EmployeeRepository employeeRepository = new EmployeeRepository();        
private static Map map;        {                map = 
employeeRepository.findAllEmployee();        }        public HttpHeaders 
index() {                model = map;                return new 
DefaultHttpHeaders("index").disableCaching();        }        public String 
add(){                Integer empId = Integer.parseInt(id);                
Employee emp = new Employee(empId,"Ramesh", "PQR");                model = emp; 
               return "SUCCESS";        }        public String getId() {        
        return id;        }        public void setId(String id) {               
 model = employeeRepository.getEmployeeById(id);                this.id = id;   
     }        @Override        public Object getModel() {                return 
model;        }} 
package xyz;
import java.util.*;import xyz.*;

public class Employee {        private Integer id;        private String name;  
      private String company;        public Employee(Integer id, String name, 
String company){                this.id =id;                this.name = name;   
             this.company = company;        }        public Integer getId() {   
             return id;        }        public void setId(Integer id) {         
       this.id = id;        }        public String getName() {                
return name;        }        public void setName(String name) {                
this.name = name;        }        public String getCompany() {                
return company;        }        public void setCompany(String company) {        
        this.company = company;        }} package xyz;

import java.util.*;import java.sql.Timestamp;import xyz.*;
import java.util.HashMap;import java.util.Map;
public class EmployeeRepository {        private static Map 
map = new HashMap();         public EmployeeRepository(){      
          map.put("111", new Employee(111, "Ram", "ABC"));                
map.put("222", new Employee(222, "Shyam", "EFG"));                
map.put("333", new Employee(333, "Mohan", "XYZ"));        }        public  
Employee getEmployeeById(String id){                return map.get(id);        
}        public  Map findAllEmployee(){                return 
map;        }} 

my configuration for struts.xml 




    

  




  




  

  

  

  

  

  






struts2 with rest service

2017-07-19 Thread john lee
To whom it may concern, 
my struts+spring+hibernate+mysql works fine, but try to embed the rest service 
in the application and failed to start.
my adding/change is the following
WEB-INF/lib  (add the following jar)    json-lib-2.3-jdk15.jar
    struts2-rest-plugin-2.3.32.jar

WEB-INF/classes/struts.xml (add the following line with red font)

  
    
  
  
  
  
  

  
after start application, but in catalina.out see the following error, i did 
copy struts-plugin.xml into WEB-INF/classes/.
thanks in advance
john

***
SEVERE: Exception starting filter struts2Unable to load configuration. - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504)   
     at 
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
        at 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
        at 
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
        Caused by: Unable to load configuration. - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
        at 
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)      
  at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)   
     ... 15 moreCaused by: Unable to load bean: 
type:com.opensymphony.xwork2.ActionProxyFactory 
class:org.apache.struts2.rest.RestActionProxyFactory - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:247)
        at 
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
        at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
        at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
        ... 18 moreCaused by: Bean type interface 
com.opensymphony.xwork2.ActionProxyFactory with the name rest has already been 
loaded by bean - 
file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes/struts-plugin.xml:30:130
 - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:231)
        ... 21 more


RE: problem Migrating from Struts 2.3 to 2.5

2016-12-22 Thread John Aylward
Yes, for now, I just need the application working as it did before. I'm 
planning to rewrite all the existing actions using the REST plugin and moving 
forward from there. 

Having STI enabled when using wildcard matching is a little bit of a headache 
though. The entire point of me using the wildcard matching was because I didn't 
want to have to type out every method in the configuration. STI makes me have 
to type out every method in the configuration again.

--
John 


-Original Message-
From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
Sent: Thursday, December 22, 2016 3:58 PM
To: Struts Users Mailing List 
Subject: Re: problem Migrating from Struts 2.3 to 2.5

Right, SMI is a new addition in Struts 2.5 and it's better to use it instead of 
disabling, please read this 



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


RE: problem Migrating from Struts 2.3 to 2.5

2016-12-22 Thread John Aylward
Ok, I got it to work with an include file on 2.5.8. In my main struts.xml I 
added this:













Then in my included file I had to set this:



The strict method invocation was preventing my actions from loading. Disabling 
it allowed my wildcard actions to work again. I'm not sure if the regex was 
needed or not, but I'm leaving it for now since it's working.



--
John J. Aylward

-Original Message-
From: John Aylward [mailto:john.aylw...@sagenet.com] 
Sent: Thursday, December 22, 2016 10:20 AM
To: Struts Users Mailing List 
Subject: RE: problem Migrating from Struts 2.3 to 2.5

I combined all my struts.xml files into one and finally got a struts 
configuration error after a bit of massaging to get rid of old elements that I 
didn't need anymore and messed one up. At least I know the struts.xml file is 
being loaded now. I know the actions are being found because I purposefully 
made an error in the action section and it was properly reported.

However, once I cleaned up my errors, my actions still appear to not be 
loading, or perhaps they are loading in the wrong namespace.

When I try to access my actions in a browser directly, I get this message:
There is no Action mapped for namespace [/json] and action name 
[ClientData!loggedIn] associated with context path [].

I placed all my loaded files into the /json namespace:




 ...

In the 2.3.x branch I would get log message when an action was configured, but 
in 2.5.x I don't appear to get any such messages.


--
John


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


RE: problem Migrating from Struts 2.3 to 2.5

2016-12-22 Thread John Aylward
I combined all my struts.xml files into one and finally got a struts 
configuration error after a bit of massaging to get rid of old elements that I 
didn't need anymore and messed one up. At least I know the struts.xml file is 
being loaded now. I know the actions are being found because I purposefully 
made an error in the action section and it was properly reported.

However, once I cleaned up my errors, my actions still appear to not be 
loading, or perhaps they are loading in the wrong namespace.

When I try to access my actions in a browser directly, I get this message:
There is no Action mapped for namespace [/json] and action name 
[ClientData!loggedIn] associated with context path [].

I placed all my loaded files into the /json namespace:


http://struts.apache.org/dtds/struts-2.5.dtd";>






...

In the 2.3.x branch I would get log message when an action was configured, but 
in 2.5.x I don't appear to get any such messages.


--
John


-Original Message-
From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
Sent: Thursday, December 22, 2016 1:33 AM
To: Struts Users Mailing List 
Subject: Re: problem Migrating from Struts 2.3 to 2.5

2016-12-22 6:53 GMT+01:00 John Aylward :
> I'm trying to migrate my struts application from 2.3.31 to 2.5.8 but it 
> appears that my struts.xml is not getting loaded. My web.xml is pretty 
> standard:

Please try to use Struts 2.5.5

> "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>   
> "http://cp.mcafee.com/d/FZsSd1NJ5xVdBVVx5UTsSzssqenAXIELCQrzzhOYDtBOVJ
> 6UUQsL9TphsdEEEKeczDT73ozkD3Jb7Cdyw2GqhY6YKrFF7MrOVJ6P8Uw-Y_R-hd7bxEVp
> d7afnKnjpjjVBNcQsKcKsJt6OaaJPhO_OEuvkzaT0QSyrodTVdYQsELKe8IICXCM0t9NrD
> jJmSNf-00Uxd2CkD5Kt2WvcYxd0STjUBU_dKc2Wq8UQsLnbydiseQIuoSa1Rd8-3un1l9N
> rDjJmSNf-00CSnzhOYr1vF6y1qdi1_GCy0rAhzIVg8Cy1Sdljh0cjyTexEwjVAQgjGq84-
> vdIc6Sf2aBrb8">

Change 2.3 to 2.5

> 
>
>

You don't need that, Struts will automatically load any struts-default.xml and 
struts-plugin.xml

>   "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> 
> "http://cp.mcafee.com/d/FZsS71NJ5xVdBVVx5UTsSzssqenAXIELCQrzzhOYDtBOVJ
> 6UUQsL9TphsdEEEKeczDT73ozkD3Jb7Cdyw2GqhY6YKrFF7MrOVJ6P8Uw-Y_R-hd7bxEVp
> d7afnKnjpjjVBNcQsKcKsJt6OaaJPhO_OEuvkzaT0QSCrodTVdYQsELKe8IICXCM0t9NrD
> jJmSNf-00Uxd2CkD5Kt2WvcYxd0STjUBU_dKc2Wq8UQsLnbydiseQIuoSa1Rd8-3un1l9N
> rDjJmSNf-00CSnzhOYr1vF6y1qdi1_GCy0rAhzIVg8Cy1Sdljh0cjyTexEwjVAQgjGq84-
> vdIc6UKR_Jar3J3JL">

Same here, replace 2.3 with 2.5

Anyway, this can be related to
http://cp.mcafee.com/d/k-Kr3x8i6xASyMYCOYYMyYrKrhKed7bOtSknPqdNNEVujKOVsSzssqenAXIEK6Qkkn76hPXzxIhGjxSBzP6Ng1ld8-3undQQzUdVsSzpAsgvuvW_8CzBMQsICzB7HTbFIFFYOUCqen6nemKzp55mVEVvVkffGhBrwqrpdI6XYC-qeknT74mmjtPpesRG9pAGkr-DqJJyvY01MhB7s8hGoF-0a0FtwsCedJQ-9ufPrz0KCyed7bROUzkD3Jb7CdywtjifwTBMlismVQXlJIj_w09JBUQsL6MnWhEwmzkwvWFEw6V4oXek29EwtzlkQg34UJPEq84-pd44WCy1fDPr31I9fTe0fYVuvP
 but I cannot reproduce this with my example app


Regards
--
Łukasz
+ 48 606 323 122 
+ http://cp.mcafee.com/d/1jWVIgdEIf9ILfc8L6XCQrzzhOYDtB5YSzssqenAXIKndET
+ 76zBVeXabxJ555NNAs-UUr4qAUtFoYNIk0ljifwTBPtd8-3undESp747TD-LO9EVsd7b9E
+ VhWZOWraqvcK9CzBNBPBHEShhlKqen-l3PWApmU6CS3r1K_9LCzB5ZNN5BATsS02f-6NDM
+ 07BzYdJQ-9ufPrz0KCyed7bROUzkD3Jb7CdywtjifwTBMlismVQXlJIj_w09JBUQsL6MnW
+ hEwmzkwvWFEw6V4oXek29EwtzlkQg34UJPEq84-pd44WCy1fDPr31KhGv

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



problem Migrating from Struts 2.3 to 2.5

2016-12-21 Thread John Aylward
I'm trying to migrate my struts application from 2.3.31 to 2.5.8 but it appears 
that my struts.xml is not getting loaded. My web.xml is pretty standard:


http://java.sun.com/xml/ns/javaee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/web-app_3_0.xsd";
>
  app-name
  
  
  
index.html
  
  
struts2

org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
  
  
struts2
*.action
  

Then my struts.xml which worked fine in 2.3.31 but is not working in 2.5.8


http://struts.apache.org/dtds/struts-2.3.dtd";>

   
   

   
   

   
   

   
   



The struts.xml file is in my resources directory, and I verified it's being 
copied properly to webapp/WEB-INF/classes. However, when I start up my 
application in Tomcat, the StrutsPrepareAndExecuteFilter init method is called, 
but my actions as defined in my-json-actions.xml are not initialized. It 
appears that the struts.xml file is not loaded at all. I'm also not seeing any 
exceptions or error messages output.

Do I need to do something different in 2.5 to get my actions loading? My action 
definitions look something like this:


http://struts.apache.org/dtds/struts-2.3.dtd";>

   
   
 

     

Any help would be greatly appreciated! Thanks

--
John



unsubscribe me

2016-01-06 Thread john feng
unsubscribe


struts2 json return to front

2014-10-28 Thread john lee
  After click the button,     the value of partid is passed to action class, 
and see the output '123' from the console.    the assigned value of dummymesg 
is displayed on the console as well.
 but the dummymesg never return to front javascript.    looks like success or 
error function call never be called, 
please advise
thanks in advance



Cart.jsp
$(function() {
  $("#deleteButton").click(function(){
    $.ajax({
   type: "POST",
   url: "cart-del!del.action",
   data: {'partid':'123'},
   dataType:"json",
   success: function(json){
    console.log("return success");
    var obj = $.parseJSON(json);
    alert("dummey mesg="+obj.dummymesg);
    return false;
    },
    error: function(json){
 console.log("return error = "+json);
 alert("json=" + json);
 return false;
 }
    });
 });
    });delete

struts.xml ... 
    
    
 

CartAction.java
  public class CartAction extends ActionSupport {
 private String partid;
 public void setPartid(String partid) { this.partid=partid.trim(); }
 public String getPartid() { return partid; }
 
 public void setDummymesg(String dummymesg) { this.dummymesg=dummymesg; }
 public String getDummymesg() { return dummymesg; }  
  public String del() throws Exception {  dummymesg="struts 
function reached";
  System.out.println("cart-del, partid="+partid+"\n");
  System.out.println("cart-del, dummymesg="+dummymesg+"\n");
  return "json-data";
 }
}

Re: [struts-user] Re: struts2 json return null if involve hibernate or spring

2014-10-27 Thread john lee
What is the status of the Hibernate/JPA session at the time of the View 
rendering? 
i just use the following session approach       in the application.xml          
                  
          
 in the CartManagerImpl.java  public class CartManagerImpl implements 
CartManager  {
    CartDao cartDao;    public void setCartDao(CartDao cartDao) { 
this.cartDao=cartDao; }           public void removeSingle(Cartitem item) 
throws Exception { cartDao.deleteSingle(item); }
  

  From: Jason Pyeron 
 To: 'Struts Users Mailing List'  
 Sent: Monday, October 27, 2014 8:20 AM
 Subject: RE: [struts-user] Re: struts2 json return null if involve hibernate 
or spring
   
> -Original Message-
> From: john lee 
> Sent: Monday, October 27, 2014 9:06
> 
> the delete itself has no problem if called it directly. 

(please try not to top post)

>      From: Lukasz Lenart 
>  To: Struts Users Mailing List  
>  Sent: Monday, October 27, 2014 2:46 AM
>  Subject: Re: struts2 json return null if involve hibernate or spring
>    
> 2014-10-27 3:55 GMT+01:00 john lee :
> 
> 
> >  is hibernate dao manipulation could affect struts 2 json return?

In my expereince yes, regarding lazy loading and caching. But your code sample 
does not give enough detail to say if that is likely. What is the status of the 
Hibernate/JPA session at the time of the View rendering? 

> > or spring framework could affect struts2 json return?
> > my program's struts2 json execution is success if not 
> involve dao or spring call.
> > but if involve hibernate/spring/dao manipulation, then json 
> return is null and not returned.
> > struts.xml   
>  ...    
> >                    
> >
> >      
> > 
> > Cart.jsp  loadFromGoogle="%{google}" ajaxhistory="%{ajaxhistory}" 
> defaultIndicator="myDefaultIndicator"/>
> >
> >  <%@ taglib prefix="s" uri="/struts-tags" %>
> >  <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> 

Re: struts2 json return null if involve hibernate or spring

2014-10-27 Thread john lee
the delete itself has no problem if called it directly. 
  From: Lukasz Lenart 
 To: Struts Users Mailing List  
 Sent: Monday, October 27, 2014 2:46 AM
 Subject: Re: struts2 json return null if involve hibernate or spring
   
2014-10-27 3:55 GMT+01:00 john lee :


>  is hibernate dao manipulation could affect struts 2 json return?
> or spring framework could affect struts2 json return?
> my program's struts2 json execution is success if not involve dao or spring 
> call.
> but if involve hibernate/spring/dao manipulation, then json return is null 
> and not returned.
> struts.xml    ...     name="cart-del" class="CartAction" method="del">
>                    
>
>      
> 
> Cart.jsp  loadFromGoogle="%{google}" ajaxhistory="%{ajaxhistory}" 
> defaultIndicator="myDefaultIndicator"/>
>
>  <%@ taglib prefix="s" uri="/struts-tags" %>
>  <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> 

struts2 json return null if involve hibernate or spring

2014-10-26 Thread john lee
 is hibernate dao manipulation could affect struts 2 json return?
or spring framework could affect struts2 json return?
my program's struts2 json execution is success if not involve dao or spring 
call.
but if involve hibernate/spring/dao manipulation, then json return is null and 
not returned.
struts.xml ... 
    
    
 

Cart.jsp 
 
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <%@ taglib prefix="sj" uri="/struts-jquery-tags"%> 

Re: FYI: Email Field Validator Always Fails in iOS 7 Safari Browser

2014-10-13 Thread John Boyer
Thank you Lukasz. We started using the free Mailgun email validation service on 
our server because it checks for mistyped domains and performs other checks. 
Learn more at http://blog.mailgun.com/free-email-validation-api-for-web-forms

I’ve implemented a Java client for Mailgun’s email validation service and it’s 
available at https://github.com/johnboyer/mailgun-manager

John Boyer
rodaxsoft.com

On Oct 12, 2014, at 9:57 AM, Lukasz Lenart  wrote:

> 2014-10-11 4:20 GMT+02:00 John Boyer :
>> Hi All:
>> 
>> We’re using the latest version of Struts 2 in production and we’ve found 
>> that the client-side XML email validator always fails in the iOS 7.1 Safari 
>> browser. We haven’t tested it iOS 8 yet. However, removing the email 
>> validation from the following XML solved the problem.
>> 
>> 
>>
>>true
>>Email address is invalid
>>
>> 
>> 
>> Incidentally, the XML email validator works fine in Safari for Mac OS X.
> 
> This validator performs simple JS regex match on that expression [1] -
> so I would assume iOS 7.1 has broken regex engine ;-)
> 
> [1] 
> https://github.com/apache/struts/blob/09012d7e5f7177002893da3b2add091b04c62657/xwork-core/src/main/java/com/opensymphony/xwork2/validator/validators/EmailValidator.java#L83
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



FYI: Email Field Validator Always Fails in iOS 7 Safari Browser

2014-10-10 Thread John Boyer
Hi All:

We’re using the latest version of Struts 2 in production and we’ve found that 
the client-side XML email validator always fails in the iOS 7.1 Safari browser. 
We haven’t tested it iOS 8 yet. However, removing the email validation from the 
following XML solved the problem.



true
Email address is invalid



Incidentally, the XML email validator works fine in Safari for Mac OS X.

Have a nice weekend.

Regards,

John Boyer
rodaxsoft.com

Re: s:textfield jquery can not change placeholder

2014-07-25 Thread john lee
Thanks Chris.
 
It is solved after apply ID
 
  


On Friday, July 25, 2014 3:04 PM, Chris Pratt  wrote:
  


Make sure you set the "id" attribute on the s:textfield if you're going to
refer to it that way using jQuery.
  (*Chris*)



On Fri, Jul 25, 2014 at 12:30 PM, john lee 
wrote:

>
> I can use jquery to change html input tag's placeholder for no problem,
> but no matter what method I use, impossible for me to change
>   s:textfield's placeholder.
> I tried
>     $('#partid').attr('placeholder','XXX');
>     and
>     $('#partid').val('XXX');
>     and
>      $('#partid').text('XXX');
>
> s:textfield's placeholder impossible for jquery to change, is struts2
> limition or bugs?
>
> thanks in advance
>
> john
>
> *
>
>  <%@ taglib prefix="s" uri="/struts-tags" %>
> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
> 
>
> 
>   $(document).ready(function() {
>         $('#searchchoice').change(function() {
>              var ex = document.getElementById("searchchoice");
>              var finalchoice = ex.options[ex.options.selectedIndex].text;
>               if (finalchoice=='part#')
>                  $('#partid').attr('placeholder','input example: XXX');
>              else if (finalchoice=='keyword')
>                       $('#partid').attr('placeholder','input example 2:
> XXX');
>              else if (finalchoice=='model')
>                       $('#partid').attr('placeholder','input example 3:
> XXX');
>
>               });
>    });
> 
>
>  theme="simple" >
>                       id="searchchoice"
>                 name="searchchoice"
>                 list="#{'part#':'part#', 'keyword':'keyword',
> 'model#':'model'}"
>                 value="part#"
>                 theme="simple"
>                 required="true"
>          />
>       
>
>      
> 

s:textfield jquery can not change placeholder

2014-07-25 Thread john lee
 
I can use jquery to change html input tag's placeholder for no problem, but no 
matter what method I use, impossible for me to change 
  s:textfield's placeholder.
I tried
$('#partid').attr('placeholder','XXX');
    and
    $('#partid').val('XXX');
    and
 $('#partid').text('XXX');
 
s:textfield's placeholder impossible for jquery to change, is struts2 limition 
or bugs? 
 
thanks in advance
 
john

*
 
 <%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

 

  $(document).ready(function() {
    $('#searchchoice').change(function() {
 var ex = document.getElementById("searchchoice");
 var finalchoice = ex.options[ex.options.selectedIndex].text;
  if (finalchoice=='part#')
 $('#partid').attr('placeholder','input example: XXX');
 else if (finalchoice=='keyword')
  $('#partid').attr('placeholder','input example 2: XXX');
 else if (finalchoice=='model')
  $('#partid').attr('placeholder','input example 3: XXX');
 
  });
   });

 

 
  
    
 


Re: How to implement multi tenancy with separate database in struts and hibernate?

2014-07-08 Thread john feng
Oracle 12c should fit your needs. Unless you want to recreate this feature
by your self.


On Tue, Jul 8, 2014 at 5:36 AM, Kevin Peterson  wrote:

> Hi,
>
> We have an application wherein we want to keep separate database for each
> client. We want to achieve this using multi tenancy approach. A working
> example will be highly appreciated.
>
> Thanks,
> Kevin Peterson
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: struts2 s:url call action method

2014-06-27 Thread john lee


Hi Dave,

How to verify ?

thanks in advance

John 


On Friday, June 27, 2014 4:04 PM, Dave Newton  wrote:
  


Do you have dynamic method invocation turned on?



On Fri, Jun 27, 2014 at 4:34 PM, john lee 
wrote:

>
>
> I try to use s:url to call action's method, but not works, please advise
>
> from the executed link, it shows
> http://omega3.neucoinc.com/ecommerce/CartAction.action!additem?partid=1508,
> but logfile no method shows executed.
>
> i executed/tested manually by
> http://localhost/CartAction.action!add?partid=1508,shows no resource is
> available
>
> so, what is the correct way/syntax to use s:url tag to call action's
> method ?
>
> thanks in advnce
>
> john
>
> ***
>
> 3 files  (  CartAction.java, Cart.jsp, Struts.xml )
>
> Struts.xml
>            
>                     Success.jsp
>              
>
> CartAction.java
>       public class CartAction extends ActionSupport {
>                      public String add() throws Exception {
>             
>       }
>
> Cart.jsp
>         escapeAmp="false">
>                
> 
>        
>        Add to Cart




-- 
e: davelnew...@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton
>

struts2 s:url call action method

2014-06-27 Thread john lee


I try to use s:url to call action's method, but not works, please advise

from the executed link, it shows 
http://omega3.neucoinc.com/ecommerce/CartAction.action!additem?partid=1508, but 
logfile no method shows executed.

i executed/tested manually by  
http://localhost/CartAction.action!add?partid=1508, shows no resource is 
available

so, what is the correct way/syntax to use s:url tag to call action's method ?

thanks in advnce

john

***

3 files  (  CartAction.java, Cart.jsp, Struts.xml )

Struts.xml
   
Success.jsp
  

CartAction.java
  public class CartAction extends ActionSupport {
 public String add() throws Exception {
    
  }

Cart.jsp
   
    
   
   Add to Cart

Re: Struts2 namespace confusion

2014-05-24 Thread John Patrick
Not seen this happen myself, what struts jar's do you have as it might be
something like the convention plugin...

If your using maven then it might be useful for others to include what
specific maven dependencies your including so potentially someone else can
try using the exact same jars.

John



On 24 May 2014 15:28, Matt Williams  wrote:

> Hello,
> I have been using struts 2.1.8 for a while and last night noticed an issue
> with mapping actions working with any url.
>
> For instance in the struts.xml file:
> - I have a package with a namespace of "/employee".
> - Within the package, I have an action mapping "search"
> - The webapp name is "TestWeb".
>
> So to access this page, I can go to:
> http://localhost:8080/TestWeb/employee/search.action and this works.
> However, if anything is added to the URL after the namespace such as:
> http://localhost:8080/TestWeb/employee/someExtraText/search.action the
> page still loads.
>
> Why does this happen?
>
>
> Reading the struts documentation
> (http://struts.apache.org/release/2.1.x/docs/namespace-configuration.html)
> would make me assume that it should search the "/employee/someExtraText"
> namespace...not find it, so then it should fall back to the default ""
> namespace...not find it...then display no action mapping found.
>
>
> Any insight? Thanks!
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Unable to Find FreeMarker Template in Struts 2.3.16.2

2014-05-01 Thread John Boyer
Hello:

I've upgraded from Struts 2.3.4.1 to Struts 2.3.16.2. I've been using the 
KUTheme to render a vertical checkbox list as outlined in 2.2x docs at 
http://goo.gl/vHqXBH. However, now the framework is unable to find KUTheme 
template in Struts 2.3.16.2. It's located in default location at 
`template/KUTheme`, but I get the following FreeMarker template error:

~~
Error reading included file template/~~~KUTheme/controlheader-core.ftl
The problematic instruction:
--
==> include 
"/${parameters.templateDir}/${parameters.expandTheme}/controlheader-core.ftl" 
[on line 23, column 1 in template/xhtml/controlheader.ftl]
 in include "/${parameters.templateDir}/xhtml/controlheader.ftl" [on line 1, 
column 1 in template/KUTheme/checkboxlist.ftl]
--

Java backtrace for programmers:
--
freemarker.template.TemplateException: Error reading included file 
template/~~~KUTheme/controlheader-core.ftl
...
~~

Does anyone know to fix this problem? 

I've included the theme's file content below, if that helps.

Thank you for your time in advance.

Regards,

John Boyer


<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
KUTheme Files


<#include "/${parameters.templateDir}/xhtml/controlheader.ftl" />
<#include "/${parameters.templateDir}/KUTheme_simple/checkboxlist.ftl" />
<#include "/${parameters.templateDir}/xhtml/controlfooter.ftl" /><#nt/>



<#assign itemCount = 0/>
<#if parameters.list??>
<@s.iterator value="parameters.list">
<#assign itemCount = itemCount + 1/>
<#if parameters.listKey??>
<#assign itemKey = stack.findValue(parameters.listKey)/>
<#else>
<#assign itemKey = stack.findValue('top')/>

<#if parameters.listValue??>
<#assign itemValue = 
stack.findString(parameters.listValue)?default("")/>
<#else>
<#assign itemValue = stack.findString('top')/>

<#assign itemKeyStr=itemKey.toString() />

<#if tag.contains(parameters.nameValue, itemKey)>
 checked="checked"<#rt/>

<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>

<#if parameters.title??>
 title="${parameters.title?html}"<#rt/>

<#include "/${parameters.templateDir}/simple/scripting-events.ftl" />
<#include "/${parameters.templateDir}/simple/common-attributes.ftl" />
/>
${itemValue?html} 

<#else>
   


<#if parameters.disabled?default(false)>
 disabled="disabled"<#rt/>

 />


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to Prevent Double Submits After Upgrading to Struts 2.3.16.2

2014-04-30 Thread John Boyer
I can confirm that setting devMode to `false` suppresses the token error. I 
should have looked more closely at the error message because it contained the 
solution.

Thank you,

John Boyer

On Apr 29, 2014, at 10:02 PM, Lukasz Lenart wrote:

> Switch off devMode and check again.
> 
> 2014-04-30 2:08 GMT+02:00 John Boyer:
>> Martin et. al.:
>> 
>> Yes, the examples seem to run fine. And my code worked fine in version 
>> 2.3.4.1. However, after upgrading from Struts 2.3.4.1 to 2.3.16.2, I get the 
>> following error:
>> 
>> 2014-04-29 15:28:56,950 WARN  ...ParametersInterceptor.warn:56 - Parameter 
>> [struts.token.name] is on the excludeParams list of patterns!
>> 2014-04-29 15:28:56,964 ERROR ...ParametersInterceptor.error:34 - Developer 
>> Notification (set struts.devMode to false to disable this message):
>> 
>> Unexpected Exception caught setting 'token' on 'class 
>> com.xxx.xxx.CompleteSignUpAction: Error setting expression 'token' with 
>> value ['1GO4EYXDWVOD8UQYOBQT3KU0H7SRZED', ]
>> 
>> I changed my configuration to be consistent with the examples; however, that 
>> didn't seem to make a difference. What am I missing here? Am I supposed to 
>> add a token field to my action class?
>> 
>> Thanks,
>> 
>> John
>> 
>> -
>> > method="execute">
>>
>>
>>
>>/WEB-INF/jsp/summary.jsp
>>
>>${nextResult}
>>
>>> name="invalid.token">/WEB-INF/jsp/regerror.jsp
>>
>> 
>> 
>> 
>> 
>> On Apr 29, 2014, at 12:56 PM, Martin Gainty wrote:
>> 
>>> Its in showcase struts.xml
>>> interceptor-ref name="token"
>>> make sure you specify invalid.token result and a valid jsp page as seen here
>>> 
>>> >> class="org.apache.struts2.showcase.token.TokenAction">
>>>
>>>
>>>>> name="invalid.token">/WEB-INF/token/doublePost.jsp
>>>/WEB-INF/token/transferDone.jsp
>>> 
>>> 
>>> HTH,
>>> Martin
>>> __
>>> Member
>>> _ _  _ _  _ ___ _   
>>>  _   _ _   _
>>> |_   _| |_ ___   |  _  |___ ___ ___| |_ ___   |   __|___|  _| |_ _ _ _ ___ 
>>> ___ ___   |   __|___ _ _ ___ _| |___| |_|_|___ ___
>>>  | | |   | -_|  | | . | .'|  _|   | -_|  |__   | . |  _|  _| | | | .'|  
>>> _| -_|  |   __| . | | |   | . | .'|  _| | . |   |
>>>  |_| |_|_|___|  |__|__|  _|__,|___|_|_|___|  |_|___|_| |_| 
>>> |_|__,|_| |___|  |__|  |___|___|_|_|___|__,|_| |_|___|_|_|
>>>   |_|
>>> 
>>> 
>>> 
>>>> From: j...@rodaxsoft.com
>>>> Subject: How to Prevent Double Submits After Upgrading to Struts 2.3.16.2
>>>> Date: Tue, 29 Apr 2014 08:52:40 -0700
>>>> To: user@struts.apache.org
>>>> 
>>>> Hello:
>>>> 
>>>> I'm upgrading from Struts 2.3.4.1 to Struts 2.3.16.2. I've found that my 
>>>> previous solution for preventing double submits no longer works.
>>>> 
>>>> I get the following warning:
>>>> 
>>>> ...ParametersInterceptor.warn:56 - Parameter [struts.token.name] is on the 
>>>> excludeParams list of patterns!
>>>> 
>>>> It's unclear to me how to resolve this problem.
>>>> 
>>>> I'm using struts.xml to define the action workflow. How can I fix this 
>>>> problem?
>>>> 
>>>> ---
>>>> 
>>>> >>> method="myMethodToInvoke">
>>>> 
>>>> 
>>>> 
>>>> /WEB-INF/jsp/input.jsp
>>>> 
>>>> http://example.com
>>>> 
>>>> ...
>>>> 
>>>> 
>>>> ---
>>>> 
>>>> Thank you for your time.
>>>> 
>>>> John Boyer
>>>> 
>>>> 
>>>> -
>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>> 
>> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: How to Prevent Double Submits After Upgrading to Struts 2.3.16.2

2014-04-29 Thread John Boyer
Martin et. al.:

Yes, the examples seem to run fine. And my code worked fine in version 2.3.4.1. 
However, after upgrading from Struts 2.3.4.1 to 2.3.16.2, I get the following 
error:

2014-04-29 15:28:56,950 WARN  ...ParametersInterceptor.warn:56 - Parameter 
[struts.token.name] is on the excludeParams list of patterns!
2014-04-29 15:28:56,964 ERROR ...ParametersInterceptor.error:34 - Developer 
Notification (set struts.devMode to false to disable this message):

Unexpected Exception caught setting 'token' on 'class 
com.xxx.xxx.CompleteSignUpAction: Error setting expression 'token' with value 
['1GO4EYXDWVOD8UQYOBQT3KU0H7SRZED', ]

I changed my configuration to be consistent with the examples; however, that 
didn't seem to make a difference. What am I missing here? Am I supposed to add 
a token field to my action class?

Thanks,

John

-




/WEB-INF/jsp/summary.jsp

${nextResult}

/WEB-INF/jsp/regerror.jsp





On Apr 29, 2014, at 12:56 PM, Martin Gainty wrote:

> Its in showcase struts.xml
> interceptor-ref name="token"
> make sure you specify invalid.token result and a valid jsp page as seen here
> 
> 
> 
> 
>  name="invalid.token">/WEB-INF/token/doublePost.jsp
> /WEB-INF/token/transferDone.jsp
> 
> 
> HTH,
> Martin 
> __ 
> Member
>  _ _  _ _  _ ___ _
> _   _ _   _ 
> |_   _| |_ ___   |  _  |___ ___ ___| |_ ___   |   __|___|  _| |_ _ _ _ ___ 
> ___ ___   |   __|___ _ _ ___ _| |___| |_|_|___ ___ 
>   | | |   | -_|  | | . | .'|  _|   | -_|  |__   | . |  _|  _| | | | .'|  
> _| -_|  |   __| . | | |   | . | .'|  _| | . |   |
>   |_| |_|_|___|  |__|__|  _|__,|___|_|_|___|  |_|___|_| |_| |_|__,|_| 
> |___|  |__|  |___|___|_|_|___|__,|_| |_|___|_|_|
>|_|
> 
> 
> 
> 
> > From: j...@rodaxsoft.com
> > Subject: How to Prevent Double Submits After Upgrading to Struts 2.3.16.2
> > Date: Tue, 29 Apr 2014 08:52:40 -0700
> > To: user@struts.apache.org
> > 
> > Hello:
> > 
> > I'm upgrading from Struts 2.3.4.1 to Struts 2.3.16.2. I've found that my 
> > previous solution for preventing double submits no longer works.
> > 
> > I get the following warning:
> > 
> > ...ParametersInterceptor.warn:56 - Parameter [struts.token.name] is on the 
> > excludeParams list of patterns!
> > 
> > It's unclear to me how to resolve this problem. 
> > 
> > I'm using struts.xml to define the action workflow. How can I fix this 
> > problem?
> > 
> > ---
> > 
> >  > method="myMethodToInvoke">
> > 
> > 
> > 
> > /WEB-INF/jsp/input.jsp
> > 
> > http://example.com
> > 
> > ...
> > 
> > 
> > ---
> > 
> > Thank you for your time.
> > 
> > John Boyer
> > 
> > 
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >



How to Prevent Double Submits After Upgrading to Struts 2.3.16.2

2014-04-29 Thread John Boyer
Hello:

I'm upgrading from Struts 2.3.4.1 to Struts 2.3.16.2. I've found that my 
previous solution for preventing double submits no longer works.

I get the following warning:

...ParametersInterceptor.warn:56 - Parameter [struts.token.name] is on the 
excludeParams list of patterns!

It's unclear to me how to resolve this problem. 

I'm using struts.xml to define the action workflow. How can I fix this problem?

---





/WEB-INF/jsp/input.jsp

http://example.com

...


---

Thank you for your time.

John Boyer


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to Resolve excludeParams Restriction when Upgrading to Struts 2.3.16.2

2014-04-28 Thread John Boyer
Hello:

I'm upgrading from Struts 2.3.4.1 to Struts 2.3.16.2. I've found that some of 
my actions no longer work due to the excludeParams restrictions.

For example, I get the following warning:

...ParametersInterceptor.warn:56 - Parameter [action:myExcludedAction] is on 
the excludeParams list of patterns!

It's unclear to me how to resolve this problem. The 
acceptableParameterName(String) method is not being called with the excluded 
parameter, so I'm too late in the workflow.

I'm using struts.xml to define the action workflow. How can I fix this problem?

---


/WEB-INF/jsp/success.jsp


---

Thanks for your time.

John Boyer





-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Why do I get this XHTML validation errors?

2014-03-06 Thread John Patrick
try pastebin.com or gist.github.com as they do syntax highlighting and
saves people having the whole xml blob in an email, also line numbers can
be commented upon correctly as it might be different depending what your
viewing it in.


On 6 March 2014 13:04, Fredrik Andersson  wrote:

> Yes you are right!I guess this is beacause I use online outlook!I will try
> to post it again, written in curier new in textpad or something first!Sorry
> again!
>
> > From: lukaszlen...@apache.org
> > Date: Thu, 6 Mar 2014 14:02:56 +0100
> > Subject: Re: Why do I get this XHTML validation errors?
> > To: user@struts.apache.org
> >
> > Unreadable :\
> >
> > 2014-03-06 13:35 GMT+01:00 Fredrik Andersson :
> > > Hello guys!
> > > I trying to produce a app that renders in XHTML. "-//W3C//DTD XHTML 1.0 Transitional//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>http://www.w3.org/1999/xhtml";>
> > > How ever I got a form looking like this:
> > > name="productComment.emailAddress" label="Email address"
> labelposition="top" maxlength="128" size="40" />   name="productComment.subject" label="Subject" labelposition="top"
> maxlength="128" size="40" />  label="Message (max 1024 chars)" cols="52" rows="5" labelposition="top"
> wrap="hard"/> name="PRODUCTCOMMENTSACTION_FORM_TOKEN_NAME" value="%{formToken}" />
>  
> > > This gets rendered like:25  name="productcommentssave" action="/productcommentssave.action"
> method="post">26 27 28  valign="top" colspan="2"> for="productcommentssave_productComment_emailAddress" class="label">Email
> address:29 30 31  name="productComment.emailAddress" size="40" maxlength="128" value=""
> id="productcommentssave_productComment_emailAddress"/>33 343536
> 37  for="productcommentssave_productComment_subject"
> class="label">Subject:38 39 40  type="text" name="productComment.subject" size="40" maxlength="128"
> value="" id="productcommentssave_productComment_subject"/>42
> 434445 46  for="productcommentssave_productComment_text" class="label">Message (max
> 1024 chars):47 48 49  name="productComment.text" cols="52" rows="5" wrap="hard"
> id="productcommentssave_productComment_text">51 525354
> 55  id="productcommentssave_0" value="Submit"/>56 57585960
>  value="1394108222515"
> id="productcommentssave_PRODUCTCOMMENTSACTION_FORM_TOKEN_NAME"/>61  type="hidden" name="productid" value="3"
> id="productcommentssave_productid"/>62 
> > > From http://validator.w3.org/#validate_by_input+with_options I
> validate it and get these 3 anoying errors:
> > >  Line 50, Column 63: there is no attribute "wrap"…Comment.text"
> cols="52" rows="5" wrap="hard" id="productcommentssave_productCo…✉You have
> used the attribute named above in your document, but the document type you
> are using does not support that attribute for this element. This error is
> often caused by incorrect use of the "Strict" document type with a document
> that uses frames (e.g. you must use the "Transitional" document type to get
> the "target" attribute), or by using vendor proprietary extensions such as
> "marginheight" (this is usually fixed by using CSS to achieve the desired
> effect instead).This error may also result if the element itself is not
> supported in the document type you are using, as an undefined element will
> have no supported attributes; in this case, see the element-undefined error
> message for further information.How to fix: check the spelling and case of
> the element and attribute, (Remember XHTML is all lower-case) and/or check
> that they are both allowed in the chosen document type, and/or use CSS
> instead of this attribute. If you received this error when using the
>  element to incorporate flash media in a Web page, see the FAQ item
> on valid flash. Line 60, Column 161: document type does not allow element
> "input" here…1394108222515"
> id="productcommentssave_PRODUCTCOMMENTSACTION_FORM_TOKEN_NAME"/>✉The
> element named above was found in a context where it is not allowed. This
> could mean that you have incorrectly nested elements -- such as a "style"
> element in the "body" section instead of inside "head" -- or two elements
> that overlap (which is not allowed).One common cause for this error is the
> use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly
> closed elements, this error can create cascading effects. For instance,
> using XHTML's "self-closing" tags for "meta" and "link" in the "head"
> section of a HTML document may cause the parser to infer the end of the
> "head" section and the beginning of the "body" section (where "link" and
> "meta" are not allowed; hence the reported error). Line 61, Column 93:
> document type does not allow element "input" here…t type="hidden"
> name="productid" value="3" id="productcommentssave_productid"/>✉The element
> named above was found in a context where it is not allowed. This could mean
> that you have incorrectly nested elements -- such as a "style" element in
> the "body" section instead of inside "head" -- o

StrutsTestCase issues with basic jsp via convention plugin

2014-02-23 Thread John Patrick
Hi,

Having some issues around automated testing using struts2-junit-plugin
accessing a jsp via struts2-convention-plugin.

Basically the following two url's;
http://struts.apache.org/release/2.3.x/docs/convention-plugin.html
http://struts.apache.org/release/2.3.x/docs/struts-2-junit-plugin-tutorial.html


./pom.xml
./src/main/resources/struts.xml
./src/main/webapp/WEB-INF/content/hello-world.jsp
./src/main/webapp/WEB-INF/web.xml
./src/test/java/tld/example/HelloWorldTest.java

files at; https://gist.github.com/nhojpatrick/9174445

When checking the web app using jetty it works correctly, i.e.
$ mvn clean install ;
$ mvn jetty:run ;
$ curl http://localhost:8080/hello-world

Any ideas, or is this a potential issue/bug with struts2-junit-plugin?

Cheers,
John


struts2 jquery sj:tabbedpanel remoteurl

2013-11-19 Thread john lee


I use sturs2 jquery  sj:tabbedpanel with remoteurl feature, it works fine.

But, the remote url is called when did initiala load, how can I disable initial 
load for remote url?

i just want to load(tab1 with remote URL) when i click it.

thanks in advance

John

*


       






       
       



Struts 2, session, s:iterator s:if not working, please help (this is revised)

2013-11-18 Thread john lee


from the following output,
   we can tell sell_price=36.97, display_price=1

why
   none of test statement works ? 


please advise, thanks in advance

john
  


Class Part {
float sell_price;
    int display_price;
    ./*..get set here */

Action.java 
 ArrayList parts=new ArrayList();
 ./* doing some calculation for multiple part*/
 session.put("detailpart",parts);

JSP file
    
     why- why

 
 99
 
 
    
    88
  
   
  
 77
  
  
   
    66
    
   
   
 55
   
  end
    

OutPut
   

why 36.97- 1 why

end

s:if iterator session problem

2013-11-18 Thread john lee
 
from the following output,
   we can tell sell_price=36.97, display_price=1
 
why
   none of test statement works ? 
 
 
please advise, thanks in advance
 
john
  
 
 
Class Part {
float sell_price;
    int display_price;
    ./*..get set here */
 
Action.java 
 Part part=new Part();
 ./* doing some calculation */
 session.put("detailpart",part);
 
JSP file
    
     why- why

 
 99
 
 
    
    88
  
   
  
 77
  
  
   
    66
    
   
   
 55
   
  end
    
 
OutPut
   
 
why 36.97- 1 why

end

Re: sj:tabbedpanel javascript

2013-08-09 Thread john lee
view source
 
the related option for jquery(after sj_query convert into jquery), it shows 
following  
 
 jQuery(document).ready(function () {  
 var options_partmoreinfo = {}; 
 options_partmoreinfo.jqueryaction = "tabbedpanel";  
 options_partmoreinfo.id = "partmoreinfo";  
 options_partmoreinfo.oncom = "tabcomplete";  
 options_partmoreinfo.oncha = "tabchange";
 jQuery.struts2_jquery_ui.bind(jQuery('#partmoreinfo'),options_partmoreinfo);   
 
 }); 
<script type='text/javascript'>jQuery(document).ready(function () {  var 
options_partmoreinfo = {};  options_partmoreinfo.jqueryaction = "tabbedpanel";  
options_partmoreinfo.id = "partmoreinfo";  options_partmoreinfo.oncom = 
"tabcomplete";  options_partmoreinfo.oncha = "tabchange";  
jQuery.struts2_jquery_ui.bind(jQuery('#partmoreinfo'),options_partmoreinfo);   
}); 
  
that is why i use the following
 
    $('#partmoreinfo').tabs("selectedTab", "partmoreinfo_id", 3);
 or 
   $("#partmoreinfo").tabs( "taboptions", "partmoreinfo_id", 3);
 
to access the attribute selectedTab of sj:tabbedpanel's attrubte "selectedTab", 
but not working.
 

>        
>        
>        
>         Accessories here 
>         Replacement Parts here 
>         Cross Reference here 
>   
 
Please advise
 
thanks again
 
john
     
 


 From: Chris Pratt 
To: john lee  
Cc: Struts Users Mailing List  
Sent: Friday, August 9, 2013 1:27 PM
Subject: Re: sj:tabbedpanel javascript
  

I have no idea what you mean.  The sj:tabbedpanel generates HTML Elements
and some jQuery based JavaScript.  It'll all be there in the source.
What's not "match"ing?
  (*Chris*)


On Fri, Aug 9, 2013 at 11:00 AM, john lee  wrote:

> thanks for reply,
>
> i did view source before ask question here, but sj:tabbedpanel convert
> into jquery, even view source, still not match.
>
> john
>
>    *From:* Chris Pratt 
> *To:* Struts Users Mailing List ; john lee <
> sh_thorn_b...@yahoo.com>
> *Sent:* Friday, August 9, 2013 12:43 PM
> *Subject:* Re: sj:tabbedpanel javascript
>
> Use the "View Source" feature in your browser to see what's being
> generated, then you should be able to see for yourself how to use
> JavaScript to interact with the on-screen components.
>   (*Chris*)
>
>
> On Fri, Aug 9, 2013 at 10:25 AM, john lee  wrote:
>
>
> try to using javascript to set sj:tabbedpanel's attribute, but not working
>
> what is the correct format for access attribute sj:tabbedpanel's
> atrtribute in javascript?
>
> thanks in advance
>
> John
>
>
>
> 
>
> function setpartmoreinfo(id) {
>         $("#Cross").tabs( "option", "partmoreinfo_id", id);
>       }
> 
>
> change display
>
>  
>        
>        
>        
>         Accessories here 
>         Replacement Parts here 
>         Cross Reference here 
>   
>
>
>
>
>

Re: sj:tabbedpanel javascript

2013-08-09 Thread john lee
thanks for reply,
 
i did view source before ask question here, but sj:tabbedpanel convert into 
jquery, even view source, still not match.
 
john
 


 From: Chris Pratt 
To: Struts Users Mailing List ; john lee 
 
Sent: Friday, August 9, 2013 12:43 PM
Subject: Re: sj:tabbedpanel javascript
  


Use the "View Source" feature in your browser to see what's being generated, 
then you should be able to see for yourself how to use JavaScript to interact 
with the on-screen components.
  (*Chris*) 



On Fri, Aug 9, 2013 at 10:25 AM, john lee  wrote:

 
>try to using javascript to set sj:tabbedpanel's attribute, but not working
> 
>what is the correct format for access attribute sj:tabbedpanel's atrtribute in 
>javascript?
> 
>thanks in advance
> 
>John
> 
> 
> 
>
> 
>function setpartmoreinfo(id) {
>    $("#Cross").tabs( "option", "partmoreinfo_id", id); 
>  }
>
> 
>change display
> 
> 
>   
>   
>   
>    Accessories here 
>    Replacement Parts here 
>    Cross Reference here 
>  

sj:tabbedpanel javascript

2013-08-09 Thread john lee
 
try to using javascript to set sj:tabbedpanel's attribute, but not working
 
what is the correct format for access attribute sj:tabbedpanel's atrtribute in 
javascript?
 
thanks in advance
 
John
 
 
 

 
function setpartmoreinfo(id) {
    $("#Cross").tabs( "option", "partmoreinfo_id", id); 
  }

 
change display
 
 
   
   
   
    Accessories here 
    Replacement Parts here 
    Cross Reference here 
  

Re: [struts 2] java.io.FileNotFoundException: http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd

2013-08-07 Thread John Boyer
Hi Srikanth:

That fixed it. Thank you!

John

On Aug 7, 2013, at 10:41 AM, Sreekanth S. Nair 
 wrote:

> use this
> 
>"-//Apache Struts//XWork Validator 1.0.2//EN"
>   "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd";>
> 
> 
> -- 
> Regards
> Srikanth
> 
> On Wed, Aug 7, 2013 at 11:06 PM, John Boyer  wrote:
> 
>> Hi Martin:
>> 
>> Okay, but my validation XML is pointing to
>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd, which is no
>> longer available. What should it point to now?
>> 
>> Thanks, John
>> 
>> ---
>> 
>> > 1.0.2//EN"
>>   "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>
>> 
>> 
>>
>>
>>Password is required
>>
>>
>> 
>>
>>
>>8
>>Password must be eight characters or
>> more.
>>
>>
>> 
>>
>>
>>Password is required
>>    
>>
>> 
>>
>>
>>8
>>Password must be eight characters or
>> more.
>>
>>
>> 
>> 
>> 
>> On Aug 7, 2013, at 10:30 AM, Martin Gainty  wrote:
>> 
>>> Hi John
>>> 
>>> xwork-validator-1.0.2.dtd *should* be in xwork-core-.jar
>>> 
>>> jar -tvf xwork-.jar | grep xwork-validator
>>> 
>>> ?
>>> Martin Gainty
>>> __
>>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>>> 
>>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
>> dient lediglich dem Austausch von Informationen und entfaltet keine
>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>>> 
>>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
>> le destinataire prévu, nous te demandons avec bonté que pour satisfaire
>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
>> de ceci est interdite. Ce message sert à l'information seulement et n'aura
>> pas n'importe quel effet légalement obligatoire. Étant donné que les email
>> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
>> aucune responsabilité pour le contenu fourni.
>>> 
>>> 
>>>> From: j...@rodaxsoft.com
>>>> Subject: [struts 2] java.io.FileNotFoundException:
>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd
>>>> Date: Wed, 7 Aug 2013 10:14:21 -0700
>>>> To: user@struts.apache.org
>>>> 
>>>> Hi:
>>>> 
>>>> Suddenly, in-production, we're getting file-not-found errors for the
>> xwork-validator-1.0.2.dtd at  http://www.opensymphony.com/xwork.
>>>> 
>>>> How can resolve this problem? We're running Struts 2 v2.3.4.1
>>>> 
>>>> Thanks, John
>>>> 
>>>> -
>>>> 
>>>> 10:01:18 ERROR http-8443-1
>> com.opensymphony.xwork2.validator.AnnotationActionValidatorManager - Caught
>> exception while loading file XXX-validation.xml
>>>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd - Class:
>> sun.net.www.protocol.http.HttpURLConnection
>>>> File: HttpURLConnection.java
>>>> Method: getInputStream
>>>> Line: 1311 - sun/net/www/protocol/http/HttpURLConnection.java:1311:-1
>>>> ceptor.intercept(I18nInterceptor.java:176)
>>>> ...
>>>> 
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>>>> at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>>>> at java.lang.Thread.run(Thread.java:619)
>>>> Caused by: java.io.FileNotFoundException:
>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd
>>>> ...
>>>> 
>>>> 
>>>> 
>>>> -
>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>> 
>>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
>> 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [struts 2] java.io.FileNotFoundException: http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd

2013-08-07 Thread John Boyer
Hi Martin:

Okay, but my validation XML is pointing to 
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd, which is no longer 
available. What should it point to now?

Thanks, John

---

http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>




Password is required





8
Password must be eight characters or 
more.





Password is required





8
Password must be eight characters or 
more.





On Aug 7, 2013, at 10:30 AM, Martin Gainty  wrote:

> Hi John
> 
> xwork-validator-1.0.2.dtd *should* be in xwork-core-.jar
> 
> jar -tvf xwork-.jar | grep xwork-validator
> 
> ?
> Martin Gainty 
> __ 
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
> 
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> 
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
> 
> 
>> From: j...@rodaxsoft.com
>> Subject: [struts 2] java.io.FileNotFoundException: 
>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd
>> Date: Wed, 7 Aug 2013 10:14:21 -0700
>> To: user@struts.apache.org
>> 
>> Hi:
>> 
>> Suddenly, in-production, we're getting file-not-found errors for the 
>> xwork-validator-1.0.2.dtd at  http://www.opensymphony.com/xwork.
>> 
>> How can resolve this problem? We're running Struts 2 v2.3.4.1
>> 
>> Thanks, John
>> 
>> -
>> 
>> 10:01:18 ERROR http-8443-1 
>> com.opensymphony.xwork2.validator.AnnotationActionValidatorManager - Caught 
>> exception while loading file XXX-validation.xml
>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd - Class: 
>> sun.net.www.protocol.http.HttpURLConnection
>> File: HttpURLConnection.java
>> Method: getInputStream
>> Line: 1311 - sun/net/www/protocol/http/HttpURLConnection.java:1311:-1
>> ceptor.intercept(I18nInterceptor.java:176)
>>  ... 
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
>>  at 
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>>  at java.lang.Thread.run(Thread.java:619)
>> Caused by: java.io.FileNotFoundException: 
>> http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd
>>  ...
>> 
>> 
>> 
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
> 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



[struts 2] java.io.FileNotFoundException: http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd

2013-08-07 Thread John Boyer
Hi:

Suddenly, in-production, we're getting file-not-found errors for the 
xwork-validator-1.0.2.dtd at  http://www.opensymphony.com/xwork.

How can resolve this problem? We're running Struts 2 v2.3.4.1

Thanks, John

-

10:01:18 ERROR http-8443-1 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager - Caught 
exception while loading file XXX-validation.xml
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd - Class: 
sun.net.www.protocol.http.HttpURLConnection
File: HttpURLConnection.java
Method: getInputStream
Line: 1311 - sun/net/www/protocol/http/HttpURLConnection.java:1311:-1
ceptor.intercept(I18nInterceptor.java:176)
... 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.FileNotFoundException: 
http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd
...



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: sj:a json return result question

2013-08-06 Thread john lee
Dave,
 
Thanks your very much, it works very well
 
brw, the book you wrote/published, i had it.
 
john
 
  


 From: Dave Newton 
To: Struts Users Mailing List ; john lee 
 
Sent: Tuesday, August 6, 2013 11:26 AM
Subject: Re: sj:a json return result question
  


Configure your result's `root` to be `sum`, otherwise it will serialize the 
entire action.




On Tue, Aug 6, 2013 at 10:31 AM, john lee  wrote:

 
>Question for Sjquery's   sj:a  tag as the following
> 
>
>        href="%{ajax}"
>    targets="result"
>    > TOTAL # PARTS 
>    
> 
> 
>public class ReportkeyAction extends extends ActionSupport {
>  private int sum;
>  public int getSum() { return sum; }
>  public void setSum(int sum) { this.sum = sum; }
>  public String execute() throws Exception {    sum=310;
>    System.out.println("sum get fired for json, val="+sum);
>    return "success";
>}
>public String getJSON()  throws Exception
>  {
>    System.out.println("json get triggered for json, val="+sum);
>    return execute();
>  }
>}
> 
>the render return result/display is the following
> 
>   TOTAL # PARTS 
>{"JSON":"success","sum":310}
> 
> 
>I only expect result of 310 get returned, why heading info also get returned?
>obvioulsy,  even did not working.
> 
>how can i just display 310 only?
> 
>thanks in advance
> 
>john


-- 

e: davelnew...@gmail.com
m: 908-380-8699 
s: davelnewton_skype
t: @dave_newton
b: Bucky Bits 
g: davelnewton
so: Dave Newton 

sj:a json return result question

2013-08-06 Thread john lee
 
Question for Sjquery's   sj:a  tag as the following
 

     TOTAL # PARTS 
    
 
 
public class ReportkeyAction extends extends ActionSupport {
  private int sum;
  public int getSum() { return sum; }
  public void setSum(int sum) { this.sum = sum; }
  public String execute() throws Exception {    sum=310;
    System.out.println("sum get fired for json, val="+sum);
    return "success";
}
public String getJSON()  throws Exception
  {
    System.out.println("json get triggered for json, val="+sum);
    return execute();
  }
}
 
the render return result/display is the following
 
   TOTAL # PARTS  
{"JSON":"success","sum":310}
 
 
I only expect result of 310 get returned, why heading info also get returned?
obvioulsy,  even did not working.
 
how can i just display 310 only?
 
thanks in advance
 
john

s:select detail question for preselected

2013-08-02 Thread john lee
for following jsp, i can retrieve the data from KeywordcategoryAction for no 
problem,
    the contents of retrieved list is
  Motor
  Electrical
  Temperature
 

    

but, the default value(why) as defined from KeywordcategoryAction did not 
working at all
i change from value="why" to value="%{why}', but still not working,
 
the souce code is at following
 
public class ListValue {
  private String myKey;
  private String myValue;
  /* set/get here */
}
 
public class Keywordcategory0Action {
  
  private List    languageList;
  private List languageObjList;
  private Map languageMap;
  private List    reloadList;
  private String  language;
 ArrayList main_categorys;
 
  /* set/get here */
 
    main_categorys= .../* get return from databsse */
 
    languageList = new ArrayList();
    languageObjList = new ArrayList();
    languageMap = new HashMap();

    for (String m: main_categorys) {
    languageList.add(m);
    languageMap.put(m,m);
    languageObjList.add(new ListValue(m, m));
    }
    reloadList = new ArrayList();
 
    why="Temperature";
 
    return success;
    }
 
public String getJSON()  throws Exception  {    return execute();  }
 
please advise,
 
thanks in advance
 
john

sj:select default value not load

2013-08-02 Thread john lee
 
For struts2 sj:select tag from google
 

    
 
for above jsp file, i can retrieve the data from KeywordcategoryAction for no 
problem
 
but, the default value(why) as defined from KeywordcategoryAction did not 
working at all
 
I try to change from value="why" to value="%{why}", but still not working,
 
the setting inside  KeywordcategoryAction is the following
   ...
    public String getWhy(String why) { return why; }
    public void setWhy(String why) { this.why=why; }
    why="Temperature";
    return success;
 
 
please advise, thanks in advance
 
john

Re: s:property display INTERGER

2013-07-29 Thread john lee
SSCCE ? what u refer to?
 


 From: Dave Newton 
To: john lee  
Cc: Struts Users Mailing List  
Sent: Monday, July 29, 2013 10:04 PM
Subject: Re: s:property display INTERGER
  


Please put an SSCCE on github/equivalent; I'm very skeptical.




On Mon, Jul 29, 2013 at 11:02 PM, john lee  wrote:

No, inside the action, before the return, I do 
> 
>   detailpart.getQty().intValue(), return is 1, /* have value inside */
> 
>thanks for reply, any other thoughts?
>  
>john
>
> 
> From: Dave Newton 
>To: Struts Users Mailing List ; john lee 
> 
>Sent: Monday, July 29, 2013 9:59 PM
>Subject: Re: s:property display INTERGER
> 
>
>
>If it's null, it's null. If there's a value, it will display.
>
>
>
>
>On Mon, Jul 29, 2013 at 10:46 PM, john lee  wrote:
>
> 
>>I have class Part
>> 
>>  class Part {
>>  String pid,
>>  Integer  qty;
>>}
>> 
>>how can I display object/convert inside JSP?
>> 
>>/* if define/set (Part detailpart)  before return */
>> 
>>    /* this is no problem */
>> 
>>how about qty?
>> 
>>I tried the following, but show null
>>   
>> 
>>I tried the following, but nothing either
>>    
>> 
>>so, how to display/convert  object inside value ?
>> 
>>thanks in advance
>> 
>>john
>
>
>-- 
>
>e: davelnew...@gmail.com 
>m: 908-380-8699 
>s: davelnewton_skype
>t: @dave_newton 
>b: Bucky Bits 
>g: davelnewton
>so: Dave Newton 
>
> 
>
>   


-- 

e: davelnew...@gmail.com 
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton 
b: Bucky Bits
g: davelnewton 
so: Dave Newton

Re: s:property display INTERGER

2013-07-29 Thread john lee
No, inside the action, before the return, I do
 
   detailpart.getQty().intValue(), return is 1, /* have value inside */
 
thanks for reply, any other thoughts?
 
john
 


 From: Dave Newton 
To: Struts Users Mailing List ; john lee 
 
Sent: Monday, July 29, 2013 9:59 PM
Subject: Re: s:property display INTERGER
  


If it's null, it's null. If there's a value, it will display.




On Mon, Jul 29, 2013 at 10:46 PM, john lee  wrote:

 
>I have class Part
> 
>  class Part {
>  String pid,
>  Integer  qty;
>}
> 
>how can I display object/convert inside JSP?
> 
>/* if define/set (Part detailpart)  before return */
> 
>    /* this is no problem */
> 
>how about qty?
> 
>I tried the following, but show null
>   
> 
>I tried the following, but nothing either
>    
> 
>so, how to display/convert  object inside value ?
> 
>thanks in advance
> 
>john


-- 

e: davelnew...@gmail.com
m: 908-380-8699 
s: davelnewton_skype
t: @dave_newton
b: Bucky Bits 
g: davelnewton
so: Dave Newton 

s:property display INTERGER

2013-07-29 Thread john lee
 
I have class Part
 
  class Part {
  String pid, 
  Integer  qty;
}
 
how can I display object/convert inside JSP?
 
/* if define/set (Part detailpart)  before return */
 
    /* this is no problem */
 
how about qty?
 
I tried the following, but show null
   
 
I tried the following, but nothing either
    
 
so, how to display/convert  object inside value ?
 
thanks in advance
 
john

struts2 action return to invoker jsp, but jsp value not change

2013-07-27 Thread john lee
 
I have an jsp, called Part.jsp
 
 
 
 
  ..
   
  
 
in the testAction
 
 . have setter/geter method for qty
 
   ...
   qty=99 /* before return force qty=99 */
   ...
   return "input"
 
in struts.xml

    Part.jsp
   
 
after back to same page,
   qty is null
 
do not understand at all. if I redirect to different page, and qty can retrieve 
for no problem at all.
 
does struts can not postback after reset the same variable ?
 
thanks in advance
 
john

s:interator s:div not working

2013-07-21 Thread john lee
 
 
   
   

 
works fine, but I need to use s:div inside the s:iterator, the nightmare happen
 
first of all, after I did research, in order to let DIV works inside 
s:iterator, have to use S:DIV
 
second,  I try to use  inside S:DIV, value not 
trieved, and display:none not work at all
 

function toggle(input) {
    var ele = document.getElementById(input);
    if(ele.style.display == "block") 
    ele.style.display = "none";
 else 
    ele.style.display = "block";
 }




   
 
   " href=javascript:toggle("")>SHOW
 
   
 
      
 

 
the purpose for using s:div inside s:iterator is hide/show "detail"
 
 
please help
 
thanks in advance
 
john

Re: s:url pass arraylist object possible?

2013-07-19 Thread john lee
thanks
 
I think of the way to use session to carry over objects.
 


 From: Dave Newton 
To: Struts Users Mailing List  
Sent: Friday, July 19, 2013 7:27 PM
Subject: Re: s:url pass arraylist object possible?
  

If you convert it yourself, sure. Otherwise you'd need to use the same
indexed format as form fields-all you can send from the browser are strings.
On Jul 19, 2013 5:11 PM, "john lee"  wrote:

>
>
> I have no problem to iterator the arrarylist
>
> 
>
>  <
> 
>
> but if i want to pass arraylist parts back to action, can i do following?
>
>
> 
>                               value="parts" /> 
>  
>              Keyword Process
>
> thanks in advance
>
> john

s:url pass arraylist object possible?

2013-07-19 Thread john lee


I have no problem to iterator the arrarylist



 <


but if i want to pass arraylist parts back to action, can i do following?



                                  
 
             Keyword Process

thanks in advance

john

struts2 jquery plugin

2013-07-12 Thread john lee


the following sample is from Struts2/Jquery plugin sample, and works perfect

in JSP, 
 
in Action

private Map accordion; public String execute() throws Exception 
{ accordion = new HashMap(); accordion.put("Section 1", "sample 
1"); accordion.put("Section 2", "sample 2"); accordion.put("Section 3", "sample 
3"); return SUCCESS; } public Map getAccordion() { return 
accordion; }
The above sample for Struts2/Jquery works great.

but, 

how to escape the contents of 'Section 1" ?
i just try to use string "Section 1,  
google" to replace "Section 1", but render result only display text, but 
not link.
please advise
thanks in advance

john 

Re: struts s:property

2013-07-10 Thread john lee


thanks, it works

the format is 






 From: Dave Newton 
To: Struts Users Mailing List  
Sent: Wednesday, July 10, 2013 10:17 PM
Subject: Re: struts s:property 
 

Escape it. Check out the tag Docs.
On Jul 10, 2013 11:16 PM, "john lee"  wrote:

>
>
>
>
> in my application, the following  newline charactor never happen.
>
>
> 
>
>
> how to let above  take effect?
>
> thanks
>
> john

struts s:property

2013-07-10 Thread john lee




in my application, the following  newline charactor never happen.


  


how to let above  take effect?

thanks

john

struts2 jquery s:div resize feature

2013-07-09 Thread john lee


I wrote an action class to return an image, and display perfect.

http://localhost/ecommerce/ImageAction?imageId=darksouls.jpg


but, when i use struts 2' jquery plugin div resize sample(just copy& paste 
their demo code, but only change action at following.



    
        
    

It return/display garbage char  from image, really have no idea why this 
happen, because regular call 
http://localhost/ecommerce/ImageAction?imageId=darksouls.jpg works perfect.
    
any trick to use s:j:div resize feature?


thanks in advance

john

Re: class has set member, how s:iterator to access it?

2013-07-02 Thread john lee


I use Lucas's suggestion, but still can not get value out

please advise how to get list member of an class from stack.

thanks in advance

john

    
                          
     




 From: john lee 
To: struts support  
Sent: Friday, June 28, 2013 11:15 PM
Subject: class has set member,  how s:iterator to access it?
 

i have an the following 2 class

Part is just parts itself
Partxref is the accesary(component) of part.

    class Part {
                    String  manufacture;
                    String  pid;
                    private Set partxrefs=new HashSet();
                    /* set, get .here */        
            }
   
   Class Partxref {
                          Part  part;
                          int xref_type_code;
                          /* set, gethere */
                          }

  public class PartsearchAction  .. {
              ArrayList parts;
              public void setParts(ArrayList parts) { this.parts=parts; }
              public ArrayList getParts() { return parts; } 
               
   }

in my jsp,  the following works

              
                 
                 

                 
              

but, i try to access partxref  {component(subset) } of parts,  failed.
              
                 

                 

                          
                                  
                          

              
                
Please advise how to make  set member (partxref) of Part  works, thanks in 
advance

john

class has set member, how s:iterator to access it?

2013-06-28 Thread john lee
i have an the following 2 class

Part is just parts itself
Partxref is the accesary(component) of part.

    class Part {
                    String  manufacture;
                    String  pid;
                    private Set partxrefs=new HashSet();
                    /* set, get .here */        
            }
   
   Class Partxref {
                          Part  part;
                          int xref_type_code;
                          /* set, gethere */
                          }

  public class PartsearchAction  .. {
              ArrayList parts;
              public void setParts(ArrayList parts) { this.parts=parts; }
              public ArrayList getParts() { return parts; } 
               
   }

in my jsp,  the following works

              
                 
                 

                 
              

but, i try to access partxref  {component(subset) } of parts,  failed.
              
                 

                 

                          
                                  
                          

              
                
Please advise how to make  set member (partxref) of Part  works, thanks in 
advance

john


how to acess sublist of list from s:iterator

2013-06-28 Thread john lee


i have an the following 2 class

Part is just parts itself
Partxref is the accesary(component) of part.

    class Part {
                    String  manufacture;
                    String  pid;
                    private Set partxrefs=new HashSet();
                    /* set, get .here */        
            }
   
   Class Partxref {
                          Part  part;
                          int xref_type_code;
                          /* set, gethere */
                          }

  public class PartsearchAction  .. {
              ArrayList parts;
              public void setParts(ArrayList parts) { this.parts=parts; }
              public ArrayList getParts() { return parts; } 
               
   }

in my jsp,  the following works

              
                 
                 

                 
              

but, i try to access partxref  {component(subset) } of parts,  failed.
              
                 

                 

                          
                                   
                                   
                                  
                          

              
                
Please advise how to make  section works, thanks in advance

john


OGNL s:interator index problem

2013-06-26 Thread john lee


an class

    class SearchInfo {

   String input_part;
   String search_part;
   int current_page=0;
   int total_find=0;
   int total_pages=0;
   int size=20;
   /* set, get  skip */
  }

after search, 

   session.put("searchinfo", searchinfo);

at jsp, 

    returns xxx

     returns 208

       returns 11

       return 1 


at bottom of jsp, i need to provide the page link, such as following

  if current page is 1, the followign will display

    1,2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,15,16,17,18,19

 if current page is 22, the following will display
    2139

so, i use the s:iterator to loop, but never works

    
    
  

But, it never works

for sttut1, i used jsp to implement the above, it is straight forward, but 
struts2's OGNL looks like more complicate.

please advise

thanks in advance

john


Re: multiple form s:fielderror mesg cross over, how to solve?

2013-06-19 Thread john lee
Thanks Chester, 
   the  fieldName attribute is good remind,  that is what i am looking for.



 From: Chester Twomey 
To: Struts Users Mailing List ; john lee 
 
Sent: Wednesday, June 19, 2013 9:02 AM
Subject: Re: multiple form s:fielderror mesg cross over, how to solve?
 

Are you setting the field name attribute for your  tags?
Could you provide a sample of what you are doing in your jsp?

Another possibility is you need to short circuit your validators.

The official docs cover both these topics:
http://struts.apache.org/release/2.3.x/docs/validation.html#Validation-ShortCircuitingValidator
http://struts.apache.org/release/2.3.x/docs/fielderror.html

Please provide some code samples i can look at to help you more.

On Tue, Jun 18, 2013 at 8:56 PM, john lee  wrote:
> i need to have multiple  on single web page,
>
> (at top panel, our site always provide parts search box/)
> (at middle panel,  could have other form  such as checkout section, 
> login section, etc)
>
> when  any single form's validation triggered, then  and 
>  displayed at all form's textfields  place,
>
> how to solve it?
>
> or that is struts 2 bug?
>
> please help
>
> thanks in advance
>
> john



-- 
~Chester

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

multiple form s:fielderror mesg cross over, how to solve?

2013-06-18 Thread john lee
i need to have multiple  on single web page,

(at top panel, our site always provide parts search box/)
(at middle panel,  could have other form  such as checkout section, 
login section, etc)

when  any single form's validation triggered, then  and 
 displayed at all form's textfields  place, 

how to solve it?

or that is struts 2 bug?

please help

thanks in advance

john

multiple s:form cause validation not working, pls help

2013-06-14 Thread john lee


 i need to have multiple  on single web page,

when  any single form's validation triggered, then  and 
 displayed at multiple form's textfields  place, 

how to solve it?

or that is struts 2 bug?

please help

thanks in advance

john

1 page multiple form's fields validation problem

2013-06-14 Thread john lee


for struts 2, 

    1 html page have 2 forms at different panel, each form have its own 
textfield for input and submit button as well.

the problem:
    when 1 form's textfield validation trigger, but error message display at 
both form's texfield place.
   in other words, 
      
      
  can not associate with its embed form, how to solve that?
  is that struts2 bug?

tks in advance

john

*

source code  

    
       
         
         
       
     
 
     
       
         
         
       
     

   for XAction-validation.xml
          
      
         
           true
            
     
    
     

  for YAction-validation.xml
          
      
         
           true
            
     
    
      

Re: how interceptor knowing invoke's class name?

2013-06-09 Thread john lee
tks chris, that is what i want to know



 From: Chris Pratt 
To: Struts Users Mailing List ; john lee 
 
Sent: Sunday, June 9, 2013 9:55 PM
Subject: Re: how interceptor knowing invoke's class name?
 


The interceptor is called by Struts, not by the Action.  But, what I think you 
are really asking is "How can I tell which Action is being processed when an 
Interceptor gets invoked?"  If that's your real question, the answer is:

String name = invocation.getInvocationContext().getName();

  (*Chris*)




On Sun, Jun 9, 2013 at 7:29 PM, john lee  wrote:


>
>
>in struts2 , defined an interceptor, it triggered by Action, my question is
>
>  inside the interceptor class, what is the function call that can tell 
>caller's name, because that interceptor could be triggered by different 
>Action, we need to log the caller's name, but how?
>
>thanks 
>
>john

how interceptor knowing invoke's class name?

2013-06-09 Thread john lee



in struts2 , defined an interceptor, it triggered by Action, my question is

  inside the interceptor class, what is the function call that can tell 
caller's name, because that interceptor could be triggered by different Action, 
we need to log the caller's name, but how?

thanks 

john

struts2 s:button

2013-05-28 Thread john lee


<%@ taglib prefix="s" uri="/struts-tags"%>



  
     
     
  
  
     
     
  



but when test, in the logfile, giving the error

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /PageMenu.jsp (line: 7, column: 5) No tag 
"button" defined in tag library imported with prefix "s"
        at 
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
        at 
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
        at 
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:199)
        at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1215)

i check the reference, s:button is valid, if so, why not receive the error at 
above

please advise 

john

Re: struts2 Intercepter Actioncontext

2013-05-24 Thread john lee
could you give more clue ? tks



 From: Dave Newton 
To: Struts Users Mailing List  
Sent: Friday, May 24, 2013 2:46 PM
Subject: Re: struts2 Intercepter Actioncontext
 

It's a static class.

You may want to brush up on some Java and framework basics before
proceeding too much further-it'll save some time in the long run.

Also note that it's often faster to just try something.

Dave
On May 24, 2013 3:17 PM, "john lee"  wrote:

>
>
> In an cutomized Struts2 Intercepter class,
>
>     public class SecurityVerifySessionIntercepter extends
> AbstractInterceptor
>           ActionContext actionContext = invocation.getInvocationContext();
>           HttpServletRequest request= (HttpServletRequest)
> actionContext.get(StrutsStatics.HTTP_REQUEST);
>           Map session = actionContext.getSession();
>
> the above program works without any problem
>
> however,
>
>    if i want to access WebApplicationContext, i have to get
> ServletActionContext first as the following
>          WebApplicationContext
> context=WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
>    the compile complain can not find ServletActionContext.
>
>    for the regular Struts2 action class extends ActionSupport, then i have
> no problem to get ServletActionContext, but failed in Intercepter.
>
> Question is:
>
>     I already extends AbstractInterceptor for use interceptor, certainly i
> can not extends ActionSupport any more.
>     then how can i access ServletActionContext in the interceptor?
>     without extends Actionsupport, can i get ServletActionContext from
> ActionContext? how to convert?
>
> please advise
>
> john

struts2 Intercepter Actioncontext

2013-05-24 Thread john lee


In an cutomized Struts2 Intercepter class, 

    public class SecurityVerifySessionIntercepter extends AbstractInterceptor
          ActionContext actionContext = invocation.getInvocationContext();
          HttpServletRequest request= (HttpServletRequest) 
actionContext.get(StrutsStatics.HTTP_REQUEST);
          Map session = actionContext.getSession();

the above program works without any problem

however,

   if i want to access WebApplicationContext, i have to get 
ServletActionContext first as the following
         WebApplicationContext 
context=WebApplicationContextUtils.getRequiredWebApplicationContext(ServletActionContext.getServletContext());
   the compile complain can not find ServletActionContext.

   for the regular Struts2 action class extends ActionSupport, then i have no 
problem to get ServletActionContext, but failed in Intercepter.

Question is:
 
    I already extends AbstractInterceptor for use interceptor, certainly i can 
not extends ActionSupport any more.
    then how can i access ServletActionContext in the interceptor?
    without extends Actionsupport, can i get ServletActionContext from 
ActionContext? how to convert?

please advise

john

Re: struts 2 Intercepter ServletRequestAware

2013-05-23 Thread john lee
in the interceptor, 

in order to access ServletActionContext, in the interceptor class, which 
interface should be implement?

tks in advance

john



 From: Chris Pratt 
To: Struts Users Mailing List ; john lee 
 
Sent: Thursday, May 23, 2013 6:25 PM
Subject: Re: struts 2 Intercepter ServletRequestAware
 


ServletActionContext.getRequest().getCookies()
  (*Chris*)



On Thu, May 23, 2013 at 4:20 PM, john lee  wrote:


>
>thanks,
>
>so, how can I access Cookie in the interceptor? as my knowledge, to access 
>cookie, i have to get Servlet first, then get Request object, then access 
>Cookie..
>
>please advise 
>
>
>
>john
>
>
>
> From: Chris Pratt 
>To: Struts Users Mailing List ; john lee 
>
>Sent: Thursday, May 23, 2013 5:02 PM
>
>Subject: Re: struts 2 Intercepter ServletRequestAware
>
>
>You cannot use ServletRequestAware or ServletResponseAware in an
>Interceptor.
>  (*Chris*)
>
>
>On Thu, May 23, 2013 at 2:58 PM, john lee  wrote:
>
>> please explain more, thanks in advance
>>
>>
>> 
>>  From: Dave Newton 
>> To: Struts Users Mailing List 
>> Sent: Thursday, May 23, 2013 4:53 PM
>> Subject: Re: struts 2 Intercepter ServletRequestAware
>>
>>
>> You may have misunderstood what I said.
>>
>> those interfaces are for actions, not interceptors.
>> On May 23, 2013 5:51 PM, "john lee"  wrote:
>>
>> > it is interceptor, the following is struts.xml, (i just not include last
>> > time)
>> >
>> > 
>> >  
>> >
>> >         
>> >              > > class="SecurityVerifySessionIntercepter">
>> >              
>> >              
>> >                
>> >              
>> >         
>> >
>> >           
>> >                     
>> >                     PageLogin.jsp
>> >                     PageMain.jsp
>> >        
>> >
>> > 
>> >
>> >
>> >
>> > 
>> >  From: Dave Newton 
>> > To: Struts Users Mailing List 
>> > Sent: Thursday, May 23, 2013 4:31 PM
>> > Subject: Re: struts 2 Intercepter ServletRequestAware
>> >
>> >
>> > That interface is for actions, not interceptors.
>> > On May 23, 2013 5:30 PM, "john lee"  wrote:
>> >
>> > > Please advise the following
>> > >
>> > > for struts2, for an login action, an predefined interceptor is
>> triggered
>> > > for checking cookie , the code is the following
>> > >
>> > > for  SecurityVerifySessionIntercepter, i implement the
>> > > ServletRequestAware, but get null catached.
>> > >
>> > > my question is:
>> > >
>> > > for intercepter, Request object can not be implemented? if can, why i
>> get
>> > > null?
>> > >
>> > > thanks in advance
>> > >
>> > > john
>> > >
>> > >
>> > >
>> > > public class SecurityVerifySessionIntercepter extends
>> AbstractInterceptor
>> > > implements ServletResponseAware, ServletRequestAware {
>> > >
>> > >
>> > >     protected HttpServletResponse servletResponse;
>> > >     public void setServletResponse(HttpServletResponse servletResponse)
>> > >               { this.servletResponse = servletResponse; }
>> > >
>> > >     protected HttpServletRequest servletRequest;
>> > >     public void setServletRequest(HttpServletRequest servletRequest) {
>> > > this.servletRequest = servletRequest; }
>> > >
>> > > public String intercept(ActionInvocation invocation) throws Exception {
>> > >
>> > >        ActionContext ctx=invocation.getInvocationContext();
>> > >       Map session= ctx.getContext().getSession();
>> > >
>> > >          if (servletRequest==null)
>> > >              System.out.println(" Request object is null catched");
>> > >           Cookie cookieList[]=servletRequest.getCookies();
>> > >
>>

Re: struts 2 Intercepter ServletRequestAware

2013-05-23 Thread john lee
because if cookie exist, then interceptor can catch it and assign the session 
object if user open the new webpage.





 From: "jlm...@gmail.com" 
To: Struts Users Mailing List ; john lee 
 
Sent: Thursday, May 23, 2013 6:25 PM
Subject: Re: struts 2 Intercepter ServletRequestAware
 

You need to access the request directly. But why do you want to use a cookie in 
an interceptor?
Sent via BlackBerry from T-Mobile

-Original Message-----
From: john lee 
Date: Thu, 23 May 2013 16:20:08 
To: Struts Users Mailing List
Reply-To: "Struts Users Mailing List" 
Subject: Re: struts 2 Intercepter ServletRequestAware



thanks,

so, how can I access Cookie in the interceptor? as my knowledge, to access 
cookie, i have to get Servlet first, then get Request object, then access 
Cookie..

please advise 



john


From: Chris Pratt 
To: Struts Users Mailing List ; john lee 
 
Sent: Thursday, May 23, 2013 5:02 PM
Subject: Re: struts 2 Intercepter ServletRequestAware


You cannot use ServletRequestAware or ServletResponseAware in an
Interceptor.
  (*Chris*)


On Thu, May 23, 2013 at 2:58 PM, john lee  wrote:

> please explain more, thanks in advance
>
>
> 
>  From: Dave Newton 
> To: Struts Users Mailing List 
> Sent: Thursday, May 23, 2013 4:53 PM
> Subject: Re: struts 2 Intercepter ServletRequestAware
>
>
> You may have misunderstood what I said.
>
> those interfaces are for actions, not interceptors.
> On May 23, 2013 5:51 PM, "john lee"  wrote:
>
> > it is interceptor, the following is struts.xml, (i just not include last
> > time)
> >
> > 
> >  
> >
> >         
> >               > class="SecurityVerifySessionIntercepter">
> >              
> >              
> >                
> >              
> >         
> >
> >           
> >                     
> >                     PageLogin.jsp
> >                     PageMain.jsp
> >        
> >
> > 
> >
> >
> >
> > 
> >  From: Dave Newton 
> > To: Struts Users Mailing List 
> > Sent: Thursday, May 23, 2013 4:31 PM
> > Subject: Re: struts 2 Intercepter ServletRequestAware
> >
> >
> > That interface is for actions, not interceptors.
> > On May 23, 2013 5:30 PM, "john lee"  wrote:
> >
> > > Please advise the following
> > >
> > > for struts2, for an login action, an predefined interceptor is
> triggered
> > > for checking cookie , the code is the following
> > >
> > > for  SecurityVerifySessionIntercepter, i implement the
> > > ServletRequestAware, but get null catached.
> > >
> > > my question is:
> > >
> > > for intercepter, Request object can not be implemented? if can, why i
> get
> > > null?
> > >
> > > thanks in advance
> > >
> > > john
> > >
> > >
> > >
> > > public class SecurityVerifySessionIntercepter extends
> AbstractInterceptor
> > > implements ServletResponseAware, ServletRequestAware {
> > >
> > >
> > >     protected HttpServletResponse servletResponse;
> > >     public void setServletResponse(HttpServletResponse servletResponse)
> > >               { this.servletResponse = servletResponse; }
> > >
> > >     protected HttpServletRequest servletRequest;
> > >     public void setServletRequest(HttpServletRequest servletRequest) {
> > > this.servletRequest = servletRequest; }
> > >
> > > public String intercept(ActionInvocation invocation) throws Exception {
> > >
> > >        ActionContext ctx=invocation.getInvocationContext();
> > >       Map session= ctx.getContext().getSession();
> > >
> > >          if (servletRequest==null)
> > >              System.out.println(" Request object is null catched");
> > >           Cookie cookieList[]=servletRequest.getCookies();
> > >
>

Re: struts 2 Intercepter ServletRequestAware

2013-05-23 Thread john lee


thanks,

so, how can I access Cookie in the interceptor? as my knowledge, to access 
cookie, i have to get Servlet first, then get Request object, then access 
Cookie..

please advise 



john


 From: Chris Pratt 
To: Struts Users Mailing List ; john lee 
 
Sent: Thursday, May 23, 2013 5:02 PM
Subject: Re: struts 2 Intercepter ServletRequestAware
 

You cannot use ServletRequestAware or ServletResponseAware in an
Interceptor.
  (*Chris*)


On Thu, May 23, 2013 at 2:58 PM, john lee  wrote:

> please explain more, thanks in advance
>
>
> 
>  From: Dave Newton 
> To: Struts Users Mailing List 
> Sent: Thursday, May 23, 2013 4:53 PM
> Subject: Re: struts 2 Intercepter ServletRequestAware
>
>
> You may have misunderstood what I said.
>
> those interfaces are for actions, not interceptors.
> On May 23, 2013 5:51 PM, "john lee"  wrote:
>
> > it is interceptor, the following is struts.xml, (i just not include last
> > time)
> >
> > 
> >  
> >
> >         
> >               > class="SecurityVerifySessionIntercepter">
> >              
> >              
> >                
> >              
> >         
> >
> >           
> >                     
> >                     PageLogin.jsp
> >                     PageMain.jsp
> >        
> >
> > 
> >
> >
> >
> > 
> >  From: Dave Newton 
> > To: Struts Users Mailing List 
> > Sent: Thursday, May 23, 2013 4:31 PM
> > Subject: Re: struts 2 Intercepter ServletRequestAware
> >
> >
> > That interface is for actions, not interceptors.
> > On May 23, 2013 5:30 PM, "john lee"  wrote:
> >
> > > Please advise the following
> > >
> > > for struts2, for an login action, an predefined interceptor is
> triggered
> > > for checking cookie , the code is the following
> > >
> > > for  SecurityVerifySessionIntercepter, i implement the
> > > ServletRequestAware, but get null catached.
> > >
> > > my question is:
> > >
> > > for intercepter, Request object can not be implemented? if can, why i
> get
> > > null?
> > >
> > > thanks in advance
> > >
> > > john
> > >
> > >
> > >
> > > public class SecurityVerifySessionIntercepter extends
> AbstractInterceptor
> > > implements ServletResponseAware, ServletRequestAware {
> > >
> > >
> > >     protected HttpServletResponse servletResponse;
> > >     public void setServletResponse(HttpServletResponse servletResponse)
> > >               { this.servletResponse = servletResponse; }
> > >
> > >     protected HttpServletRequest servletRequest;
> > >     public void setServletRequest(HttpServletRequest servletRequest) {
> > > this.servletRequest = servletRequest; }
> > >
> > > public String intercept(ActionInvocation invocation) throws Exception {
> > >
> > >        ActionContext ctx=invocation.getInvocationContext();
> > >       Map session= ctx.getContext().getSession();
> > >
> > >          if (servletRequest==null)
> > >              System.out.println(" Request object is null catched");
> > >           Cookie cookieList[]=servletRequest.getCookies();
> > >
>

Re: struts 2 Intercepter ServletRequestAware

2013-05-23 Thread john lee
please explain more, thanks in advance 



 From: Dave Newton 
To: Struts Users Mailing List  
Sent: Thursday, May 23, 2013 4:53 PM
Subject: Re: struts 2 Intercepter ServletRequestAware
 

You may have misunderstood what I said.

those interfaces are for actions, not interceptors.
On May 23, 2013 5:51 PM, "john lee"  wrote:

> it is interceptor, the following is struts.xml, (i just not include last
> time)
>
> 
>  
>
>         
>               class="SecurityVerifySessionIntercepter">
>              
>              
>                
>              
>         
>
>           
>                     
>                     PageLogin.jsp
>                     PageMain.jsp
>        
>
> 
>
>
>
> 
>  From: Dave Newton 
> To: Struts Users Mailing List 
> Sent: Thursday, May 23, 2013 4:31 PM
> Subject: Re: struts 2 Intercepter ServletRequestAware
>
>
> That interface is for actions, not interceptors.
> On May 23, 2013 5:30 PM, "john lee"  wrote:
>
> > Please advise the following
> >
> > for struts2, for an login action, an predefined interceptor is triggered
> > for checking cookie , the code is the following
> >
> > for  SecurityVerifySessionIntercepter, i implement the
> > ServletRequestAware, but get null catached.
> >
> > my question is:
> >
> > for intercepter, Request object can not be implemented? if can, why i get
> > null?
> >
> > thanks in advance
> >
> > john
> >
> >
> >
> > public class SecurityVerifySessionIntercepter extends AbstractInterceptor
> > implements ServletResponseAware, ServletRequestAware {
> >
> >
> >     protected HttpServletResponse servletResponse;
> >     public void setServletResponse(HttpServletResponse servletResponse)
> >               { this.servletResponse = servletResponse; }
> >
> >     protected HttpServletRequest servletRequest;
> >     public void setServletRequest(HttpServletRequest servletRequest) {
> > this.servletRequest = servletRequest; }
> >
> > public String intercept(ActionInvocation invocation) throws Exception {
> >
> >        ActionContext ctx=invocation.getInvocationContext();
> >       Map session= ctx.getContext().getSession();
> >
> >          if (servletRequest==null)
> >              System.out.println(" Request object is null catched");
> >           Cookie cookieList[]=servletRequest.getCookies();
> >

Re: struts 2 Intercepter ServletRequestAware

2013-05-23 Thread john lee
it is interceptor, the following is struts.xml, (i just not include last time)


 

        
             
             
                
               
             
        
        
          
                    
                    PageLogin.jsp
                    PageMain.jsp
       


                   



 From: Dave Newton 
To: Struts Users Mailing List  
Sent: Thursday, May 23, 2013 4:31 PM
Subject: Re: struts 2 Intercepter ServletRequestAware
 

That interface is for actions, not interceptors.
On May 23, 2013 5:30 PM, "john lee"  wrote:

> Please advise the following
>
> for struts2, for an login action, an predefined interceptor is triggered
> for checking cookie , the code is the following
>
> for  SecurityVerifySessionIntercepter, i implement the
> ServletRequestAware, but get null catached.
>
> my question is:
>
> for intercepter, Request object can not be implemented? if can, why i get
> null?
>
> thanks in advance
>
> john
>
>
>
> public class SecurityVerifySessionIntercepter extends AbstractInterceptor
> implements ServletResponseAware, ServletRequestAware {
>
>
>     protected HttpServletResponse servletResponse;
>     public void setServletResponse(HttpServletResponse servletResponse)
>               { this.servletResponse = servletResponse; }
>
>     protected HttpServletRequest servletRequest;
>     public void setServletRequest(HttpServletRequest servletRequest) {
> this.servletRequest = servletRequest; }
>
> public String intercept(ActionInvocation invocation) throws Exception {
>
>        ActionContext ctx=invocation.getInvocationContext();
>       Map session= ctx.getContext().getSession();
>
>          if (servletRequest==null)
>              System.out.println(" Request object is null catched");
>           Cookie cookieList[]=servletRequest.getCookies();
>

struts 2 Intercepter ServletRequestAware

2013-05-23 Thread john lee
Please advise the following

for struts2, for an login action, an predefined interceptor is triggered for 
checking cookie , the code is the following

for  SecurityVerifySessionIntercepter, i implement the ServletRequestAware, but 
get null catached.

my question is:

for intercepter, Request object can not be implemented? if can, why i get null? 

thanks in advance

john 



public class SecurityVerifySessionIntercepter extends AbstractInterceptor 
implements ServletResponseAware, ServletRequestAware {

    
    protected HttpServletResponse servletResponse;
    public void setServletResponse(HttpServletResponse servletResponse)
              { this.servletResponse = servletResponse; }

    protected HttpServletRequest servletRequest;
    public void setServletRequest(HttpServletRequest servletRequest) { 
this.servletRequest = servletRequest; }

public String intercept(ActionInvocation invocation) throws Exception {

       ActionContext ctx=invocation.getInvocationContext();
      Map session= ctx.getContext().getSession();
      
         if (servletRequest==null)
             System.out.println(" Request object is null catched");
          Cookie cookieList[]=servletRequest.getCookies();


Re: Cookie in struts2

2013-05-15 Thread john lee
thanks, in my program, after i import it, the compile error is gone.




 From: Chris Pratt 
To: Struts Users Mailing List  
Cc: john lee  
Sent: Wednesday, May 15, 2013 4:54 PM
Subject: Re: Cookie in struts2
 


Ah, my bad, you are correct, Dave.

John, like Dave pointed out, you should be using:

import javax.servlet.Cookie;

Cookie[] cookieList = ServletActionContext.getRequest().getCookies();

  (*Chris*)



On Wed, May 15, 2013 at 2:41 PM, Dave Newton  wrote:

(With the caveat that the interface is really for actions, while the OP
>seems to be working inside an interceptor.)
>
>Dave
>
>
>
>On Wed, May 15, 2013 at 5:25 PM, Chris Pratt wrote:
>
>
>> You might want to look into the CookiesAware interface.  It's a better way
>> of accessing cookies.  Here's a good post on handling Cookies in Struts 2:
>> http://omkarp.blogspot.com/2007/07/working-with-cookies-in-struts2.html
>>   (*Chris*)
>>
>>
>> On Wed, May 15, 2013 at 2:14 PM, Dave Newton 
>> wrote:
>>
>> > Import the Cookie class, and get the cookies from the request, not the
>> > class of the request?
>> >
>> > Dave
>> >
>> >
>> >
>> > On Wed, May 15, 2013 at 4:56 PM, john lee 
>> wrote:
>> >
>> > >
>> > >
>> > > I have no difficulty to handle cookie in struts 1, but have lots of
>> error
>> > > in struts 2
>> > >
>> > > i have the following program
>> > >
>> > >
>> > > public class SecurityVerifySessionIntercepter extends
>> AbstractInterceptor
>> > > implements ServletResponseAware, ServletRequestAware {
>> > > 
>> > >
>> > > Map session= ActionContext.getContext().getSession();
>> > >
>> > >
>> > > Cookie cookieList[]=HttpServletRequest.getCookies();
>> > >
>> > > for above program, the compiler give so much error about cookie.
>> > >
>> > >
>> > > cannot find symbol
>> > > symbol  : class Cookie
>> > > location: class SecurityVerifySessionIntercepter
>> > >           Cookie cookieList[]=HttpServletRequest.getCookies();
>> > >
>> > >
>> > > non-static method getCookies() cannot be referenced from a static
>> context
>> > >           Cookie cookieList[]=HttpServletRequest.getCookies();
>> > >
>> > >
>> > >
>> > > please advise
>> > >
>> > > thanks in advance
>> > >
>> > > john
>> >
>> >
>> >
>> >
>> > --
>> > e: davelnew...@gmail.com
>> > m: 908-380-8699
>> > s: davelnewton_skype
>> > t: @dave_newton <https://twitter.com/dave_newton>
>> > b: Bucky Bits <http://buckybits.blogspot.com/>
>> > g: davelnewton <https://github.com/davelnewton>
>> > so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>> >
>>
>
>
>
>--
>e: davelnew...@gmail.com
>m: 908-380-8699
>s: davelnewton_skype
>t: @dave_newton <https://twitter.com/dave_newton>
>b: Bucky Bits <http://buckybits.blogspot.com/>
>g: davelnewton <https://github.com/davelnewton>
>so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>

return Action.LoginAction;

2013-05-15 Thread john lee


for struts 2, 

  

   i follow the example from the web to use 'Action.x'  (xxx is actual 
action name), but the compile report the following error


cannot find symbol
symbol  : variable Action
location: class SecurityVerifySessionIntercepter
  return Action.LoginAction;  

which library i should include to use the global variable of Action ?

thanks in advance

john



import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import javax.servlet.http.Cookie;
import com.opensymphony.xwork2.ActionSupport;

public class SecurityVerifySessionIntercepter extends AbstractInterceptor 
implements ServletResponseAware, ServletRequestAware {
..

}

Cookie in struts2

2013-05-15 Thread john lee


I have no difficulty to handle cookie in struts 1, but have lots of error in 
struts 2

i have the following program


public class SecurityVerifySessionIntercepter extends AbstractInterceptor 
implements ServletResponseAware, ServletRequestAware {


Map session= ActionContext.getContext().getSession();


Cookie cookieList[]=HttpServletRequest.getCookies();

for above program, the compiler give so much error about cookie.


cannot find symbol
symbol  : class Cookie
location: class SecurityVerifySessionIntercepter
  Cookie cookieList[]=HttpServletRequest.getCookies();


non-static method getCookies() cannot be referenced from a static context
  Cookie cookieList[]=HttpServletRequest.getCookies();



please advise

thanks in advance

john

Re: struts 2 ajax choice

2013-05-13 Thread john lee
Dave,

so, as your experience, which one u recommend to use?

JSON or S2Jquery?

thanks in advance

john  




 From: Dave Newton 
To: Struts Users Mailing List  
Cc: john lee  
Sent: Monday, May 13, 2013 5:03 PM
Subject: Re: struts 2 ajax choice
 







On Mon, May 13, 2013 at 5:56 PM, Mike Hao  wrote:

Will the S2 jQuery plugin provide the similar functions as S2 dojo plugin?
>

The docs and examples are available on the site I linked to.
 

Is S2 jQuery plugin maintained by Struts 2 team?
 The S2 jQuery plugin I linked to is an independent project that happens to 
have at least one S2 team member on it.


It is *not* an official plugin, but it's quite a bit more recent, and better 
(IMO) than the deprecated Dojo plugin.


Could anyone give me explanation why
>S2 Dojo plugin get deprecated?
>

Because it used a very old version of Dojo and nobody had the interest in 
upgrading and maintaining it.


Dave

Re: struts 2 ajax choice

2013-05-13 Thread john lee


So, JSON is the only choice ?

thanks

john




 From: Paul Benedict 
To: Struts Users Mailing List ; john lee 
 
Sent: Monday, May 13, 2013 4:43 PM
Subject: Re: struts 2 ajax choice
 

Please note the Dojo plugin is deprecated.


On Mon, May 13, 2013 at 4:42 PM, john lee  wrote:

>
>
> from the document,
>
>
> Struts 2 support both DoJo plugin and JSON plugin,
>
>
> which one is easy to plugin and use?
>
>
> which one is more powerful?
>
> thanks in advance
>
> john

struts 2 ajax choice

2013-05-13 Thread john lee


from the document,


Struts 2 support both DoJo plugin and JSON plugin, 


which one is easy to plugin and use?


which one is more powerful?

thanks in advance

john

struts 2 / sitemesh/

2013-05-09 Thread john lee

 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat partsearchinput.jsp

<%@ taglib prefix="s" uri="/struts-tags"%>







the above code works, and verified by 
http://localhost/ecommerce/partsearchinput.jsp

but, after i start to use sitemesh, it has the problem as the following

The Struts dispatcher cannot be found.  This is usually caused by using Struts 
tags without the associated filter. Struts tags are only usable when the 
request has passed through its servlet filter, which initializes the Struts 
dispatcher needed for this tag. - [unknown location]

SEVERE: Unhandled exception occurred whilst decorating page
java.lang.RuntimeException: org.apache.jasper.JasperException: An exception 
occurred processing JSP page /partsearchinput.jsp at line 6
3:
4: <%@ taglib prefix="s" uri="/struts-tags"%>
5:
6: 
7: 
8: 
9: 



alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF # cat web.xml


struts2
  
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

   
   sitemesh 
  com.opensymphony.sitemesh.webapp.SiteMeshFilter
    
 
 
    sitemesh 
 /*
 FORWARD   
 REQUEST 

**
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/decorators # cat 
basic-theme.jsp

 <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator"; 
prefix="decorator" %>
 
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator"; 
prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page"; prefix="page"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
 
    
 
     
 <%@ include file="/partsearchinput.jsp"%>
   
     
       
   
      Copyright X  
 
 
    
  
***
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF # cat decorators.xml
 
   
    
   /menu.jsp 
   
  
**
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat partsearchinput.jsp

<%@ taglib prefix="s" uri="/struts-tags"%>





***
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat menu.jsp

       
 test
   

struts 2 session question

2013-05-08 Thread john lee
 
for stuts 1, to get session, via the following
 
  session=request.getSession();
  session.setAttribute("PERSON", person);    /* person is object name */
 
for struts 2, to get session, via the following
 
  Map session=ActionContext.getContext().getSession();
  session.put("PERSON", person);/* person is object name */
 
question is
   
    for struts2: if i use the following
  session.setAttribute("PERSON", person);    
    then compile to get following error
    
   cannot find symbol
   symbol  : method 
setAttribute(java.lang.String,neuco.Person)
    location: interface java.util.Map
    session.setAttribute
 
   is that means for struts2, when i use session, i have to use session.put, 
but session.setAttribute is no longer valid?
   what is the difference b/w session.put and session.setAttribute?
 
thanks in advance
 
john

struts 2 presentation layer

2013-03-11 Thread john lee
struts 2 presentation layer


support JSP, freemaker 

as i know.

does it support PHP?

what is the presentation layer it support?

thanks

john




 From: Martin Gainty 
To: Struts Users Mailing List  
Sent: Monday, March 11, 2013 5:33 AM
Subject: RE: struts 2 start problem struts2-gxp-plugin-2.3.7.jar
 
rename struts2-gxp-plugin-2.3.7.jar e.g.

mv 
/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-gxp-plugin-2.3.7.jar
 
/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-gxp-plugin-2.3.7.jar.old

or delete  struts2-gxp-plugin-2.3.7.jar 

stop your session and redeploy usually works BUT i would bounce the server just 
ot make sure you start ecommerce webapp clean

Martin
__ 
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
  


> Date: Sun, 10 Mar 2013 20:32:41 -0700
> From: sh_thorn_b...@yahoo.com
> Subject: struts 2 start problem struts2-gxp-plugin-2.3.7.jar
> To: user@struts.apache.org
> 
> i try to start tomcat, but giving the following error
> 
> Unable to load configuration... struts2-gxp-plugin-2.3.7.jar...
> 
> in the CLASSPTH, i even did not load struts2-gxp-plugin-2.3.7.jar at all, why 
> this happen?
> 
> please advise
> 
> thanks in advance
> 
> john
> 
> 
> SEVERE: Dispatcher initialization failed
> Unable to load configuration. - bean - 
> jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-gxp-plugin-2.3.7.jar!/struts-plugin.xml:8:162
>         at 
>com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:71)
>         at 
>org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
>         at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
>         at 
>org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
>         at 
>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
>         at 
>org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
>         at 
>org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)
>         at 
>org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
>         at 
>org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:104)
>         at 
>org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
>         at 
>org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
>         at 
>org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at 
>org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
>         at 
>org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at 
>java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at 
>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: Unable to load bean: 
> type:org.apache.struts2.views.gxp.inject.InjectedObjectContainer 
> class:org.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - 
> jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-gxp-plugin-2.3.7.jar!/struts-plugin.xml:8:162
>         at 
>com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
>         at 
>org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
>         at 
>com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
>         at 
>com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:68)
>         ... 18 more
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.struts2.views.gxp.inject.InjectedObjectContainer
>         at 
>org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
>         a

struts 2 start problem struts2-gxp-plugin-2.3.7.jar

2013-03-10 Thread john lee
i try to start tomcat, but giving the following error

Unable to load configuration... struts2-gxp-plugin-2.3.7.jar...

in the CLASSPTH, i even did not load struts2-gxp-plugin-2.3.7.jar at all, why 
this happen?

please advise

thanks in advance

john


SEVERE: Dispatcher initialization failed
Unable to load configuration. - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-gxp-plugin-2.3.7.jar!/struts-plugin.xml:8:162
    at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:71)
    at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
    at 
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at 
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
    at 
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)
    at 
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
    at 
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:104)
    at 
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
    at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: Unable to load bean: 
type:org.apache.struts2.views.gxp.inject.InjectedObjectContainer 
class:org.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-gxp-plugin-2.3.7.jar!/struts-plugin.xml:8:162
    at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
    at 
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
    at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
    at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:68)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: 
org.apache.struts2.views.gxp.inject.InjectedObjectContainer
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at 
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
    at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
    ... 21 more


alpha:/var/apache-tomcat-7.0.34/logs # env  |grep CLASSPATH

CLASSPATH=/usr/java/jdk1.6.0/lib/dt.jar:/usr/java/jdk1.6.0/lib/tools.jar:/var/apache-tomcat-7.0.34/lib:/var/apache-tomcat-7.0.34/lib/jsp-api.jar:/var/apache-tomcat-7.0.34/lib/servlet-api.jar:/var/apache-tomcat-7.0.34/lib/mysql-connector-java-5.0.5-bin.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/c3p0-0.9.2-pre8.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-fileupload-1.2.2.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-io-2.0.1.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-lang-2.4.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-lang3-3.1.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-logging-1.1.1.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-logging-api-1.1.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/commons-validator-1.3.1.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/json-lib-2.3
-jdk15.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/ognl-3.0.5.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-core-2.3.7.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/freemarker-2.3.19.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/xwork-core-2.3.7.jar:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/javassist-3.11.0.GA.jar

alpha:/var/apache-tomcat-7.0.34

struts 2 session share

2013-03-10 Thread john lee


after user login our e-commerce site successfuly, he was granted an session.

his shopping cart is saved into an session object.

sometimes, customer need help for his shopping cart, in order to do that, we 
need to access his cart/session object.

how can we do session share in struts2 ? in other words,we need to save 
sth(such as the accessary parts)  in his shopping cart..


any example?

thanks in advance

john  

Re: struts 2 validation if use with spring

2013-03-08 Thread john lee
Luckasz, 


thanks for your great help, 


i just checked your demo, looks like the first tricky is to define proxy action 
name signin in struts.xml


struts.xml


  /example/Login.jsp
  Welcome
    



and second tricky to define signin method in the file LoginAction.java


LoinAction.java
...

public String signin() {
    return SUCCESS;
    }
...



my question next is:

why can not use  Login-validation.xml directly ? but have to use your "proxy 
method" to work around?

is this the only way to lett struts2/spring validation works?

thanks so much in advance

john







 From: Lukasz Lenart 
To: Struts Users Mailing List ; john lee 
 
Sent: Friday, March 8, 2013 7:27 AM
Subject: Re: struts 2 validation if use with spring
 
2013/3/8 john lee :
> Lukasz,
>
> thanks for your help, i just tried, but still not works
>
> any other suggestion?

I have prepared a small demo app
https://github.com/lukaszlenart/struts2-spring-validation


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Re: struts 2 validation if use with spring

2013-03-08 Thread john lee
Lukasz,

thanks for your help, i just tried, but still not works

any other suggestion?

thanks in advance

john





 From: Lukasz Lenart 
To: Struts Users Mailing List  
Sent: Friday, March 8, 2013 12:01 AM
Subject: Re: struts 2 validation if use with spring
 
2013/3/8 john lee :
>                  

As specified in the docs [1][2], validation file name must match schema:

class-name-validation.xml -> LoginAction-signin-validation.xml

[1] 
http://struts.apache.org/development/2.x/docs/validation.html#Validation-DefiningValidationRules
[2] 
http://struts.apache.org/development/2.x/docs/struts-2-spring-2-jpa-ajax.html


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

struts 2 validation if use with spring

2013-03-07 Thread john lee




Problem
 
I use struts2/spring 3 as integration, and need to use struts2
validation.xml as well, 
Basically, the action name in the login.jsp/struts.xml  is pseudo class name, 
but is implemented in
the applicationContext.xml
In order to let validation.xml works, I defined  all the possible 
XXXvalidation.xml for both matched
psesuo action class name and actually class name, but looks like no one works.
Is XXXvalidation.xml only works for struts2 actual class
name only? But not works if used in struts2/spring proxy action forward?
Pelase   advise.
 
john
 
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat
login.jsp

<%@ taglib prefix="s"
uri="/struts-tags"%>





  
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF
# cat applicationContext.xml
……
 


 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes
# cat struts.xml

http://struts.apache.org/dtds/struts-2.0.dtd";>   

    
 
    success.jsp
    login.jsp
     
 
 
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/src/neuco
# cat AcctAction.java

package neuco;
public class AcctAction extends
ActionSupport {
  private
String loginId;
  private String password;
  public void setLoginId(String loginId) { this.loginId=loginId; }
  public void setPassword(String password) { this.password=password; }
  public String getLoginId() { return loginId; }
  public String getPassword() { return password; }
 
     public String execute() throws
Exception {
  Map
session=ActionContext.getContext().getSession();
      if (login.equals("test" ) ) {
   session.put("loginid",login_return);
   addActionMessage("Login
Success");
   return "success";
   }
    else
   addActionError("loginid/password
not match");
    return "error";
  }  
 
}   
 
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes
# cat  Signin-Validation.xml

http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd";>
 
  
 
    true 
      
 
    
   
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes
# ls *Validation.xml
AcctAction-Validation.xml  LoginAction-Validation.xml  Signin-Validation.xml
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes/neuco
# ls *Validation.xml
AcctAction-Validation.xml  LoginAction-Validation.xml  Signin-Validation.xml

struts 2 validation error

2013-03-06 Thread john lee


please advise


thanks in advance

john


**

error:

Template processing error: "Method public java.util.List 
org.apache.struts2.components.Form.getValidators(java.lang.String) threw an 
exception when invoked on org.apache.struts2.components.Form@d6147e"

Method public java.util.List 
org.apache.struts2.components.Form.getValidators(java.lang.String) threw an 
exception when invoked on org.apache.struts2.components.Form@d6147e
The problematic instruction:
--
==> list tag.getValidators("${tagName}") as validator [on line 46, column 9 in 
template/xhtml/form-close-validate.ftl]
 in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on line 
25, column 1 in template/xhtml/form-close.ftl]
--

Java backtrace for programmers:
--
freemarker.template.TemplateModelException: Method public java.util.List 
org.apache.struts2.components.Form.getValidators(java.lang.String) threw an 
exception when invoked on org.apache.struts2.components.Form@d6147e
    at 
freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
    at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)


*



alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat login.jsp

<%@ taglib prefix="s" uri="/struts-tags"%>
   







*
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes # cat 
struts.xml


http://struts.apache.org/dtds/struts-2.0.dtd";>
   

  
   
 
    
    success.jsp
    login.jsp
    
 
 



*

alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes # cat 
signin-valition.xml
http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd";>

 
  
 
    true 
      
 
    


Struts 2 -> java.lang.ClassNotFoundException

2013-03-05 Thread john lee





I use struts at 
webserver, and create proxy action , that proxy action forward to 
spring, but when executed result is the following 
 
please advise
 
thanks in advance
 
john
 
[CODE]
Struts Problem Report
Struts has detected an unhandled exception: 
Messages: loginAction 
Invalid action class configuration that references an unknown class named 
[loginAction] 
Stacktraces
java.lang.RuntimeException: Invalid action class configuration that references 
an unknown class named [loginAction] 
java.lang.ClassNotFoundException: loginAction 
[/CODE]
 
[CODE]
  alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat login.jsp






[/CODE]
 
[CODE]
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF # cat web.xml
http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://java.sun.com/xml/ns/javaee"; 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; id="WebApp_ID" version="2.5">

struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter


org.springframework.web.context.ContextLoaderListener


struts2
/*

 
  contextConfigLocation 
  /WEB-INF/applicationContext.xml 
 

[/CODE]

[CODE]
   alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes # cat 
struts.xml
   

  
  
  
  
  
 
    success.jsp
    error.jsp
    
 
[/CODE]
 
 
[CODE]
   alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF # cat 
applicationContext.xml
    

  
  
    
    Acctsecurity.hbm.xml
    
  
      

    



    


    


 

 
  
 
 
  


   
   


[/CODE]
 
[CODE]
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes/neuco # ls 
*.class
AcctAction.class   AcctManagerImpl.class  AcctsecurityDao.class
AcctManager.class  Acctsecurity.class AcctsecurityDaoHibernate.class
[/CODE] 


struts2/spring Parameter is on the excludeParams list of patterns!

2013-03-03 Thread john lee




The input 
   http://localhost:8080/ecommerce/login.jsp

The Output
    login is succcese Sun Mar 03
01:01:16 CST 2013

problem
 

   
login.jsp->loginAction->struts.xml->applicationContext.xml->loginAction->neuco.AcctAction->inject
  acctsmgr-….-> 
 
  but  in the AcctAction.java, 
    public String Execute() throws
Exception {neuco.AcctAction
        System.out.println("loginId="+getLoginId()+"\n");
 System.out.println("password="+getPassword()+"\n");
  System.out.println("here\n");


   In the logfile , it should display my input
from login.jsp, but it did not show up at all, instead, shows warning 
    WARNING: Parameter [loginId] is on the
excludeParams list of patterns!
    Mar 3, 2013 12:57:58 PM
com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
   WARNING: Parameter [password] is on the
excludeParams list of patterns!

So, looks like
neuco.AcctAction is not triggered/initiated by spring assmeble, otherwise it
should display debug info, but if not triggered, how come it return “success”
to success.jsp ?
 
Please help
  

 alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce
# cat login.jsp
<%@ taglib prefix="s" uri="/struts-tags"%>







 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce
# cat success.jsp
login is succcese <%= new java.util.Date() %>
 
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes
# cat struts.xml


    
  
     
    success.jsp
    error.jsp
    
 

alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes # cat 
struts.xml
   

  
  
  
    
    success.jsp
    error.jsp
    
 
 



alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF
# cat applicationContext.xml.

.



  
  
        AcctsSecurity.hbm.xml    
  
     

    


    


    


 

 
 
  
 
 
  


   
   



alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/src/neuco # cat 
AcctAction.java
package neuco;


/**   lot of  import *  */

public class AcctAction extends ActionSupport {

  protected AcctManager mgr;
  private String loginId;
  private String password;

  String login_return=null;
 
  public void setMgr(AcctManager mgr) { this.mgr=mgr; }

  public void setLoginId(String loginId) { this.loginId=loginId; }
  public void setPassword(String password) { this.password=password; }
  
  public String getLoginId() { return loginId; }
  public String getPassword() { return password; }

 public String Execute() throws Exception {
    System.out.println("loginId="+getLoginId()+"\n");
    System.out.println("password="+getPassword()+"\n");
    System.out.println("here\n");
    Map session=ActionContext.getContext().getSession();
    login_return=mgr.loginValid(getLoginId(), getPassword());
    if (login_return !=null ) {
   session.put("loginid",login_return);
   addActionMessage("Login Success");
   return SUCCESS;
   }
    else
   addActionError("loginid/password not match");
    return "failure";
  }  

}


  1   2   3   4   5   6   7   >