Re: StackOverflowError

2022-06-14 Thread Martin Gainty
Hi Rubens
Do you see any of these messages

Request {} is excluded from handling by Struts, passing request to other filters
-OR-
Assuming uri {} as a normal action
-OR-
Cannot find mapping for {}, passing to other filters
-OR-
Found mapping {} for {}

will need to see the configuration that Lukasz requested

BR

From: Lukasz Lenart 
Sent: Tuesday, June 14, 2022 2:02 AM
To: Struts Users Mailing List 
Subject: Re: StackOverflowError

Could you share a minimal configuration of this result?

Regards
Łukasz

wt., 14 cze 2022 o 07:23 Rubens Gomes  napisał(a):
>
> I am runnning a Spring Boot 2.7.0 (Latest) Tomcat embedded WAR + Spring 
> Security + Struts 6.0.0 Actions + JSP pages.  I started noticing a loop when 
> a Struts2 Action result type is a "dispatcher" with following repetive stack 
> trace.  Then, a stack overflow is raised.
>
> .. repeated several times ..
> at 
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:637) 
> ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:140)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111)
>  ~[spring-web-5.3.20.jar:5.3.20]
> at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111)
>  ~[spring-web-5.3.20.jar:5.3.20]
> at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:111)
>  ~[spring-web-5.3.20.jar:5.3.20]
> at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:385)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
>  ~[tomcat-embed-core-9.0.63.jar:9.0.63]
> at 
> org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterRequestDispatcher.forward(HeaderWriterFilter.java:170)
>  ~[spring-security-web-5.7.1.jar:5.7.1]
> at 
> org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:169)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:206)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:363)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:280)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:637) 
> ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:140)
>  ~[struts2-core-6.0.0.jar:6.0.0]
> at 
> 

Re: How to implement custom StrutsTypeConverter to convert String to Collection?

2021-08-13 Thread Martin Gainty
Assuming you can locate Struts version which supports CollectionConverter and 
implementor DefaultTypeConverter codebase

You will of course need to code at least one testcase to make sure 
MyStringToCollectionConverter works

Once testcase is coded and works
can you submit MyStringToCollectionConverter and TestCase  as Struts patch to 
CollectionConverter code base?

Thanks Burton!
M-


From: Burton Rhodes 
Sent: Thursday, August 12, 2021 9:07 AM
To: Struts Users Mailing List 
Subject: Re: How to implement custom StrutsTypeConverter to convert String to 
Collection?

Thanks Zahid -
I've spent the better part of a day in the debugger, but ultimately figured
it out.  Essentially, I first needed to use the DefaultTypeConverter to
parse the individual elements, then use the CollectionConverter to place
the elements into the final Collection needed for the Action.  In case
anyone is interested, here is my final code that converts a comma separated
string into a collection using a custom Struts type converter:

/**
 * Converter class to convert comma separated string to a collection
*   (e.g. form input value of "[a,b,c]" -> Set())
 */
public class MyStringToCollectionConverter extends DefaultTypeConverter {

private ObjectTypeDeterminer objectTypeDeterminer;

@Inject
public void setObjectTypeDeterminer(ObjectTypeDeterminer determiner) {
this.objectTypeDeterminer = determiner;
}

@Override
public Object convertValue(Map context, Object target,
Member member, String propertyName, Object value, Class toType) {

// Clean up and parse values into []
String s = ((String[]) value)[0];
String temp = s.replaceAll("[\\[\\]\"']", "");
String[] cleanedValues = Arrays.stream(temp.split(","))
.map(String::trim)
.filter(StringUtils::isNotBlank)
.toArray(String[]::new);

// Convert values into an Object[] of "memberType"
Class memberType =
objectTypeDeterminer.getElementClass(target.getClass(), propertyName, null);
Object[] convertedValues = Arrays.stream(cleanedValues)
.map(val -> convertValue(val, memberType))
.toArray();

// Use CollectionConverter to convert values into the expected
collection
CollectionConverter collectionConverter = new CollectionConverter();
collectionConverter.setObjectTypeDeterminer(objectTypeDeterminer);
return collectionConverter.convertValue(context, target, member,
propertyName, convertedValues, toType);
}
}


On Wed, Aug 11, 2021 at 6:49 PM Zahid Rahman  wrote:

>   > I have a html form input that submits a string value that needs to be
> converted to a java Collection.
>
> To find the bug in logic
> I would  hard code a string which is expected  from html input form.
>
> Using an IDE .
>
> Set a break point there to go into debug mode.
>
> Step through the code one step at a time.
> Watch the string values changes
> In the debug window.
> Then you can see  the  data values change as expected or not at each step.
>
>
>
>
> zahid
>
>
>
> https://www.backbutton.org
>
> ¯\_(ツ)_/¯
> ♡۶♡۶ ♡۶
>
>
> On Wed, 11 Aug 2021, 13:50 Burton Rhodes,  wrote:
>
> > I have a html form input that submits a string value that needs to be
> > converted to a java Collection (a Set object in this case).  Specifically
> > the input key/value is: viewTasksFilter.taskStatuses="[OPEN,COMPLETE]".
> >  In the "viewTaskFilter" object, "taskStatuses" is defined as a Set with
> > enum values (Set taskStatuses).  The custom converter below
> > does convert the input form value to a Set, however it is a Set
> > (not Set).  This is an issue because the Struts Action member
> > variable "viewTasksFilter.taskStatuses" now contains a Set of the wrong
> > type.  Since I will have other variables that need this logic, I would
> > prefer not to hardcode the Set in this converter.  Is there a
> > way to use existing Struts "converter code" to convert the Set to
> > the appropriate Set?  I know the built-in Struts converters
> already
> > do this, but I am unable to figure out how to do this in a custom
> > converter.  Is this possible?  Or is this even the right way to solve
> this
> > issue?  Any help is appreciated!
> >
> >
> > /**
> >  * Converter class to convert comma separated string to a collection
> >  */
> > public class MyStringToCollectionConverter extends StrutsTypeConverter {
> >
> > @Override
> > public Object convertFromString(Map context, String[] values, Class
> > toClass) {
> >
> > String s = values[0];
> > String temp = s.replaceAll("[\\[\\]\"']", "");
> > List cleanedValues = Arrays.stream(temp.split(","))
> > .map(String::trim)
> > .collect(Collectors.toList());
> >
> > if (toClass == Set.class) {
> > try {
> > if (cleanedValues.size() == 0) {
> > return null;
> > 

Re: NPE using OpenSessionBackgroundProcess class

2021-01-26 Thread Martin Gainty
AFAIK Object does not  implement Serializable

is there an object your code can implement for lock object that implements 
Serializable?

m-


From: Burton Rhodes 
Sent: Monday, January 25, 2021 1:52 PM
To: Struts Users Mailing List 
Subject: Re: NPE using OpenSessionBackgroundProcess class

The complete class is below (and also here: https://pastebin.com/Z8QyTRzM).
It extends org.apache.struts2.interceptor.BackgroundProcess which
implements serializable.  Do I need to explicitly implement?  Or do you see
anything else that might be the cause?  Many thanks.

package com.afs.web.common.struts.interceptor;

import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.interceptor.BackgroundProcess;
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
import org.springframework.orm.jpa.EntityManagerHolder;
import
org.springframework.transaction.support.TransactionSynchronizationManager;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

/**
 * Used in conjunction with {@link OpenSessionExecuteAndWaitInterceptor}
 */
public class OpenSessionBackgroundProcess extends BackgroundProcess {

EntityManagerFactory entityManagerFactory;
protected boolean initializationComplete;
private Object lock = new Object(); // used for synchronization

public OpenSessionBackgroundProcess(String name, ActionInvocation
invocation, int threadPriority, EntityManagerFactory entityManagerFactory) {
super(name, invocation, threadPriority);
this.entityManagerFactory = entityManagerFactory;
initializationComplete = true;
synchronized (lock) {
lock.notify();
}
}

protected void beforeInvocation() throws Exception {
while (!initializationComplete) {
try {
synchronized (lock) {
lock.wait(100);
}
} catch (InterruptedException e) {
// behavior ignores cause of re-awakening.
}
}
EntityManager em = entityManagerFactory.createEntityManager();
TransactionSynchronizationManager.bindResource(entityManagerFactory, new
EntityManagerHolder(em));
super.beforeInvocation();
}

protected void afterInvocation() throws Exception {
super.afterInvocation();
EntityManagerHolder emHolder = (EntityManagerHolder)
TransactionSynchronizationManager.unbindResource(entityManagerFactory);
EntityManagerFactoryUtils.closeEntityManager(emHolder.getEntityManager());
}
}

On Fri, Jan 22, 2021 at 2:44 AM Lukasz Lenart 
wrote:

> czw., 21 sty 2021 o 18:56 Burton Rhodes 
> napisał(a):
> > synchronized (lock) {   <--  NPE is here 
>
> How is this lock defined? Is it a serializable class?
>
>
> 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 form bean behaviour changes after 2.5.22

2020-11-09 Thread Martin Gainty
can you provide example of this behaviour?

regards


From: Gokul Raj 
Sent: Saturday, November 7, 2020 5:20 AM
To: Struts Users Mailing List 
Subject: Struts form bean behaviour changes after 2.5.22

Hello,

After upgrade 2.5.22 we are facing a kind of issue, form beans remove
decimal points. Does anyone face such an issue?

--

Regards
Gokul


Re: [OT] Re: Maven Warning. Ubuntu Users.; javacodegeeks.com : Global Impact at the highest levels.

2020-01-11 Thread Martin Gainty
agreed that op was aggressive by employing confrontational words and actions
answering party (admin) answer was xenophonobic and had the deleterious effect 
of escalating tensions
a shame that political tactics have to enter to enter technical discussion


From: Dave Newton 
Sent: Wednesday, January 8, 2020 5:36 PM
To: Struts Users Mailing List 
Subject: Re: [OT] Re: Maven Warning. Ubuntu Users.; javacodegeeks.com : Global 
Impact at the highest levels.

What?

On Wed, Jan 8, 2020 at 5:28 PM Zahid Rahman  wrote:

> -- Forwarded message -
> From: Zahid Rahman 
> Date: Wed, 8 Jan 2020, 19:51
> Subject: Re: [OT] Re: Maven Warning. Ubuntu Users
> To: Tomcat Users List 
>
>
> Another example of using  maven 2015 version and the impact of unknown
> warning  by MAVEN can have on application development across the Globe.
> Let'sEncrypt guy (Shultz) dismissed as unimportant.
>
> https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.9/
>
>
> Mary Zheng
> Posted by: Mary Zheng
>  in Core Java
>  December 27th,
> 2019
>  0
> <
> https://examples.javacodegeeks.com/multiple-inheritance-java-example/#respond
> >
>  433 Views
>
> She works as a senior Software Engineer in the telecommunications sector
> where she acts as a leader and works with others to design, implement, and
> monitor the software solution.
>
> https://examples.javacodegeeks.com/multiple-inheritance-java-example/
>
> 2. Technologies Used
>
> The example code in this article was built and run using:
>
>- Java 11
>- Maven 3.3.9
>- Eclipse Oxygen
>- Junit 4.12
>
>
> On Wed, 8 Jan 2020, 12:36 zahid,  wrote:
>
> > ok
> >
> > Thank you.
> >
> > www.backbutton.co.uk
> > ♡۶¯\_(ツ)_/¯ ♡۶
> > Marriage of loose and tight coupling
> > -> healthy applications
> >♡۶
> > javac Garden/Vegetables/VineVegetable.java
> > java   Garden.Vegetables.VineVegetable
> > Wot No!  -classpath -class-path even -cp!
> >
> > On 08/01/2020 09:48, Mark Thomas wrote:
> > > On 08/01/2020 08:41, Peter Kreuser wrote:
> > >> Zahid,
> > >>
> > >> you‘re talking to one of the most respected members of the community
> > > like this?
> > >
> > > All participants in Apache communities are expected to follow the code
> > > of conduct:
> > >
> > > http://www.apache.org/foundation/policies/conduct.html
> > >
> > > This is irrespective of whether you are replying to a message from one
> > > of the founders of the ASF or a first time contributor.
> > >
> > >> STFU or leave.
> > > While I understand the frustration, statements like the above are only
> > > going to add heat to an already heated situation. Please try and
> refrain
> > > from such responses.
> > >
> > >> This calls for an ban!
> > > As one of the list moderators, that thought crossed my mind as soon as
> I
> > > saw the off-topic Linux vs Windows post. I hoped that it was a one-off.
> > > When it became clear that it wasn't, I posted my request to keep
> threads
> > > on topic. I hoped that would be sufficient. Clearly it wasn't.
> > >
> > > I would urge everyone not to reply to off-topic posts.
> > >
> > > If you want to bring a post you find problematic to the attention of
> the
> > > moderators then please feel free to mail the list moderators at:
> > > users-ow...@tomcat.apache.org
> > >
> > >>> Am 08.01.2020 um 06:06 schrieb Zahid Rahman :
> > >>>
> > >>> 
> >  A version of what?
> > >>> MAVEN
> > >>> MAVEN
> > >>> MAVEN
> > >>>
> > >>> In light of this video https://youtu.be/idViw4anA6E
> > >>> Of http.
> > >>>
> > >>> You and your let's encrypt must be the longest troll on this line.
> > > No.
> > >
> > > How to configure Apache Tomcat with keys and certificates provided by
> > > Let's Encrypt is entirely on-topic for the Apache Tomcat users' mailing
> > > list.
> > >
> > >>> Take your wares and peddle them somewhere else carpet beggar.
> > > Zahid,
> > >
> > > Please stop this now.
> > >
> > > Please keep your posts to this list on topic.
> > >
> > > Please ensure that any posts are consistent with the Apache Code of
> > Conduct.
> > >
> > > If you continue to disrupt this community with off-topic posts and/or
> > > behaviour that is inconsistent with the Apache Code of Conduct then the
> > > list moderators will either require all your posts to be moderated or
> > > simply block you from posting at all.
> > >
> > > Mark
> > > wearing his list moderator hat
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > > For additional commands, e-mail: users-h...@tomcat.apache.org
> > >
> > --
> > www.backbutton.co.uk
> > ♡۶¯\_(ツ)_/¯ ♡۶
> > Marriage of loose and tight coupling
> > -> healthy applications
> >♡۶
> > java -cp classpath class-path
> >
> >
>


--

Re: Java Singleton , Framework Design Patterns

2019-12-17 Thread Martin Gainty
if your client will want to switch containers to Jetty,Jboss 
then you dont HAVE TO use tomcat dbcp alternative
and instead should use commons-dbcp-2.x as commons-dbcp-2.x works with ALL 
CONTAINERS

https://commons.apache.org/proper/commons-dbcp/
DBCP – Overview - Apache 
Commons<https://commons.apache.org/proper/commons-dbcp/>
The DBCP Component. Many Apache projects support interaction with a relational 
database. Creating a new connection for each user can be time consuming (often 
requiring multiple seconds of clock time), in order to perform a database 
transaction that might take milliseconds.
commons.apache.org

HTH
m.

From: Zahid Rahman 
Sent: Monday, December 16, 2019 2:50 PM
To: Struts Users Mailing List 
Subject: Re: Java Singleton , Framework Design Patterns

> i prefer thread-safe implementations

> Sometimes we need to have only one instance of our class for example a
single DB connection shared by multiple objects as creating a separate DB
connection for every object may be costly.

I ran a raw (without connection pooling) DB Connection test with the
following results (see below);
query time   8 ms
and DB connection time is 324.

So I am using thread safe connection pooling  strategies found here.
https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html
Asynchronous Connection Retrieval
https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html
https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html








*connecting to Postgres Database .John  Casserole  Y  2012-04-11Sandy
 Key Lime Tarts  N  2012-04-14Tom  BBQ  Y  2012-04-18Tina  Salad  Y
 2012-04-18 DB Connectime miiliseconds 324 query time taken miiliseconds
8Connection + query time miiliseconds 335*
















































*import java.sql.Connection;import java.sql.DriverManager;import
java.sql.ResultSet;import java.sql.Statement;public class QueryTable {
public static void main(String[] args) { long Start = 0; long queryTime =
0; long connTime = 0; try { System.out.println("connecting to Postgres
Database ."); Connection conn = null; Statement stmt = null; Start =
System.currentTimeMillis(); Class.forName("org.postgresql.Driver");
conn = DriverManager
 .getConnection("jdbc:postgresql://localhost:5432/events",
 "postgres", "sunrise");connTime =
System.currentTimeMillis();stmt = conn.createStatement();
queryTime = System.currentTimeMillis(); ResultSet
rs=stmt.executeQuery("select * from potluck"); while(rs.next())
System.out.println(rs.getString("name")+"  "+
 rs.getString("food")+"  "+ rs.getString("confirmed")+"  "+
 rs.getString("signup_date")); conn.close();  } catch (Exception e){
System.out.println(e);}  long End = System.currentTimeMillis();
   System.out.println(" DB Connectime miiliseconds " +  (connTime - Start)
);  System.out.println(" query time taken miiliseconds " +  (End -
queryTime) );  System.out.println("Connection + query time miiliseconds
" +  (End - Start) );   }}*

On Fri, 13 Dec 2019 at 01:33, Martin Gainty  wrote:

> Singleton:
> i prefer thread-safe implementations and generally eschew singletons
> (unless extreme political pressure dictates otherwise)
> https://www.geeksforgeeks.org/singleton-design-pattern/
> [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> Singleton Design Pattern | Implementation - GeeksforGeeks<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> The singleton pattern is one of the simplest design patterns. Sometimes we
> need to have only one instance of our class for example a single DB
> connection shared by multiple objects as creating a separate DB connection
> for every object may be costly. Similarly, there can be a single
> configuration ...
> www.geeksforgeeks.org<http://www.geeksforgeeks.org>
>
> Design Patterns:
> have a look at this discussion from stackoverflow on Visitor Pattern vs
> Command Pattern for lambda expresssions
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> interface - Java Pass Method as Parameter - Stack Overflow<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> In Java 8, you can now pass a method more easily using Lambda Expressions
> and Method References. First, some background: a functional interface is an
> interface that has one and only one abstract method, although it can
> contain any number of de

Re: Java Singleton , Framework Design Patterns

2019-12-14 Thread Martin Gainty
f bean 'numberGenerator'
2019-12-13 21:01:06,895 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Eagerly caching bean 'numberGenerator' to allow for resolving potential
circular references
2019-12-13 21:01:06,896 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Finished creating instance of bean 'numberGenerator'
2019-12-13 21:01:06,897 [main] [DEBUG]
o.s.c.s.ClassPathXmlApplicationContext - Unable to locate
LifecycleProcessor with name 'lifecycleProcessor': using default
[org.springframework.context.support.DefaultLifecycleProcessor@d967f908]
2019-12-13 21:01:06,897 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'lifecycleProcessor'
2019-12-13 21:01:06,900 [main] [DEBUG]
o.s.c.e.PropertySourcesPropertyResolver - Could not find key
'spring.liveBeansView.mbeanDomain' in any property source
2019-12-13 21:01:06,910 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'numberGenerator'
2019-12-13 21:01:06,910 [main] [INFO ] academy.learnprogramming.Main -
number = 0
2019-12-13 21:01:06,912 [main] [INFO ]
o.s.c.s.ClassPathXmlApplicationContext - Closing
org.springframework.context.support.ClassPathXmlApplicationContext@3e92e10:
startup date [Fri Dec 13 21:01:06 GMT 2019]; root of context hierarchy
2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Returning cached instance of singleton bean 'lifecycleProcessor'
2019-12-13 21:01:06,912 [main] [DEBUG] o.s.b.f.s.DefaultListableBeanFactory
- Destroying singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@6f1d30d:
defining beans [numberGenerator]; root of factory hierarchy

On Fri, 13 Dec 2019 at 01:33, Martin Gainty  wrote:

> Singleton:
> i prefer thread-safe implementations and generally eschew singletons
> (unless extreme political pressure dictates otherwise)
> https://www.geeksforgeeks.org/singleton-design-pattern/
> [https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> Singleton Design Pattern | Implementation - GeeksforGeeks<
> https://www.geeksforgeeks.org/singleton-design-pattern/>
> The singleton pattern is one of the simplest design patterns. Sometimes we
> need to have only one instance of our class for example a single DB
> connection shared by multiple objects as creating a separate DB connection
> for every object may be costly. Similarly, there can be a single
> configuration ...
> www.geeksforgeeks.org<http://www.geeksforgeeks.org>
>
> Design Patterns:
> have a look at this discussion from stackoverflow on Visitor Pattern vs
> Command Pattern for lambda expresssions
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> interface - Java Pass Method as Parameter - Stack Overflow<
> https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
> In Java 8, you can now pass a method more easily using Lambda Expressions
> and Method References. First, some background: a functional interface is an
> interface that has one and only one abstract method, although it can
> contain any number of default methods (new in Java 8) and static methods. A
> lambda expression can quickly implement the abstract method, without all
> the unnecessary syntax ...
> stackoverflow.com
> although this discussion is more specific on when to implement Visitor
> Pattern vs when to use Command Pattern
>
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> [
> https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded
> ]<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Command Pattern vs. Visitor Pattern - Stack Overflow<
> https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
> >
> Each pattern has it's own pros, cons and use cases. You can use Command
> pattern to . Decouple the invoker & receiver of command . Implement
> callback mechanism. Implement undo and redo functionality. Maintain a
> history of commands. Use Visitor pattern in below scenarios:. Similar
> operations have to be performed on objects of different types grouped in a
> structure ; You need to execute many ...
> stackoverflow.com
>
> ?am interested to know which topic prompts your question?
>
> /br/
> Martin
> 
> From: Lukasz Lenart 
> Sent: Thursday, December 12, 2019 1:56 AM
> To: Struts Users Mailing List 
> Subject: Re: Java Singleton , Framework Design Patterns
>
> czw., 12 gru 2019 o 06:13 Zahid Rahman  nap

Re: Java Singleton , Framework Design Patterns

2019-12-12 Thread Martin Gainty
Singleton:
i prefer thread-safe implementations and generally eschew singletons (unless 
extreme political pressure dictates otherwise)
https://www.geeksforgeeks.org/singleton-design-pattern/
[https://www.geeksforgeeks.org/wp-content/uploads/gfg_200X200.png]<https://www.geeksforgeeks.org/singleton-design-pattern/>
Singleton Design Pattern | Implementation - 
GeeksforGeeks<https://www.geeksforgeeks.org/singleton-design-pattern/>
The singleton pattern is one of the simplest design patterns. Sometimes we need 
to have only one instance of our class for example a single DB connection 
shared by multiple objects as creating a separate DB connection for every 
object may be costly. Similarly, there can be a single configuration ...
www.geeksforgeeks.org

Design Patterns:
have a look at this discussion from stackoverflow on Visitor Pattern vs Command 
Pattern for lambda expresssions
https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded]<https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
interface - Java Pass Method as Parameter - Stack 
Overflow<https://stackoverflow.com/questions/2186931/java-pass-method-as-parameter>
In Java 8, you can now pass a method more easily using Lambda Expressions and 
Method References. First, some background: a functional interface is an 
interface that has one and only one abstract method, although it can contain 
any number of default methods (new in Java 8) and static methods. A lambda 
expression can quickly implement the abstract method, without all the 
unnecessary syntax ...
stackoverflow.com
although this discussion is more specific on when to implement Visitor Pattern 
vs when to use Command Pattern
https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded]<https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern>
Command Pattern vs. Visitor Pattern - Stack 
Overflow<https://stackoverflow.com/questions/2857880/command-pattern-vs-visitor-pattern>
Each pattern has it's own pros, cons and use cases. You can use Command pattern 
to . Decouple the invoker & receiver of command . Implement callback mechanism. 
Implement undo and redo functionality. Maintain a history of commands. Use 
Visitor pattern in below scenarios:. Similar operations have to be performed on 
objects of different types grouped in a structure ; You need to execute many ...
stackoverflow.com

?am interested to know which topic prompts your question?

/br/
Martin

From: Lukasz Lenart 
Sent: Thursday, December 12, 2019 1:56 AM
To: Struts Users Mailing List 
Subject: Re: Java Singleton , Framework Design Patterns

czw., 12 gru 2019 o 06:13 Zahid Rahman  napisał(a):
> So my point is I have not been able to find accurate information , if some
> one could furnish me a Java language specification or recommend  a book
> which accurately describes these I would be grateful.

Start with Gang of Four
http://www.blackwasp.co.uk/gofpatterns.aspx


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: OFF TOPIC: Introduction

2019-12-05 Thread Martin Gainty
DOB correct

if the dev isnt willing to verify their code works with at least one unit test 
then whats the point of development?

dave did you see the case of the pacemaker's recording of heart electrical 
activity solved a homicide in Australia?
https://www.smh.com.au/national/pacemakers-electrical-memory-that-foiled-a-murderers-alibi-in-court-20030120-gdg4uz.html

best regards
m.


From: Dave Newton 
Sent: Tuesday, December 3, 2019 11:31 AM
To: Struts Users Mailing List 
Subject: Re: OFF TOPIC: Introduction

On Tue, Dec 3, 2019 at 9:43 AM Zahid Rahman  wrote:

> If the developer  tests his own code then there is a danger that he will
> pass his misunderstanding of specification.
>

Correct.


> Anyway in the safety critical environments the one who wrote the code does
> not do the testing.
>

That's simply not the case across the board: there are multiple tiers of
testing, and the onus is on the developer to do the initial testing.

For example, when I was writing pacemakers--you better believe we tested
the *crap* out of our code. Were we the *only* ones testing? Of course not;
there were *many* levels of testing--but it *started* with us.


> Tests are also done on hardware electrical rigs ,  simulating feed to
> sensors.
>

Yep. And when I was writing fuel pump controllers not only did *I* have a
set of tests, so did the hardware guys, so did the combination of HW/SW
guys, so did the verification group, so did whoever gave us our
certification, etc.

It's not entirely clear to me what your point is, or if you're just arguing
for the sake of arguing.

Testing is, by necessity, the responsibility of everyone involved in the
project, which includes the developer.

d.


Re: Invalid Field Value when using Map

2019-06-22 Thread Martin Gainty
supposedly the mapping class looks at Key_xxx and Element_xxx inside 
Class-conversion*.properties

 This {@link ObjectTypeDeterminer} looks at the 
Class-conversion.properties for entries that indicated what
 * objects are contained within Maps and Collections. For Collections, such as 
Lists, the element is specified using the
 * pattern Element_xxx, where xxx is the field name of the collection 
property in your action or object. For
 * Maps, both the key and the value may be specified by using the pattern 
Key_xxx and Element_xxx,
 * respectively.

in your fuBar Class
fuBar-conversion.properties would look like

# syntax:  = 
java.lang.Double = com.acme.MyDouble


/**
 * Determines the element class by looking for the value of @Element 
annotation for the given
 * class.
 * If no annotation is found, the element class is determined by using the 
generic parametrics.
 *
 * As fallback, it determines the key class by looking for the value of 
Element_${property} in the properties
 * file for the given class. Also looks for the deprecated 
Collection_${property}
 *
 * @param parentClass the Class which contains as a property the Map or 
Collection we are finding the key for.
 * @param propertythe property of the Map or Collection for the given 
parent class
 * @see 
com.opensymphony.xwork2.conversion.ObjectTypeDeterminer#getElementClass(Class, 
String, Object)
 */
public Class getElementClass(Class parentClass, String property, Object 
key) {
Element annotation = getAnnotation(parentClass, property, 
Element.class);

if (annotation != null) {
return annotation.value();
}
//departure of getClass passing parentClass property and objectIsElement bool
Class clazz = getClass(parentClass, property, true);

if (clazz != null) {
return clazz;
}

clazz = (Class) xworkConverter.getConverter(parentClass, ELEMENT_PREFIX 
+ property);

if (clazz == null) {
clazz = (Class) xworkConverter
.getConverter(parentClass, DEPRECATED_ELEMENT_PREFIX + 
property);

if (clazz != null) {
LOG.info("The Collection_xxx pattern for collection type 
conversion is deprecated. Please use Element_xxx!");
}
}
return clazz;
}

as you can see there is no conversion to String in getClass below
/**
 * Returns the class for the given field via generic type check.
 *
 * @param parentClass the Class which contains as a property the Map or 
Collection we are finding the key for.
 * @param propertythe property of the Map or Collection for the given 
parent class
 * @param element true for indexed types and Maps.
 * @return Class of the specified field.
 */
private Class getClass(Class parentClass, String property, boolean element) 
{
try {
Field field = reflectionProvider.getField(parentClass, property);

Type genericType = null;

// Check fields first
if (field != null) {
genericType = field.getGenericType();
}

// Try to get ParameterType from setter method
if (genericType == null || !(genericType instanceof 
ParameterizedType)) {
try {
Method setter = 
reflectionProvider.getSetMethod(parentClass, property);
genericType = setter.getGenericParameterTypes()[0];
}
catch (ReflectionException ognle) {
; // ignore
}
catch (IntrospectionException ie) {
; // ignore
}
}

// Try to get ReturnType from getter method
if (genericType == null || !(genericType instanceof 
ParameterizedType)) {
try {
Method getter = 
reflectionProvider.getGetMethod(parentClass, property);
genericType = getter.getGenericReturnType();
}
catch (ReflectionException ognle) {
; // ignore
}
catch (IntrospectionException ie) {
; // ignore
}
}

if (genericType instanceof ParameterizedType) {


ParameterizedType type = (ParameterizedType) genericType;

int index = (element && 
type.getRawType().toString().contains(Map.class.getName())) ? 1 : 0;

Type resultType = type.getActualTypeArguments()[index];

if ( resultType instanceof ParameterizedType) {
return (Class) ((ParameterizedType) 
resultType).getRawType();
}
return (Class) resultType;

}
} catch (Exception e) {
if ( LOG.isDebugEnabled()) {
LOG.debug("Error while retrieving generic property 

Re: Invalid Field Value when using Map

2019-06-22 Thread Martin Gainty



From: jcyh24...@yahoo.ca.INVALID 
Sent: Saturday, June 22, 2019 12:47 AM
To: user@struts.apache.org
Subject: Re: Invalid Field Value when using Map

Hi Prasanth.

Do you have a small reproducer application available to demonstrate the 
behaviour ?  There might be something relevant in the configuration and setup 
too.

The behaviour you're seeing could have something to do with the @Element 
annotations identifying the types involved.  Maybe you can work-around the 
issue by providing explicit getters/setters using String values and perform 
direct type-conversions in those methods ?

Maybe another user has a suggestion (and if there's a reproducer application 
can comment further).

Regards,
James.


On 2019/06/17 16:21:55, Prasanth wrote:
> Hi,
>
> I have a form that uses maps to store data as shown below. When the user 
> enters valid numbers it works as expected, but when > user enters non digit 
> characters in the text field a String object is saved
> in the map rather than showing a "Invalid field value for field " 
> message which is done for basic data types like
> int/long/double. Is this something that struts has not implemented for
> maps yet, as the annotations provide the expected data type?
>
> @Element(value=java.lang.Double.class)
> private HashMap deferralAmountValue = new 
> HashMap();
> @Element(value=java.lang.Double.class)
> private HashMap deferralPercentValue = new 
> HashMap();
>
>
> Thanks,
> Prasanth

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



Re: Migrating from Struts 1.2 to recent Struts

2019-03-12 Thread Martin Gainty
https://struts.apache.org/plugins/struts-1/
Struts 1 Plugin
back to Plugins Edit on GitHub Struts 1 Plugin. The Struts 1 plugin allows you 
to use existing Struts 1 Actions and ActionForms in Struts 2 applications. This 
plugin provides a generic Struts 2 Action class to wrap an existing Struts 1 
Action, org.apache.struts2.s1.Struts1Action.The wrapper class provides the 
expected calls to the legacy Struts 1 Action and ActionForm, converting 
incoming and ...
struts.apache.org

incorporate struts2-struts1-plugin to use existing struts1 actions and existing 
struts1 forms within struts2

as dave mentioned your first effort should be to update all of your web 
interfaces

hth


From: Dave Newton 
Sent: Monday, March 11, 2019 3:02 PM
To: Struts Users Mailing List
Subject: Re: Migrating from Struts 1.2 to recent Struts

Kind of depends what you're migrating it to. Roughly speaking you copy your
business logic as-is and rewrite the web interface side of things.


On Mon, Mar 11, 2019 at 2:16 PM davidrobertwoos...@gmail.com <
davidrobertwoos...@gmail.com> wrote:

> I'm forced to migrate a sizable application from Struts 1.2 to something
> recent, and I don't know where to start. I understand that Struts 1.2 is
> ~ancient~ history and no longer supported in any way, shape or form. But it
> must be done.
>
> How can I accomplish such a migration?
>
> Thanks,
>
> David
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

--
em: davelnew...@gmail.com
mo: 908-380-8699
tw: @dave_newton 
li: dave-newton 
gh: davelnewton 
so: Dave Newton 
bl[0]: Bucky Bits 
bl[1]: Maker's End Blog 
sk: davelnewton_skype


Re: Struts 1.3 and OAuth2

2019-03-10 Thread Martin Gainty
attempts at direct access to struts webapp should automatically redirect the 
request to an authorisation-server
once fully authenticated the original-request is then sent to "struts-app"

JSR-286 portlet-api frameworks have handled role assignment and authorisation 
for better part of 10 years
Here is a partial list of JSR-286 portlet-api frameworks you can use:
https://en.wikipedia.org/wiki/List_of_enterprise_portal_vendors
List of enterprise portal vendors - 
Wikipedia<https://en.wikipedia.org/wiki/List_of_enterprise_portal_vendors>
This is a list of notable vendors of enterprise portals.An enterprise portal is 
a framework for integrating information, people and processes across 
organizational boundaries.
en.wikipedia.org


the HTTP Header LOCATION is where you want to redirect to on seeing 302 MOVED 
TEMP
 if (code == HttpURLConnection.HTTP_MOVED_TEMP)
  {
   System.out.println("doPost response code is 302 (HTTP_MOVED_TEMP) about to 
getHeaderField(\"Location\")");
   token = urlc.getHeaderField("Location");
   System.out.println("doPost token="+token);
  }

those details should be handled by JSR-286 portlet server

since this has nothing to do with using struts  we can continue this offline as 
necessary

hth
Martin-



From: Asad Habib 
Sent: Sunday, March 10, 2019 3:25 AM
To: Struts Users Mailing List
Subject: Struts 1.3 and OAuth2

Has anyone successfully been able to integrate OAuth2 to authorize calls
made to an API built using Struts 1.3? I haven't seen any examples of this
online. Any help would be appreciated. Thanks.


Re: Jboss 7.2 gives 404 after deployment

2019-02-25 Thread Martin Gainty
i am semi-r which means i can help out whenever you need it

long-term contributors dave newton and lukasz lenart are very good resources
to ping for struts-related questions

see you on everest?


From: John W. Himpel 
Sent: Sunday, February 24, 2019 10:09 PM
To: Struts Users Mailing List
Subject: Re: Jboss 7.2 gives 404 after deployment

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'
> > 20

Re: Jboss 7.2 gives 404 after deployment

2019-02-24 Thread Martin Gainty
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/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]
>

Re: Jboss 7.2 gives 404 after deployment

2019-02-23 Thread Martin Gainty
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
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/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; 

Re: A book of Struts

2018-10-17 Thread Martin Gainty
i agree with johannes
It seems AWS-cloud json sends YOUR_AWS_ACCOUNT_ID as cleartext
since Authorization header is allowed:

 "x-amazon-apigateway-integration": {
  "responses": {
"default": {
  "statusCode": "200",
  "responseParameters": {
"method.response.header.Access-Control-Allow-Methods": 
"'GET,OPTIONS'",
"method.response.header.Access-Control-Allow-Headers": 
"'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'",
"method.response.header.Access-Control-Allow-Origin": "'*'"
  }
}
  },

to avoid MIM interception..could we populate username+password to the AWS 
service using Node.js ?

var requestPromise = require('request-promise');var user = 'user';var password 
= 'password';var base64encodedData = new Buffer(user + ':' + 
password).toString('base64');

requestPromise.get({
  uri: 'https://example.org/whatever',
  headers: {
'Authorization': 'Basic ' + base64encodedData
  },
  json: true})

https://stackoverflow.com/questions/18264601/how-to-send-a-correct-authorization-header-for-basic-authentication

[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded]

jquery - How to send a correct authorization header for 
...
Join Stack Overflow to learn, share knowledge, and build your career.
stackoverflow.com

?

From: Johannes Geppert 
Sent: Wednesday, October 17, 2018 4:30 AM
To: Struts Users Mailing List
Subject: Re: A book of Struts

+1 for new Struts2 book! Count on me for any help as well.

Maybe Struts2 as micro service could be a topic as well?
I made some experiments with Struts2 as AWS Lambda functions in the last
time and it will be soon hopefully supported by AWS itself.

See:
http://www.jgeppert.com/2018/05/serverless-aws-lambda-performance-of-apache-struts2-vs-spring-boot/
https://github.com/awslabs/aws-serverless-java-container/issues/149
https://github.com/struts-community-plugins/struts2-cloud-support

Best Regards

Johannes



Am Mi., 17. Okt. 2018 um 10:05 Uhr schrieb Yasser Zamani <
yasserzam...@apache.org>:

> Wow! No idea but please feel free to count on me (if you liked) on any
> aspect of the book where I'm able to assist (if you needed or wished any).
>
> Kind regards.
>
> >-Original Message-
> >From: Lukasz Lenart 
> >Sent: Wednesday, October 17, 2018 11:08 AM
> >To: Struts Users Mailing List 
> >Subject: A book of Struts
> >
> >Hi everyone,
> >
> >I would like to (finally ;-) write a book about the latest version of the
> Apache
> >Struts, probably targeting Struts 2.6. I wonder what kind of book this
> should be:
> >- an introduction from zero to a full blown app
> >- a 101 good practices/examples
> >- any other idea
> >
> >I hope you will give me some positive feedback to start working on this
> task :)
> >
> >
> >Kind 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: A book of Struts

2018-10-17 Thread Martin Gainty


From: Johannes Geppert 
Sent: Wednesday, October 17, 2018 4:30 AM
To: Struts Users Mailing List
Subject: Re: A book of Struts

+1 for new Struts2 book! Count on me for any help as well.

Maybe Struts2 as micro service could be a topic as well?
I made some experiments with Struts2 as AWS Lambda functions in the last
time and it will be soon hopefully supported by AWS itself.

See:
http://www.jgeppert.com/2018/05/serverless-aws-lambda-performance-of-apache-struts2-vs-spring-boot/
https://github.com/awslabs/aws-serverless-java-container/issues/149
https://github.com/struts-community-plugins/struts2-cloud-support

Best Regards

Johannes



Am Mi., 17. Okt. 2018 um 10:05 Uhr schrieb Yasser Zamani <
yasserzam...@apache.org>:

> Wow! No idea but please feel free to count on me (if you liked) on any
> aspect of the book where I'm able to assist (if you needed or wished any).
>
> Kind regards.
>
> >-Original Message-
> >From: Lukasz Lenart 
> >Sent: Wednesday, October 17, 2018 11:08 AM
> >To: Struts Users Mailing List 
> >Subject: A book of Struts
> >
> >Hi everyone,
> >
> >I would like to (finally ;-) write a book about the latest version of the
> Apache
> >Struts, probably targeting Struts 2.6. I wonder what kind of book this
> should be:
> >- an introduction from zero to a full blown app
> >- a 101 good practices/examples
> >- any other idea
> >
> >I hope you will give me some positive feedback to start working on this
> task :)
> >
> >
> >Kind 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: [ANN] Apache Struts 2.3.35 GA with Security Fixes Release

2018-08-22 Thread Martin Gainty
Yasser

which CVE or group of CVEs does this address?


From: Yasser Zamani  on behalf of Yasser Zamani 

Sent: Wednesday, August 22, 2018 3:35 AM
To: Struts User; Struts Announcements; Apache Announce
Subject: [ANN] Apache Struts 2.3.35 GA with Security Fixes Release

The Apache Struts group is pleased to announce that Struts 2.3.35 is
available as a “General Availability” release. The GA designation is
our highest quality grade.

In addition to critical overall proactive security improvements, this
release addresses one potential security vulnerability:
- Possible Remote Code Execution when using results with no namespace
and in same time, its upper action(s) have no or wildcard namespace.
Same possibility when using url tag which doesn’t have value and action
set. - S2-057 -
http://struts.apache.org/docs/s2-057.html

Apache Struts 2 is an elegant, extensible framework for creating
enterprise-ready Java web applications. The framework is designed to
streamline the full development cycle, from building, to deploying, to
maintaining applications over time.

All developers are strongly advised to perform this action.

The 2.3.x series of the Apache Struts framework has a minimum
requirement of the following specification versions: Servlet API 2.4,
JSP API 2.0, and Java 6.

Should any issues arise with your use of any version of the Struts
framework, please post your comments to the user list, and, if
appropriate, file a tracking ticket.

You can download this version from our download page.
http://struts.apache.org/download.cgi#struts-23x


Regards.
B�CB��[��X��ܚX�KK[XZ[�\�\�][��X��ܚX�P��]˘\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�\�\�Z[��]˘\X�K�ܙ�B


Re: Struts 2

2018-06-22 Thread Martin Gainty
 function addBulkSellerAgent() {
> >var registrationId = '';
> > var sellerId = '';
> > var fileFileName = '';
> > var fromPage = 'sellerAgent';
> > var postData = "registrationId="+registrationId+
> >   "=" +
> sellerId+
> >   "=" + fromPage +
> >   "=" + fileFileName;
> > processRegistrationDetails(' > value="addBulkSellerAgents.action" encode="true"/>', postData);
> > return false;
> > }
> > 


when constructing postData is the form data class called  ?


what does processRegistrationDetails method do ?


M
__




From: Arjuna Bandara 
Sent: Friday, June 22, 2018 12:34 PM
To: Struts Users Mailing List
Subject: Re: Struts 2

Hi,

If you using dojo, you need to include dojo tag headers.

Also keep in mind that dojo was depreciated from struts 2. So they advise
to use jQuery.

When you sending post request, its url should end with ".json" suffix.

Regards
Arjuna



On Fri, Jun 22, 2018, 9:53 PM Deborah White 
wrote:

> It appears we are using dojo plugin.
>
> I need to upload an excel file and then be able to hit the add button that
> sends to my action that imports the data into the database.  I can send
> additional code and some screenshots if that would help.  Is it better to
> take it outside of this email thread?
>
> -Original Message-
> From: Arjuna Bandara [mailto:arjunab...@gmail.com]
> Sent: Thursday, June 21, 2018 6:28 PM
> To: Struts Users Mailing List 
> Subject: Re: Struts 2
>
> Hi,
>
> What's your expected output. And the falt?
>
> Do you use dojo plugin?
>
>
>
> On Fri, Jun 22, 2018, 3:25 AM Deborah White 
> wrote:
>
> > Hello, I'm hoping someone with more experience can help me with this.
> > When I do the file upload, it uploads the file and returns to the page
> > (but it looks like it breaks out of the view it was in) but then the
> > Add button does not work.  I believe I need to be able to post data to
> > my action class that is handling the file upload?  Please see my jsp
> code:
> >
> > <%@taglib uri="/struts-tags" prefix="s" %>
> >
> >
> > 
> >
> > function addBulkSellerAgent() {
> >var registrationId = '';
> > var sellerId = '';
> > var fileFileName = '';
> > var fromPage = 'sellerAgent';
> > var postData = "registrationId="+registrationId+
> >   "&sellerAgentData.sellerId=" +
> sellerId+
> >   "&fromPage=" + fromPage +
> >   "&fileFileName=" + fileFileName;
> > processRegistrationDetails(' > value="addBulkSellerAgents.action" encode="true"/>', postData);
> > return false;
> > }
> > 
> >
> > Select File to Upload
> >  > enctype="multipart/form-data">  > name="file">  
> >
> >  > ENCTYPE="multipart/form-data" action="" method="post">
> >
> >   
> >
> >  
> >
> >  
> >   > id="clientSideError">
> >
> >   
> >  Add Seller Agents
> >  
> >
> > 
> >
> >  
> >   > width="642" style="margin:5px">
> >
> >   
> >   > class="button" type="button" value="Add" name="button_save"
> > onclick="return addBulkSellerAgent();" />
> >  <%-- > class="button" type="button" value="Reset" name="button_reset1"
> > onclick="return doSellerAgentFormClear();"/>--%>
> >   > class="button" type="button" value="Cancel" name="button_exit"
> > onclick="displayRegistrationDetails(' value="registrationView.action"
> > encode="true"> > value="%{registrationId}"/> > value="%{fromPage}"/>');" />
> >  
> >   > class="statusMessage">
> >   
> >
> >  
> >  
> >   
> >
> > 
> >
> > 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 communication with its contents may 

Re: I was involved with struts v1. But today I am doing something new

2018-06-21 Thread Martin Gainty
currently 250m ne of your location..maybe dave would be interested?


Thanks Vic!



From: Vic Cekvenich 
Sent: Thursday, June 21, 2018 11:28 AM
To: user@struts.apache.org
Subject: I was involved with struts v1. But today I am doing something new

Still open source. A meetup in NYC on the topic, check out, you'll like it.

https://www.eventbrite.com/e/silicon-alley-nyc-startup-tech-summer-networking-mixer-tickets-46683247851?aff=mu
Silicon Alley NYC Startup & Tech Summer Networking 
Mixer
www.eventbrite.com
Eventbrite - weconnect® NYC presents Silicon Alley NYC Startup & Tech Summer 
Networking Mixer - Thursday, June 21, 2018 at 5th, New York, NY. Find event 
and ticket information.




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



Re: Struts2 login action class seems to be reused

2018-05-15 Thread Martin Gainty
8443 indicates secure connection so perhaps a misconfig with wildfly 
standalone.xml (see below)


  

 



https://docs.jboss.org/author/display/WFLY10/Admin+Guide#AdminGuide-SessionCookieConfiguration
Admin Guide - WildFly 10 - Project Documentation 
Editor<https://docs.jboss.org/author/display/WFLY10/Admin+Guide#AdminGuide-SessionCookieConfiguration>
docs.jboss.org
Target audience. This document is a guide to the setup, administration, and 
configuration of WildFly. Prerequisites. Before continuing, you should know how 
to download, install and run WildFly.

?

can you ping wildfly userlist ?
https://developer.jboss.org/en/wildfly
Space: WildFly |JBoss Developer<https://developer.jboss.org/en/wildfly>
developer.jboss.org
Log in to follow, share, and participate in this community. Not a member? Join 
Now!


jaikiran is a good resource that i met on a different userlist..i would 
definitely ping him
stay in  touch/let me know if setting session-cookie in standalone.xml works

M-
NB: I once contracted to the company that bought wildfly..we had to figure 
configuration by ourselves


From: Prasanth Pasala <ppas...@pangburngroup.com>
Sent: Tuesday, May 15, 2018 11:42 AM
To: user@struts.apache.org
Subject: Re: Struts2 login action class seems to be reused

See below the header information when the exception occurred. Strange thing is 
JMeter is saying it did not send any cookie (which is want I would except in 
this case as it is just requesting the login
page)

Cookie: JSESSIONID=ZclUN41sWwTsPGRw7Cf255OHu7jnQtgt4rEZ2QDZ.(xx 
- is the machine name on which wildfly is running)
Connection: keep-alive
User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_151)
Host: dev.secure.xxx.com:8443
Content-Length: 46
Content-Type: application/x-www-form-urlencoded

10:09:09,150 ERROR 
[org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler] (default task-20) 
Exception occurred during processing request: UT10: Session is invalid
ZclUN41sWwTsPGRw7Cf255OHu7jnQtgt4rEZ2QDZ: java.lang.IllegalStateException: 
UT10: Session is invalid ZclUN41sWwTsPGRw7Cf255OHu7jnQtgt4rEZ2QDZ

From JMeter---
GET https://dev.secure.pangburngroup.com:8443/participant/

GET data:


[no cookies]

Request Headers:
Connection: keep-alive
Host: dev.secure.xxx.com:8443
User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_151)
--

Thanks,
Prasanth

On 05/15/2018 07:44 AM, Martin Gainty wrote:
> Hi Norbert/Prasanth
>
> Struts2 login action problem has morphed to "Invalid Session State"with 
> Wildfly's implementation of TC 5.5
>
> https://en.wikipedia.org/wiki/WildFly
>
> [https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Wildfly_logo.png/200px-Wildfly_logo.png]<https://en.wikipedia.org/wiki/WildFly>
>
> WildFly - Wikipedia<https://en.wikipedia.org/wiki/WildFly>
> en.wikipedia.org
> WildFly, formerly known as JBoss AS, or simply JBoss, is an application 
> server authored by JBoss, now developed by Red Hat.WildFly is written in Java 
> and implements the Java Platform, Enterprise Edition (Java EE) specification.
>
>
> MG>as a debugging exercise I would dump HTTP Header attributes with
>
> http://livehttpheaders.mozdev.org/
>
> mozdev.org - livehttpheaders: index<http://livehttpheaders.mozdev.org/>
> livehttpheaders.mozdev.org
> Welcome to the livehttpheaders project.. The goal of this project is to adds 
> information about the HTTP headers in two ways: First by adding a 'Headers' 
> tab in 'View Page Info' of a web page.
>
>
> MG>then check JSESSIONID
>
> MG>a fellow named "Thomas" had a similar problem with incorrect JSESSIONID
> MG>and corrected with his own StandardManager findSession method
> https://www.thecodingforums.com/threads/session-problem-jsessionid-cookie-comes-back-with-double-quotes.140442/
>
> Yes, there is! I found it and implemented this solution: A class
> extending org.apache.catalina.session.StandardManager and overriding
> the method public Session findSession(String id) throws IOException -
> simply removing quotation marks, if any! Seems to work fine.
> Thanks for putting me on the right trail!
>
> MG>assuming your TC has incorrect StandardManager can you update wildfly with 
> a more updated version?
> MG>here are versions
> https://developer.jboss.org/wiki/VersionOfTomcatInJBossAS?_sscc=t
> true<https://developer.jboss.org/wiki/VersionOfTomcatInJBossAS?_sscc=t>
> developer.jboss.org
> What version of Apache Tomcat ships with JBoss Application Server JBossAS 
> version Ships with Tomcat Servlet Spec JSP Spec 3.2.3 4.1.29 2.3
>
>
> MG>personally i wouldnt muck with TC i would suggest upgrading

Re: Re: Struts2 login action class seems to be reused

2018-05-15 Thread Martin Gainty
Hi Norbert/Prasanth

Struts2 login action problem has morphed to "Invalid Session State"with 
Wildfly's implementation of TC 5.5

https://en.wikipedia.org/wiki/WildFly

[https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Wildfly_logo.png/200px-Wildfly_logo.png]<https://en.wikipedia.org/wiki/WildFly>

WildFly - Wikipedia<https://en.wikipedia.org/wiki/WildFly>
en.wikipedia.org
WildFly, formerly known as JBoss AS, or simply JBoss, is an application server 
authored by JBoss, now developed by Red Hat.WildFly is written in Java and 
implements the Java Platform, Enterprise Edition (Java EE) specification.


MG>as a debugging exercise I would dump HTTP Header attributes with

http://livehttpheaders.mozdev.org/

mozdev.org - livehttpheaders: index<http://livehttpheaders.mozdev.org/>
livehttpheaders.mozdev.org
Welcome to the livehttpheaders project.. The goal of this project is to adds 
information about the HTTP headers in two ways: First by adding a 'Headers' tab 
in 'View Page Info' of a web page.


MG>then check JSESSIONID

MG>a fellow named "Thomas" had a similar problem with incorrect JSESSIONID
MG>and corrected with his own StandardManager findSession method
https://www.thecodingforums.com/threads/session-problem-jsessionid-cookie-comes-back-with-double-quotes.140442/

Yes, there is! I found it and implemented this solution: A class
extending org.apache.catalina.session.StandardManager and overriding
the method public Session findSession(String id) throws IOException -
simply removing quotation marks, if any! Seems to work fine.
Thanks for putting me on the right trail!

MG>assuming your TC has incorrect StandardManager can you update wildfly with a 
more updated version?
MG>here are versions
https://developer.jboss.org/wiki/VersionOfTomcatInJBossAS?_sscc=t
true<https://developer.jboss.org/wiki/VersionOfTomcatInJBossAS?_sscc=t>
developer.jboss.org
What version of Apache Tomcat ships with JBoss Application Server JBossAS 
version Ships with Tomcat Servlet Spec JSP Spec 3.2.3 4.1.29 2.3


MG>personally i wouldnt muck with TC i would suggest upgrading wildfly and 
getting jboss-web container

hth
martin
__





From: Norbert Hirneisen <no...@s2you.de>
Sent: Friday, March 2, 2018 6:55 PM
To: user@struts.apache.org
Subject: Fwd: Re: Struts2 login action class seems to be reused

Hi Prasanth,

are you sure all your struts1 code is thread safe ? I had some similiar
problems in a struts1 application. After removing all action class
properties the problem was solved. Struts2 should be thread safe. But
your problems looks to me like a problem with thread safety.

Best regards,

Norbert

science + communication & HaNo Systems

Bonn/Ho-Chi-Minh


Am 02.03.2018 um 22:07 schrieb Prasanth Pasala:
> I was able to replicate the issue today. Asked few users to keep logging in 
> and ran jmeter to access login page, with out putting any username or 
> password. Out of the 100 attempts 2 attempts were
> successful in getting in with out username/password. I am seeing database 
> login entries for these two. Which would happen only if a valid session is 
> not present and user has provided username/password.
>
> Thanks,
> Prasanth
>
> On 03/01/2018 02:27 PM, Prasanth wrote:
>> Hi,
>>
>> I have an application which uses both struts1 & struts2. The login action 
>> was recently moved to struts2. Immediately after the deployment we were 
>> notified that one user is seeing a different user
>> information, so we had to move to older war files. I am not able to 
>> replicate it. But after investigating the logs it seems like couple users 
>> were logged in as soon as they requested the login page.
>> For the database entry to happen it has to verify the username and password 
>> in the action class, but the fact that there is no POST entry at that time 
>> from that IP in my access log makes me believe
>> that the action class some how already had that information from a prior 
>> user.
>>
>> I do have a login filter to check if users are logged in when accessing 
>> other pages. In this filter I have the below two lines, we had to do this as 
>> we will have requests forwarded from one
>> application to another and when that happens we are getting class cast 
>> exception for ActionMapping class and valueStack. Not sure if the behavior 
>> is a side effect of having the below lines.
>>
>>  request.setAttribute("struts.actionMapping", new 
>> ActionMapping());
>>  request.setAttribute("struts.valueStack", null);
>>
>> We are using Struts 2.3.34 and Wildfly.
>>
>> Appreciate any insights you might have.
>>
>> Thanks,
>> Prasanth
>>
>>
>


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



Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-21 Thread Martin Gainty
Hi Yassir

i could'nt find it in servlet-api spec?

https://tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/http/HttpServletResponse.html

HttpServletResponse (Servlet 3.1 API Documentation 
...<https://tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/http/HttpServletResponse.html>
tomcat.apache.org
Extends the ServletResponse interface to provide HTTP-specific functionality in 
sending a response. For example, it has methods to access HTTP headers and 
cookies. The servlet container creates an HttpServletResponse object and passes 
it as an argument to the servlet's service methods (doGet, doPost, etc).

i did find sendLocalRedirect method in ATG Dynamo HttpServletResponse
https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0803httpservletresponse01.html
HttpServletResponse - 
Oracle<https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0803httpservletresponse01.html>
docs.oracle.com
Set Response Codes. The response code for a request is a numeric value that 
represents the status of the response. For example, 200 represents a successful 
response, 404 represents a file not found, and so on.




i didnt know struts2 supported ATG Dynamo sendLocalRedirect

Thanks for the clarification


Regards

Martin Gainty
__




From: Yasser Zamani <yasser.zam...@live.com> on behalf of Yasser Zamani 
<yasserzam...@apache.org>
Sent: Wednesday, April 18, 2018 2:57 AM
To: user@struts.apache.org
Subject: Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters 
on refresh?



On 4/18/2018 1:21 AM, Martin Gainty wrote:
> MG>AFAIK a redirect terminates the old session and creates a new session

I think redirect to same domain:ip in same browser tab page should keep
session.

> MG>a better alternative is to implement ChainingInterceptor with  type="chain"> e.g.

As Struts uses action name for the key of the background process saved
into session, I think chain doesn't work for this requirement.

Regards.

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



Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-18 Thread Martin Gainty
MG2>some confusion on where session is accessed


From: Yasser Zamani <yasser.zam...@live.com> on behalf of Yasser Zamani 
<yasserzam...@apache.org>
Sent: Wednesday, April 18, 2018 2:57 AM
To: user@struts.apache.org
Subject: Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters 
on refresh?



On 4/18/2018 1:21 AM, Martin Gainty wrote:
> MG>AFAIK a redirect terminates the old session and creates a new session

I think redirect to same domain:ip in same browser tab page should keep
session.

MG2>2 alternatives: build out HTTPGet with 

 * Calls the {@link HttpServletResponse#sendRedirect(String) sendRedirect}
 * method to the location specified. The response is told to redirect the
 * browser to the specified location (a new request from the client). The
 * consequence of doing this means that the action (action instance, action
 * errors, field errors, etc) that was just executed is lost and no longer
 * available. This is because actions are built on a single-thread model. The
 * only way to pass data is through the session
MG2>with chain interceptor

 * or with web parameters

 * (url?name=value) which can be OGNL expressions.
MG2>essentially a HTTP Get with params. here is example:
* 
 * !--
 *   The redirect URL generated will be:
 *   /foo.jsp#FRAGMENT
 * --
 * result name="success" type="redirect"
 *   param name="location"foo.jsp/param
 *   param name="parse"false/param
 *   param name="anchor"FRAGMENT/param
 * /result
 * 
MG2>

MG2>Here is code that *should access session params* to pass to new 
finalLocation (but session is not accessed?)
/**
 * Redirects to the location specified by calling
 * {@link HttpServletResponse#sendRedirect(String)}.
 *
 * @param finalLocation the location to redirect to.
 * @param invocation an encapsulation of the action execution state.
 * @throws Exception if an error occurs when redirecting.
 */
protected void doExecute(String finalLocation, ActionInvocation invocation) 
throws Exception {
ActionContext ctx = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest) 
ctx.get(ServletActionContext.HTTP_REQUEST);
HttpServletResponse response = (HttpServletResponse) 
ctx.get(ServletActionContext.HTTP_RESPONSE);

if (isPathUrl(finalLocation)) {
if (!finalLocation.startsWith("/")) {
ActionMapping mapping = actionMapper.getMapping(request, 
Dispatcher.getInstance().getConfigurationManager());
String namespace = null;
if (mapping != null) {
namespace = mapping.getNamespace();
}

if ((namespace != null) && (namespace.length() > 0) && 
(!"/".equals(namespace))) {
finalLocation = namespace + "/" + finalLocation;
} else {
finalLocation = "/" + finalLocation;
}
}

// if the URL's are relative to the servlet context, append 
(prepend) the servlet context path to finalLocation
if (prependServletContext && (request.getContextPath() != null) && 
(request.getContextPath().length() > 0)) {
finalLocation = request.getContextPath() + finalLocation;
}

MG2>
//where the session *should* be accessed
// public Map<String, ResultConfig> getResults()
//i see ResultConfig here but no reference to session?
//where in ResultConfig The Builder class I see
 /**
 * The builder for this object.  An instance of this object is the only way 
to construct a new instance.  The
 * purpose is to enforce the immutability of the object.
 * The methods are structured in a way to support chaining.
 * After setting any values you need, call the {@link #build()} method to 
create the object.
 */

MG2>

ResultConfig resultConfig = 
invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());

if (resultConfig != null) {
Map<String, String> resultConfigParams = 
resultConfig.getParams();

List prohibitedResultParams = 
getProhibitedResultParams();
for (Map.Entry<String, String> e : 
resultConfigParams.entrySet()) {
if (!prohibitedResultParams.contains(e.getKey())) {
Collection values = 
conditionalParseCollection(e.getValue(), invocation, suppressEmptyParameters);
if (!suppressEmptyParameters || !values.isEmpty()) {
requestParameters.put(e.getKey(), values);
}
}
}
}

StringBuilder tmpLocation = new StringBuilder(finalLocation);
u

Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-17 Thread Martin Gainty



From: Burton Rhodes 
Sent: Tuesday, April 17, 2018 7:23 AM
To: Struts Users Mailing List
Subject: Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters 
on refresh?

That's a great thought.  I think the session method makes more sense.

On Tue, Apr 17, 2018 at 2:12 AM, Yasser Zamani 
wrote:

>
>
> On 4/17/2018 6:42 AM, Burton Rhodes wrote:
> > Also, How would I include everything except the email body field with the
> > s:url tag?
>
> Unfortunately, I couldn't find a simple way :(
>
> However, as a workaround, instead, in your email form jsp, could you put
> the email body field as a POST param and the rest short fields which
> need validation as GET params (i.e. in a query string inside action url
> using s:url)? Because then you can use  content="3;url="/> which only counts GET
> params i.e. only query string which doesn't include email body but
> includes other validation needed fields.
>
> But if I were you, I prefer to use two actions for such requirement.
> action1 which doesn't have ExecAndWait interceptor but has others like
> validation, gets form data and stores them as a single object inside
> session with a unique key every-time i.e. a GUID. Then action1 redirects
> to action2 and also passes that key to action2. action2 behaves like a
> mail sender and only has ExecAndWait interceptor. action2 gets then
> deletes data from session by that key and the rest is same as your
> current single action :)

MG>AFAIK a redirect terminates the old session and creates a new session
MG>a better alternative is to implement ChainingInterceptor with  e.g.
MG>

 
 otherAction
 

 
 
 
 good_result.ftl
 
MG>
http://viralpatel.net/blogs/struts-2-action-chaining-example/
Struts 2 Action Chaining example - 
ViralPatel.net
viralpatel.net
In Struts 2, sometimes you may want to process another action when one action 
completes. For example on successfully submitting a form you want to render 
output from other action.

MG>?

>
> Regards.
>


Re: Triple select tag

2018-04-14 Thread Martin Gainty
Hi Albert

Thinking you could possibly hook JS function to doubleOnSelect of first 
component to highlight 3rd
but
would you have an example of 3 tag-components wired together?


Martin

__




From: albert kao <albertk...@gmail.com>
Sent: Saturday, April 14, 2018 8:49 AM
To: Struts Users Mailing List
Subject: Triple select tag

I am looking for a triple select tag component which is similar to the
s:doubleselect tag (
https://struts.apache.org/tag-developers/doubleselect-tag.html).
Tag Developers Guide - Apache Struts 
1<https://struts.apache.org/tag-developers/doubleselect-tag.html>
struts.apache.org
Edit on GitHub doubleselect. Please make sure you have read the Tag Syntax 
document and understand how tag attribute syntax works.



It renders three HTML select elements with the third one changing displayed
values depending on selected entry of second one, and the second one
changing displayed values depending on selected entry of first one.
A generic triple select tag component is desired.
If not, a slim down version is welcome.
I googled and saw s:doubleselect tag examples but did not find anything
about triple select tag.
Please suggest any websites, blogs, examples or implementation tips.
Thanks.


Re: Sr Dev Struts 2 Job Irving TX Area

2018-04-09 Thread Martin Gainty
Hi Paul
no problem doing the work

Unfortunately i have a parent with incurable ALZ

With Trump/Cruz denying mexicans at the border who work as HealthCareAides
how can i possibly afford LT facility for parent?
Maybe drive to the nearest VA..wheel her up to the front-door and say
Here she is is boys..you take care of her while i get me some paying work!


?

Martin Gainty

__

 _ _  _ _  _ ___ _  
  _   _ _   _  |_   _| |_ ___   |  _  |___ ___ 
___| |_ ___   |   __|___|  _| |_ _ _ _ ___ ___ ___   |   __|___ _ _ ___ _| 
|___| |_|_|___ ___| | |   | -_|  | | . | .'|  _|   | -_|  |__   | . |  
_|  _| | | | .'|  _| -_|  |   __| . | | |   | . | .'|  _| | . |   |   |_| 
|_|_|___|  |__|__|  _|__,|___|_|_|___|  |_|___|_| |_| |_|__,|_| |___|  
|__|  |___|___|_|_|___|__,|_| |_|___|_|_||_|




From: Paul Zepernick <paul.zepern...@healthsmart.com>
Sent: Monday, April 9, 2018 11:14 AM
To: Struts Users Mailing List
Subject: Sr Dev Struts 2 Job Irving TX Area

Looking for a Sr Struts 2 dev in the Irving TX area.  Please follow the link 
below for details of the job description.

https://workforcenow.adp.com/mascsr/default/mdf/recruitment/recruitment.html?cid=bec92904-6e43-44f3-a8dd-2909905e90f8=19000101_01=222415=en_US=CC4


Paul R. Zepernick
Sr. Programmer Analyst
HealthSmart Benefit Solutions
paul.zepern...@healthsmart.com<mailto:paul.zepern...@healthsmart.com>






Disclaimer: This communication and any files transmitted with it may contain 
information that is privileged, confidential and/or exempt from disclosure 
under applicable law. If you are not the intended recipient, you are hereby 
notified that any disclosure, copying, distribution, or use of the information 
contained herein (including any reliance thereon) is strictly prohibited. If 
you received this communication in error, please immediately contact the sender 
and destroy the material in its entirety, whether in electronic or hard copy 
format. Thank you.


Re: Struts 2.5.14 support for java 8/java 9/java 10

2018-03-09 Thread Martin Gainty
David-


which Struts issues are you encountering with JDK 1.8?

JDK 1.9?
JDK 10?

?

Martin-
__


From: Adam Brin <ab...@digitalantiquity.org>
Sent: Monday, March 5, 2018 8:23 AM
To: Struts Users Mailing List
Subject: Re: Struts 2.5.14 support for java 8/java 9/java 10

You might look in the struts2 JIRA for open issues

> On Mar 5, 2018, at 6:18 AM, David Greene <da...@securelink.com> wrote:
>
> Struts 2.5 has out of the gate support for Java8.  I haven't tried 9 or 10
> yet.
>
> On Mon, Mar 5, 2018 at 4:16 AM, coolaki2...@gmail.com <coolaki2...@gmail.com
>> wrote:
>
>> Hello,
>>
>> Can anyone throw some knowledge about Struts support for Java 8 , Java 9
>> and Java 10.
>>
>>
>> Thanks,
>>
>> A.S
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
> --
> 
> *David Greene*
> *SecureLink, Inc.*
> Secure networks for remote support
> 
> mobile | (512) 630-2285
> office | (512) 640-1912
> 
> da...@securelink.com
>
> This email may contain private information and is for the intended
> recipient only. If received in error, please notify sender and destroy any
> copies. Unauthorized review, use, or disclosure of the contents herein is
> prohibited

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



Re: BUG in struts-2.5.15

2018-02-15 Thread Martin Gainty
mg>below


From: liemngu...@ups.com.INVALID <liemngu...@ups.com.INVALID>
Sent: Wednesday, February 14, 2018 5:20 PM
To: user@struts.apache.org
Subject: Re: BUG in struts-2.5.15

Martin Gainty,

I found 
"C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar".
 I believe struts-default.xml is within struts2-core.jar (renamed from 
struts2-core-2.5.15.jar).

I believe this bug is similar to https://issues.apache.org/jira/browse/WW-4901 
in struts-2.5.14.1 and struts-2.5.14.

When I tested upgrading to struts-2.5.14.1 (or struts-2.5.14), I see similar 
error described in WW-4901.

Struts-2.5.13 did not have this bug.

I thought this bug is fixed in struts-2.5.15. Somehow, I still see it in 
struts-2.5.15 when deploying to Weblogic server.

MG>yes if you see ClassCastException your bug is same as WW-4901
MG>its Lukasz call on whether or not to revert 2.5.15 to working 2.5.13 
codebase..i would ping him for next steps

Thanks,
Liem.


From: Martin Gainty <m...@hotmail.com>
Subject: Re: BUG in struts-2.5.15
Date: 2018/02/14 21:09:55
List: 
user@struts.apache.org<https://lists.apache.org/list.html?user@struts.apache.org>








From: liemngu...@ups.com.INVALID <li...@ups.com.INVALID>

Sent: Wednesday, February 14, 2018 10:43 AM

To: user@struts.apache.org

Subject: BUG in struts-2.5.15



Hi all,



Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic 
server version 12.2.1.2.0, JDK v 1.8.0_101), we see exception below.



MG>asking the obvious ..do you have:



C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml



MG>located on your WINDOWS-OS Weblogic server?




Re: BUG in struts-2.5.15

2018-02-14 Thread Martin Gainty



From: liemngu...@ups.com.INVALID 
Sent: Wednesday, February 14, 2018 10:43 AM
To: user@struts.apache.org
Subject: BUG in struts-2.5.15

Hi all,

Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic 
server version 12.2.1.2.0, JDK v 1.8.0_101), we see exception below.

MG>asking the obvious ..do you have:

C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml

MG>located on your WINDOWS-OS Weblogic server?

Thanks,
Liem.


2018-02-14 10:28:37.194 WARN  - Could not create JarEntryRevision for 
[zip:C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml]!
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.(URL.java:600) ~[?:1.8.0_101]
at java.net.URL.(URL.java:490) ~[?:1.8.0_101]
at java.net.URL.(URL.java:439) ~[?:1.8.0_101]
at 
java.net.JarURLConnection.parseSpecs(JarURLConnection.java:175) ~[?:1.8.0_101]
at java.net.JarURLConnection.(JarURLConnection.java:158) 
~[?:1.8.0_101]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.(StrutsJarURLConnection.java:44)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.openConnection(StrutsJarURLConnection.java:99)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:42)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.monitorFile(DefaultFileManager.java:94)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:73)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1054)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:198)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:165)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:166)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)
 [struts2-core.jar:2.5.15]
at 
weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:400)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.initFilter(FilterManager.java:130) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:92) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:72) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1917)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3063)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
 

Re: newFixedThreadPool in struts2

2018-02-09 Thread Martin Gainty
in struts this is accomplished implementing
 org.apache.struts2.interceptor.createSessionInterceptor
configured in interceptor-ref name in struts-config.xml


 action name="someAction" class="com.examples.SomeAction"
 * interceptor-ref name="createSession"/

afterwards you can access the HttpServletRequest:

HttpServletRequest req=ServletActionContext.getServletContext().getRequest()

HttpSession session=req.getSession();

get all the params from session you need


HTH

Martin
__




From: Emi <em...@encs.concordia.ca>
Sent: Friday, February 9, 2018 4:02 PM
To: Struts Users Mailing List
Subject: Re: newFixedThreadPool in struts2

Hello Yasser,
> You can write your own listener by implementing HttpSessionListener
> and call shutdown in it's `sessionDestroyed` method. Please see [1].
> [1] http://www.myjavarecipes.com/tag/session-timeout-handling-in-java/
Session timeout handling in Java | My Java 
Recipes<http://www.myjavarecipes.com/tag/session-timeout-handling-in-java/>
www.myjavarecipes.com
Hi Reader, Recently I got requirement from customer that how much time user is 
spending on web application. Requirement is simple, for this we just need to 
record ...



In HttpSessionListener, it seems that there are no session attributes
anymore. So, there is no way for me to do the following in the listener
class:

fixPool = session.getAttribute('fixpool_name');
fixPool.shutdown();

So, the only possible way is through springframework config, right?

Thanks a lot.


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



Re: Lang

2018-02-09 Thread Martin Gainty
Buenas Noches

your implementation of AbstractBeanProvider needs to supply 
struts-messages_es.properties

in WEB-INF/classes/org/apache/struts2 folder


if you have no impl of AbstractBeanProvider use 
org.apache.struts2.config.DefaultBeanSelectionProvider

public void register(ContainerBuilder builder, LocatableProperties props) {

...find your way to LocalizedTextUtil.addDefaultResourceBundle to add in your 
_es properties:


LocalizedTextUtil.addDefaultResourceBundle("org/apache/struts2/struts-messages_es");
loadCustomResourceBundles(props);

in org/apache/struts2/default.properties point struts.custom.i18n.resources to 
your properties:
struts.custom.i18n.resources=struts_messages_es

i will leave org/apache/struts2/struts-messages_es.properties as ejercicio de 
traducción

Un Saludo desde Nueva Inglaterra
Martín
__



From: Deborah White 
Sent: Friday, February 9, 2018 12:47 PM
To: Struts Users Mailing List
Subject: Lang

I have this:



It doesn't seem to like lang=es

Help?

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.


Re: log4j problem

2017-12-30 Thread Martin Gainty





From: José Antonio Delgado Trujillo 
Sent: Friday, December 29, 2017 4:13 PM
To: Struts Users Mailing List
Subject: Re: log4j problem

MG>before you restart did you deploy your struts-basic*.war to 
server/default/deploy folder?

JD> mvn wildly:deploy put the war in the folder deploy



MG>display struts.xml to determine mapping for namespace “/

JD> I clone the trust-exmple GitHub. I haven’t modify anything.


MG>namespace might look something like e.g.
 e.g.
MG> 
MG>indicates BasicStrutsAction.java is either not compiled  or 
BasicStrutsAction.class is not on $CLASSPATH?

Your action node is action class less

/index.jsp



So Struts2 because they don’t find any action class redirect to index.jsp
The log that is expected is ...


[cid:CD1E3B8F-4BE5-4548-8933-B0CA376D5FBB]

MG>DefaultActionProcy used to be located in xwork-core*.jar from your 
/server/default/lib folder
MG>do any of the jars from lib folder contain DefaultActionProxy.class ?
MG>hard to debug without source and configuration files.. can you provide 
github location of basic-struts2 ?


Re: log4j problem

2017-12-29 Thread Martin Gainty




From: José Antonio Delgado Trujillo 
Sent: Friday, December 29, 2017 1:57 PM
To: Struts Users Mailing List
Subject: Re: log4j problem

I don’t know how to recompile lot with runtime jdk provided by JBOSS
MG>JBOSSConfiguration to JDK is explained here
https://access.redhat.com/articles/111663
JBoss Enterprise Application Platform (EAP) 6 Supported 
...
access.redhat.com
Register. If you are a new customer, register now for access to product 
evaluations and purchasing capabilities. Need access to an account? If your 
company has an ...



I rm log, data, tmp folders
restart wildfly, clean and deploy basic-struts, and when i put in the browser
localhost:8080/basic-struts/index.action
I see the Welcome to Struts 2 jsp

But i read in the console of wildly the next ..
MG>before you restart did you deploy your struts-basic*.war to 
server/default/deploy folder?
MG>display struts.xml to determine mapping for namespace "/
MG>namespace might look something like e.g.
 

MG>also display struts.xml to determine mapping for "basic-struts" (which would 
be included in namespace definition)
MG>e.g.
MG> 
MG>indicates BasicStrutsAction.java is either not compiled  or 
BasicStrutsAction.class is not on $CLASSPATH?

18:48:30,252 INFO  [stdout] (default task-3) 2017-12-29 18:48:30,228 ERROR 
[default task-3] dispatcher.Dispatcher (Dispatcher.java:609) - Could not find 
action or result: /basic-struts/
18:48:30,253 INFO  [stdout] (default task-3) 
com.opensymphony.xwork2.config.ConfigurationException: There is no Action 
mapped for namespace [/] and action name [] associated with context path 
[/basic-struts].
18:48:30,254 INFO  [stdout] (default task-3) at 
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:195) 
~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,254 INFO  [stdout] (default task-3) at 
org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:57) 
~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,254 INFO  [stdout] (default task-3) at 
org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:32)
 ~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,254 INFO  [stdout] (default task-3) at 
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:60)
 ~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,255 INFO  [stdout] (default task-3) at 
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) 
~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,255 INFO  [stdout] (default task-3) at 
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
 ~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,255 INFO  [stdout] (default task-3) at 
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
 ~[struts2-core-2.5.14.1.jar:2.5.14.1]
18:48:30,255 INFO  [stdout] (default task-3) at 
io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) 
~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,256 INFO  [stdout] (default task-3) at 
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
 ~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,256 INFO  [stdout] (default task-3) at 
io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) 
~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,257 INFO  [stdout] (default task-3) at 
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
 ~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,257 INFO  [stdout] (default task-3) at 
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
 ~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,258 INFO  [stdout] (default task-3) at 
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
 ~[?:?]
18:48:30,258 INFO  [stdout] (default task-3) at 
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
 ~[undertow-core-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,259 INFO  [stdout] (default task-3) at 
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
 ~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,259 INFO  [stdout] (default task-3) at 
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
 ~[undertow-servlet-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,259 INFO  [stdout] (default task-3) at 
io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
 ~[undertow-core-1.4.18.Final.jar!/:1.4.18.Final]
18:48:30,260 INFO  [stdout] 

Re: log4j problem

2017-12-29 Thread Martin Gainty



MG>you have a saved session state in one of your jboss caches that is 
conflicting with your new Basic.war Session State
MG>clean out ALL your jboss caches
MG>rm -rf tmp
MG>rm -rf data
MG>rm -rf log
MG>recompile the whole lot with runtime jdk provided by JBOSS
MG>restart jboss

un saludo

From: José Antonio Delgado Trujillo 
Sent: Friday, December 29, 2017 9:25 AM
To: Struts Users Mailing List
Subject: Re: log4j problem

After clone the GitHub and deploy basic-struts in Wildly:

log4j is in lib folder
It isn’t any log4j output after test in the browser 
(localhost:8080/basic-struts/index.action)
I don’t think is a level problem in WildFly because...

If i did manually the first project basic-struts i can see more info log than 
the 2 in the tutorial.
I realise that when i deploy the project (man wildly:deploy) i found a warning 
about log4j-api

14:21:11,532 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) 
WFLYSRV0003: Could not index class module-info.class at 
/content/basic.war/WEB-INF/lib/log4j-api-2.10.0.jar: 
java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 24
at org.jboss.jandex.Indexer.processConstantPool(Indexer.java:1417)
at org.jboss.jandex.Indexer.index(Indexer.java:1451)
at 
org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:99)
at 
org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51)
at 
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
at 
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at 
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

What is it happening?



Re: Struts 2 JSP Taglib error

2017-10-24 Thread Martin Gainty





From: Christoph Nenning 
Sent: Tuesday, October 24, 2017 7:40 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 JSP Taglib error

Hi,

I have often seen this when application included something jsp-api.jar or
jee-api.jar (other filenames are possible). That means Serlvet-Container
as another jar containing javax.servlet.jsp.tagext.Tag then application
which causes that ClassCastException.

MG>your compile time jar was correct but runtime jar is incorrect

MG>TC suggests you place The servlet-version specific jsp-api.jar into "common" 
folder
https://tomcat.apache.org/tomcat-8.0-doc/class-loader-howto.html
Apache Tomcat 8 (8.0.47) - Class Loader 
HOW-TO
tomcat.apache.org
As indicated in the diagram above, Tomcat creates the following class loaders 
as it is initialized: Bootstrap — This class loader contains the basic runtime 
classes ...



Regards,
Christoph



> From: "ravirajmishr...@gmail.com" 
> To: ,
> Date: 24.10.2017 12:53
> Subject: Struts 2 JSP Taglib error
>
> Hello,
>
> I am facing the following problem
>
> SEVERE: Servlet.service() for servlet jsp threw exception
> java.lang.ClassCastException:
> org.apache.tiles.jsp.taglib.UseAttributeTag cannot be cast to
> javax.servlet.jsp.tagext.Tag
>at
org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:120)
>at
>
org.apache.jsp.mmr.jsp.templates.layout_005fadmin_005fwindow_jsp._jspService
> (layout_005fadmin_005fwindow_jsp.java:100)
>at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>at org.apache.jasper.servlet.JspServletWrapper.service
> (JspServletWrapper.java:432)
>at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
>at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> (ApplicationFilterChain.java:305)
>at org.apache.catalina.core.ApplicationFilterChain.doFilter
> (ApplicationFilterChain.java:210)
>at org.apache.catalina.core.ApplicationDispatcher.invoke
> (ApplicationDispatcher.java:690)
>at org.apache.catalina.core.ApplicationDispatcher.processRequest
> (ApplicationDispatcher.java:477)
>at org.apache.catalina.core.ApplicationDispatcher.doForward
> (ApplicationDispatcher.java:402)
>at org.apache.catalina.core.ApplicationDispatcher.forward
> (ApplicationDispatcher.java:329)
>at org.apache.tiles.request.servlet.ServletRequest.forward
> (ServletRequest.java:265)
>at org.apache.tiles.request.servlet.ServletRequest.doForward
> (ServletRequest.java:228)
>at org.apache.tiles.request.AbstractClientRequest.dispatch
> (AbstractClientRequest.java:57)
>at org.apache.tiles.request.render.DispatchRenderer.render
> (DispatchRenderer.java:47)
>at org.apache.tiles.impl.BasicTilesContainer.render
> (BasicTilesContainer.java:259)
>at org.apache.tiles.impl.BasicTilesContainer.render
> (BasicTilesContainer.java:397)
>at org.apache.tiles.impl.BasicTilesContainer.render
> (BasicTilesContainer.java:238)
>at org.apache.tiles.TilesContainerWrapper.render
> (TilesContainerWrapper.java:103)
>at org.apache.tiles.impl.mgmt.CachingTilesContainer.render
> (CachingTilesContainer.java:126)
>at org.apache.struts2.views.tiles.TilesResult.doExecute
> (TilesResult.java:161)
>at org.apache.struts2.result.StrutsResultSupport.execute
> (StrutsResultSupport.java:208)
>at com.opensymphony.xwork2.DefaultActionInvocation.executeResult
> (DefaultActionInvocation.java:373)
>at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> (DefaultActionInvocation.java:277)
>at
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept
> (DebuggingInterceptor.java:253)
>at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> (DefaultActionInvocation.java:247)
>at
>
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept
> (DefaultWorkflowInterceptor.java:176)
>at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> (MethodFilterInterceptor.java:98)
>at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> (DefaultActionInvocation.java:247)
>at
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept
> (ValidationInterceptor.java:260)
>at
>
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept
> (AnnotationValidationInterceptor.java:52)
>at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> (MethodFilterInterceptor.java:98)
>at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> (DefaultActionInvocation.java:247)
>at
>

Re: Which Struts Version to implement (with Patch for Equifax)

2017-09-20 Thread Martin Gainty
David:

the recommended hardened version for financial services industry is Struts 
2.5.10.1..here is why:


"If you are using Jakarta-based file upload Multipart parser, upgrade to Apache 
Struts version 2.3.32 or 2.5.10.1," Apache says in a March 6 security alert. 
"You can also switch to a different implementation of the Multipart parser."


https://www.bankinfosecurity.com/apache-struts-2-under-zero-day-attack-update-now-a-9761

[https://130e178e8f8ba617604b-8aedd782b7d22cfe0d1146da69a52436.ssl.cf1.rackcdn.com/apache-struts-2-under-zero-day-attack-update-now-showcase_image-9-a-9761.jpg]<https://www.bankinfosecurity.com/apache-struts-2-under-zero-day-attack-update-now-a-9761>

Apache Struts 2 Under Zero-Day Attack, Update 
Now<https://www.bankinfosecurity.com/apache-struts-2-under-zero-day-attack-update-now-a-9761>
www.bankinfosecurity.com
Apache Struts 2 users are being warned to upgrade immediately, after attackers 
began targeting a zero-day flaw in the widely used, open source Java EE 
platform.



David and Lukasz please confirm

Martin
__




From: David Greene <da...@securelink.com>
Sent: Tuesday, September 19, 2017 9:43 AM
To: Struts Users Mailing List
Subject: Re: Which Struts Version To Use?

Just from my personal experience, migrating from 2.3.x to 2.5.x was a very
small development task.  I was actually surprised at how few changes were
required.  As someone else mentioned, a little bit of regex to weed out the
now-unused tag arguments was probably the 'hardest' part.  I would
recommend just biting the (small) bullet and going with 2.5.x if Java 1.6
isn't required in your environment.

-David


On Tue, Sep 19, 2017 at 1:11 AM, Lukasz Lenart <lukaszlen...@apache.org>
wrote:

> Bruce
>
> Struts 2.5.x is not only due to build on JDK7, also there were few
> important architectural changes which may be backward incompatible in
> some cases. Also 2.5.x brings more new features and improvements that
> also at some point can break backward comaptibility. 2.5.x is a good
> choice when you start a new development project or you need a ned
> feature which is available in 2.5.x only.
>
> That's why I keep 2.3.x branch just to port security fixes and allow
> easier transition to 2.5.x (or 2.6.x soon). There is no exact plans
> how long 2.3.x will be around, I do plan switch to JDK7 (lack of tools
> to support build on JDK6) and then 2.3.x will be branded as 2.4.x but
> still with the same scope - only security fixes. So 2.3.x/2.4.x will
> stay with us for longer :)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
Łukasz Lenart - strona domowa<http://www.lenart.org.pl/>
www.lenart.org.pl
oto ja aplikacje. pierwszy program napisałem w wieku 15. lat na Commodore 
VIC-20, dla przyjemności, nie dla pieniędzy i ciągle tak jest - przyjemność ...



>
> PS. Please remember that Struts doesn't follow strict semantic
> versioning, "2" means "Struts 2" so Struts 2.5.x is "Struts 2 version
> 5.x" where Struts 2.3.x means "Struts 2 version 3.x" :)
>
> 2017-09-18 21:29 GMT+02:00 bruceaphill...@gmail.com <
> bruceaphill...@gmail.com>:
> > Thank you for the reply.
> >
> > I still don't understand why there are two active branches, especially
> since JDK7 was EOL some time ago.
> >
> > If the 2.3.X line is going to be ended soon and the 2.5.X line is the
> future then I'd like to get our Struts apps on 2.5.X
> >
> > But if 2.3.X is going to be maintained for the next 1-2 years then I'd
> feel comfortable updating to 2.3.X
> >
> > Another consideration is that all our newer web apps use Spring MVC and
> do not use Struts 2.  We only have some legacy web apps that still use
> Struts 2.  If the time commitment in converting from Struts 2.3.X to 2.5.X
> is high then we might as well just convert those apps to Spring MVC.
> >
> > It would be great if the Struts 2 PMC would publicly state what the
> future plan is for Struts 2 or if there is already a published plan please
> let know.
> >
> > Bruce
> >
> > On 2017-09-18 10:15, "Jason D. Burkert" <jason.burk...@craytek.com>
> wrote:
> >> On 2017-09-18 11:05 AM, Phillips, Bruce A wrote:
> >> > We still have a couple of web apps that are using Struts version
> 2.3.32
> >> >
> >> > We want to update those web apps to the latest version of Struts but
> I’m not sure what version to update to.
> >> >
> >> > I see a 2.5.13 and a 2.3.34 – both tags seem to be recently created.
> >> >
> >> > Should I update to 2.5.13 or should I stay on the 2.3.X line?
> >> >
> &

Re: Problem using the Spring's AOP in Struts2's Actions with json-plugin

2017-05-09 Thread Martin Gainty
MG>

here is an example which uses Springs AOP to set a interface to a AOP Context 
type

http://techqa.info/programming/question/29553557/issue-configuring-multiple-datasources-in-spring-data-jpa

first creates a context
populates context type with DataSource interface

this is of course predicated that jdbc/myapp will lookup successfully:

@Override
protected void postProcessContext(Context context) {
ContextResource appDBResource = new ContextResource();
appDBResource.setName("jdbc/myapp");
appDBResource.setType(DataSource.class.getName());

he identified his type to be DataSource interface
since DataSource is indeed an interface then Spring will create Aop-proxy with 
JdkDynamicAopProxy

at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:187)


DISPLAY CONVERSION:

provided you can  populate kendo #grid with ascii data from datasource 
jdbc/myapp

you can then use kendo magic to convert to JSON for html

kendo.stringify( $("#grid").data("kendoGrid").dataSource.view() );

http://www.telerik.com/forums/how-to-convert-datasource-to-json-to-send-back-to-a-mvc-controller

MG>

[http://www.telerik.com/sfimages/default-source/logos/telerik1200x630.png]<http://www.telerik.com/forums/how-to-convert-datasource-to-json-to-send-back-to-a-mvc-controller>

How to Convert dataSource to JSON to send back to a mvc 
...<http://www.telerik.com/forums/how-to-convert-datasource-to-json-to-send-back-to-a-mvc-controller>
www.telerik.com
Forum thread about How to Convert dataSource to JSON to send back to a mvc 
controller? in Kendo UI. Join the conversation now.




Martin Gainty
__

 _ _  _ _  _ ___ _  
  _   _ _   _  |_   _| |_ ___   |  _  |___ ___ 
___| |_ ___   |   __|___|  _| |_ _ _ _ ___ ___ ___   |   __|___ _ _ ___ _| 
|___| |_|_|___ ___| | |   | -_|  | | . | .'|  _|   | -_|  |__   | . |  
_|  _| | | | .'|  _| -_|  |   __| . | | |   | . | .'|  _| | . |   |   |_| 
|_|_|___|  |__|__|  _|__,|___|_|_|___|  |_|___|_| |_| |_|__,|_| |___|  
|__|  |___|___|_|_|___|__,|_| |_|___|_|_|    |_|




From: Martin Gainty <mgai...@hotmail.com>
Sent: Tuesday, May 9, 2017 8:05 AM
To: Struts Users Mailing List
Subject: Re: Problem using the Spring's AOP in Struts2's Actions with 
json-plugin

MG>below


From: developer researcher <java.developer.researc...@gmail.com>
Sent: Monday, May 8, 2017 10:14 PM
To: Struts Users Mailing List
Subject: Re: Problem using the Spring's AOP in Struts2's Actions with 
json-plugin

Hello Adam,

Yes, I am using the "ignoreInterfaces" param set to "false". My result is:
"@Result(name="success",type="json", params={"contentType", "text/html",
"ignoreInterfaces", "false"})"

The file "struts-2.5.10.1-all.zip" contains the jackson's jars, so I guess
the json-plugin use jackson.In any case, how would you use your own
serialization instead of the provided by json-plugin for actions that need
AOP?

MG>i was perusing Jackson when i came upon JSON deserialization issue  for 
JsonType.defaultImpl
https://github.com/FasterXML/jackson-databind/issues/1083
[https://avatars2.githubusercontent.com/u/1130553?v=3=400]<https://github.com/FasterXML/jackson-databind/issues/1083>

Field in base class is not recognized, when using 
...<https://github.com/FasterXML/jackson-databind/issues/1083>
github.com
When deserializing JSON to Java POJOS, a field inherited from a base class is 
not recognized. Here is the stack: com.fasterxml.jackson.databind.exc ...



[https://avatars2.githubusercontent.com/u/1130553?v=3=400]<https://github.com/FasterXML/jackson-databind/issues/1083>

Field in base class is not recognized, when using 
...<https://github.com/FasterXML/jackson-databind/issues/1083>
[https://avatars2.githubusercontent.com/u/1130553?v=3=400]<https://github.com/FasterXML/jackson-databind/issues/1083>

Field in base class is not recognized, when using 
...<https://github.com/FasterXML/jackson-databind/issues/1083>
github.com
When deserializing JSON to Java POJOS, a field inherited from a base class is 
not recognized. Here is the stack: com.fasterxml.jackson.databind.exc ...



github.com
When deserializing JSON to Java POJOS, a field inherited from a base class is 
not recognized. Here is the stack: com.fasterxml.jackson.databind.exc ...

MG>which is manifested only in Jackson 2.7.0..more importantly does current 
Jackson codebase care about JsonType.defaultImpl issue?
MG>apparently yes as i see this comment in 
com.fasterxml.jackson.databind.ser.std.StdJdkSerializers
// 09-Jan-2015, tatu: As p

Re: Problem using the Spring's AOP in Struts2's Actions with json-plugin

2017-05-09 Thread Martin Gainty
MG>below


From: developer researcher <java.developer.researc...@gmail.com>
Sent: Monday, May 8, 2017 10:14 PM
To: Struts Users Mailing List
Subject: Re: Problem using the Spring's AOP in Struts2's Actions with 
json-plugin

Hello Adam,

Yes, I am using the "ignoreInterfaces" param set to "false". My result is:
"@Result(name="success",type="json", params={"contentType", "text/html",
"ignoreInterfaces", "false"})"

The file "struts-2.5.10.1-all.zip" contains the jackson's jars, so I guess
the json-plugin use jackson.In any case, how would you use your own
serialization instead of the provided by json-plugin for actions that need
AOP?

MG>i was perusing Jackson when i came upon JSON deserialization issue  for 
JsonType.defaultImpl
https://github.com/FasterXML/jackson-databind/issues/1083
[https://avatars2.githubusercontent.com/u/1130553?v=3=400]<https://github.com/FasterXML/jackson-databind/issues/1083>

Field in base class is not recognized, when using 
...<https://github.com/FasterXML/jackson-databind/issues/1083>
github.com
When deserializing JSON to Java POJOS, a field inherited from a base class is 
not recognized. Here is the stack: com.fasterxml.jackson.databind.exc ...

MG>which is manifested only in Jackson 2.7.0..more importantly does current 
Jackson codebase care about JsonType.defaultImpl issue?
MG>apparently yes as i see this comment in 
com.fasterxml.jackson.databind.ser.std.StdJdkSerializers
// 09-Jan-2015, tatu: As per [databind#1073], let's try to guard 
against possibility
//   of some environments missing `java.sql.` types
MG>in the case of when com.fasterxml.jackson.annotation.JsonTypeInfo references 
a Class for reflection instead of a declared type a
MG>OperationNotSupportedException is thrown

MG>in any case the jackson fix for #1073 JsonType.defaultImpl is supposedly in 
one of the 2.8.x versions @
MG>https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.8
[https://avatars3.githubusercontent.com/u/382692?v=3=400]<https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.8>

Jackson Release 2.8 · FasterXML/jackson Wiki · 
GitHub<https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.8>
github.com
jackson - Main Portal page for Jackson project ... Version 2.8 was released 4th 
of July, 2016. Patches. Beyond initial 2.8.0 (described here), following patch 
...


[https://avatars3.githubusercontent.com/u/382692?v=3=400]<https://github.com/FasterXML/jackson-databind>

GitHub - FasterXML/jackson-databind: General data-binding 
...<https://github.com/FasterXML/jackson-databind>
github.com
jackson-databind - General data-binding package for Jackson (2.x): works on 
streaming API (core) implementation(s)

MG>which i could not find...i would revert to jackson-2.6.3
MG>this wont coerce the jackson datatype to Spring java.sql type for bind 
operation but one it should at least fix the jackson error

In new tests, the problem is focused on actions with a json result.

*1. For **results of **default **type:* If the class extends ActionSupport,
it is necessary to use "CGLIB proxy", if the class does not extend from
ActionSupport it is possible to use both "CGLIB proxy" and "JDK dynamic
proxy".
*2. For results of json **type **:* without AOP everything works fine, with
AOP both using "JDK dynamic proxy" and "CGLIB proxy" the action is
executed, the advice also but in both cases occurs the
OperationNotSupportedException

MG>yes in later jdks that support JDK Dynamic Proxy you should not proxy the 
class
MG>but allow JDKDynamicProxy to instantiate using the declared "type"
MG>(provided the lookup on type is successful)

Thanks


2017-05-08 15:50 GMT-05:00 Adam Brin <ab...@digitalantiquity.org>:

> Hi,
>
> I presume you’ve read this: https://struts.apache.org/
Welcome to the Apache Struts project<https://struts.apache.org/>
struts.apache.org
Google's Patch Reward program. During SFHTML5 Google announced that they extend 
their program to cover the Apache Struts project as well.



> docs/json-plugin.html#JSONPlugin-Proxiedobjects
>
> It may be that the issue is not Struts2, but the JSON library that the
> Struts2 Json plugin uses… and thus, you may need to handle the JSON
> serialization using Jackson or another library.
>
>
> - adam
> --
> _
> Adam Brin
> Director of Technology, Digital Antiquity
> 480.965.1278
>
> > On May 8, 2017, at 12:27 PM, developer researcher <
> java.developer.researc...@gmail.com> wrote:
> >
> > Hello Martin,
> >
> > First of all thanks for the reply, but I'm not sure if my queries have
> been
> > understood. I am 

Re: Problem using the Spring's AOP in Struts2's Actions with json-plugin

2017-05-06 Thread Martin Gainty
MG>below


From: developer researcher 
Sent: Friday, May 5, 2017 10:09 PM
To: Struts Users Mailing List
Subject: Problem using the Spring's AOP in Struts2's Actions with json-plugin

Hello,

I am using Strust 2  with spring-plugin and json-plugin to use:

1. Injection of dependencies: apparently everything is working well.
2. Spring's AOP: works when applied over methods of injected objects in the 
Struts Actions but not when applied over methods of actions (my class extends 
from ActionSupport and I use the @Action annotation at method level)

MG>spring does not know what ActionSupport as it is a Struts classes besides 
which ActionSupport are not considered
MG>spring beans which are simple pojos with a no-arg constructor
https://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html
7. The IoC container - 
Spring
docs.spring.io
As the preceding diagram shows, the Spring IoC container consumes a form of 
configuration metadata; this configuration metadata represents how you as an 
application ...


This situation has generated the following questions:

1. Are the actions created and managed by Spring or Struts? It's supposed to be 
Spring, but I have this doubt because Spring's AOP is supposed to work on 
Spring beans but in my case it does not work and because I do not use the 
Spring's @Component annotation in the Action class

MG>correct but you can also specify a spring-bean in spring-beans.xml in your 
classpath e.g.:


2. Is there a way to use Spring AOP in Struts2 Actions using the "JDK dynamic 
proxies"? I have tested with the following results:

a) When Spring uses "JDK dynamic proxies" the Struts2 Action is not executed 
and the following exception is thrown: NoSuchMethodException (see 
NoSuchMethodException.txt)
b) When Spring uses "CGLIB proxy" in an Action whose result is of the default 
type: the Action works correctly
c) When Spring uses "CGLIB proxy" in an Action whose result is of type json: 
the Struts2 Action is executed but the following exception is thrown: 
OperationNotSupportedException (see OperationNotSupportedException.txt). When I 
do not use AOP this Action works correctly.

MG>builder.bind does not recognise json result-set as a valid 
javax.sql.DataSource..here is an example of builder.bind
 org.springframework.mock.jndi.SimpleNamingContextBuilder builder = new 
org.springframework.mock.jndi.SimpleNamingContextBuilder();
 * DataSource ds = new 
org.springframework.jdbc.datasource.DriverManagerDataSource(...);
 * builder.bind("java:comp/env/jdbc/myds", ds);

MG>as of now JSON is not a valid javax.sql.DataSourceHere is Doc:
In a J2EE container, it is recommended to use a JNDI DataSource provided by
 * the container. Such a javax.sql.DataSource can be exposed as a 
javax.sql.DataSource bean in a Spring
 * ApplicationContext via {@link 
org.springframework.jndi.JndiObjectFactoryBean},
 * for seamless switching to and from a local javax.sql.DataSource bean like 
this class.
 * For tests, you can then either set up a mock JNDI environment through 
Spring's
 * {@link org.springframework.mock.jndi.SimpleNamingContextBuilder}, or switch 
the
 * bean definition to a local javax.sql.DataSource(which is simpler and thus 
recommended).
 *
 * If you need a "real" connection pool outside of a J2EE container, consider
 * http://commons.apache.org/proper/commons-dbcp;>Apache Commons 
DBCP
 * or http://sourceforge.net/projects/c3p0;>C3P0.
 * Commons DBCP's BasicDataSource and C3P0's ComboPooledDataSource are full
 * connection pool beans, supporting the same basic properties as this class
 * plus specific settings (such as minimal/maximal pool size etc).
mg>JSON is not yet a valid javax.sql.DataSource according to Spring

MG>also you have not declared a namespace that NamingContext can reference 
which is causing exception

MG>HTH

Thanks


Re: Blank app fails to build

2016-11-20 Thread Martin Gainty



From: Java House 
Sent: Sunday, November 20, 2016 4:51 AM
To: user@struts.apache.org
Subject: Blank app fails to build

Hello

this is my first attempt with Struts.
I am trying to run the Blank App sample application. I tried first by
creating it using the maven archetype and also tried it through the
struts-examples-master.
I am using
JDK 1.8.0_111,
mvn 3.3.9
Struts 2.5.5

when doing mvn clean install
test fails on the getText() method, I am getting null pointer exception
---
 T E S T S
---
Running example.ConfigTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.886
sec - in example.ConfigTest
Running example.HelloWorldTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.083
sec <<< FAILURE! - in example.HelloWorldTest
testHelloWorld(example.HelloWorldTest)  Time elapsed: 0.082 sec  <<< ERROR!
java.lang.NullPointerException
at example.HelloWorldTest.testHelloWorld(HelloWorldTest.java:31)


I also tried a few older versions of struts but I am always getting
this error. Does anyone has any idea what am I doing wrong?

I am guessing that the getText method fails because it does not find
the properties files.
In the example the properties is under
struts-examples-master\blank\src\main\resources\example\package.properties

I even tried to place the file under the java and rename it the same
as the class
struts-examples-master\blank\src\main\java\example\HelloWorld.properties

MG>possible maven-jetty-plugin is not copying .properties to expected 
WEB-INF\classes\example
MG>when operational struts war expects HelloWorld.properties to be in 
.\WEB-INF\classes\example

ls -al 
struts-2.3.4\src\apps\processing-forms\target\processing-forms\WEB-INF\classes\example

07/30/2012  09:02 AM   238 HelloWorld.properties
07/30/2012  09:02 AM   197 HelloWorld_es.properties
07/30/2012  09:02 AM   238 package.properties
07/30/2012  09:02 AM   197 package_es.properties

MG>please confirm location of properties files

but it didn't help

thank you for your support

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



Re: convention plugin struts.xml interceptors

2016-10-30 Thread Martin Gainty




From: ronald.a.ander...@gmail.com 
Sent: Sunday, October 30, 2016 1:59 PM
To: user@struts.apache.org
Subject: convention plugin struts.xml interceptors

My actions are working fine by following the convention rules - no struts.xml 
required; I need to configure a custom interceptor, so struts.xml is required. 
As soon as I add the struts.xml, the following exception is returned:

Oct 30, 2016 1:54:22 PM org.apache.struts2.dispatcher.Dispatcher error
SEVERE: Exception occurred during processing request: No result defined for 
action net.codejava.struts.LoginAction and result success
No result defined for action net.codejava.struts.LoginAction and result success

How can the struts.xml be configured to ignore the action or how can the 
convention plugin override the struts.xml? Do not want to add the LoginAction 
to the struts.xml

MG>use annotations

@Action("LoginAction") // actually that is not necessary as it is added by 
convention
@Results(
@Result(name="success", location="/Success.jsp")
)
public class LogoninAction {
MG>


Struts2 version->struts2-core-2.3.15.1

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



RE: Redirect URLs have class names added after the action name with # or !

2016-10-24 Thread Martin Gainty



> From: krunal.dhame...@tdsecurities.com
> To: user@struts.apache.org
> Subject: RE: Redirect URLs have class names added after the action name with 
> # or !
> Date: Mon, 24 Oct 2016 20:29:43 +
> 
> Hi Lukaz,
> I am really stuck with this issue. I tried on WebSphere Application Server 
> and this issue is not there only on JBOSS I am getting this.
> 
> But the problem, when Struts is redirecting using action redirect that time 
> only I get this problem, I have manual redirect response.sendredirect from my 
> filter does not cause the same behavior neither Spring filter redirect.
> 
> Does this ring any bell?
MG>nearest i can tell the JBOSS RewriteValve (enabled-default=on) will only 
rewrite if you put in a reg-exp rule inside rewrite.properties on webapp 
classpath whose rules  RewriteValve  implements..an example :
https://developer.jboss.org/thread/234205?_sscc=t
MG>
> Thanks and Regards,
> Krunal Dhamelia
> Consultant | TD Securities Technology Solutions| TD Securities
> 130 Adelaide St W – 9th floor, Toronto, Ont, M5H 3P5
> desk: 416 944 6187  cell: 647 835 3067
> e-mail: krunal.dhame...@tdsecurities.com
> 
> -Original Message-
> From: Dhamelia, Krunal 
> Sent: Tuesday, October 18, 2016 11:30 AM
> To: Struts Users Mailing List
> Subject: RE: Redirect URLs have class names added after the action name with 
> # or !
> 
> Not yet I will try it on Tomcat.
> 
> I was running on Websphere before and can not recall of getting it on that.
> 
> Thanks and Regards,
> Krunal Dhamelia
> Consultant | TD Securities Technology Solutions| TD Securities
> 130 Adelaide St W – 9th floor, Toronto, Ont, M5H 3P5
> desk: 416 944 6187  cell: 647 835 3067
> e-mail: krunal.dhame...@tdsecurities.com
> 
> 
> -Original Message-
> From: Lukasz Lenart [mailto:lukaszlen...@apache.org] 
> Sent: Tuesday, October 18, 2016 1:55 AM
> To: Struts Users Mailing List
> Subject: Re: Redirect URLs have class names added after the action name with 
> # or !
> 
> 2016-10-17 16:30 GMT+02:00 Dhamelia, Krunal 
> :
> > Yep sorry I didn’t see that.
> >
> > Here is how redirect is configured
> >
> > LogonAction has method LogonSuccessful which at the end sets the variable 
> > "nextAction" and returns the result "next" which is a redirect type of 
> > result with location param value set to value of "nextAction".
> >
> >  > class="logonAction">
> > login
> > 
> > ${nextAction}
> > 
> > 
> >  > name="location">j_spring_security_check?j_username=${username}
> > 
> > 
> 
> Hm looks good. Did you try to test on some other container? Tomcat or 
> Jetty?
> 
> 
> 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
> 
> 
> If you wish to unsubscribe from receiving commercial electronic messages from 
> TD Bank Group, please click here or go to the following web address: 
> www.td.com/tdoptout 
> Si vous souhaitez vous désabonner des messages électroniques de nature 
> commerciale envoyés par Groupe Banque TD veuillez cliquer ici ou vous rendre 
> à l'adresse www.td.com/tddesab
> 
> NOTICE: Confidential message which may be privileged. Unauthorized 
> use/disclosure prohibited. If received in error, please go to 
> www.td.com/legal for instructions.
> AVIS : Message confidentiel dont le contenu peut être privilégié. 
> Utilisation/divulgation interdites sans permission. Si reçu par erreur, 
> prière d'aller au www.td.com/francais/avis_juridique pour des instructions.
> B�CB��[��X��ܚX�KK[XZ[
> �\�\�][��X��ܚX�P��]˘\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[
> �\�\�Z[��]˘\X�K�ܙ�B
> B�CB��[��X��ܚX�KK[XZ[�\�\�][��X��ܚX�P��]˘\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[�\�\�Z[��]˘\X�K�ܙ�B
  

RE: Struts2 Rest Mapper Taking Over Non Rest Json Result

2016-09-20 Thread Martin Gainty
to control navigation why not map it?{1}   
 ...
GET: /grid/method="index"when you reference /grid/
struts will call org.healthsmart.NonRestfulAction index method 
https://struts.apache.org/docs/restfulactionmapper.html

or use DMI
  
  /WEB-INF/content/hello.jsphello
add
https://struts.apache.org/docs/action-configuration.html#ActionConfiguration-ActionMappings
I would check struts.mapper.prefixMapping for normal "rest prefixMapping vs 
struts prefixMapping" 
configurationhttps://struts.apache.org/docs/restfulactionmapper.html
if that looks ok as a last result you can implement a custom mapper which will 
read the URL and redirect to correct class 
programaticallyhttp://stackoverflow.com/questions/17697432/struts2-rest-plugin-making-both-struts-actions-rest-actions-work-together-but
Martin 
__ 



> From: paul.zepern...@healthsmart.com
> To: user@struts.apache.org
> Subject: Struts2 Rest Mapper Taking Over Non Rest Json Result
> Date: Tue, 20 Sep 2016 15:28:42 +
> 
> This was also posted to stackoverflow and relevant config information can be 
> seen in the post: 
> http://stackoverflow.com/questions/39593721/struts2-rest-mapper-taking-over-non-rest-json-result
> 
> I am working with the DataTables JS library and am trying to write actions 
> for the grid. I have a api in place that creates the json for me already and 
> I just need to stream it back. I created a custom result to handle this, but 
> the result mapped in the action never runs. No matter what the result type, 
> the REST mapper tries to handle it as soon as it sees that application/json 
> has been requested from the client. I have used the prefix mapping in the 
> configuration to have all url's using /grid to bypass the rest mapper. It 
> seems to be working in some capacity because it runs the correct interceptor 
> stack and is using the @Action annotation information to map the url. 
> However, the result specified is NOT running and is instead being provided by 
> the rest mapper based on the stack trace I am receiving. I would like to 
> completely bypass the rest mapper for any actions in the /grid namespace. 
> Have I done something wrong in the configuration that is still causing rest 
> to be involved in the request to those actions?
> 
> Paul R. Zepernick
> Sr. Programmer Analyst
> 
> 
> 
> 
> 
> 
> Disclaimer: This communication and any files transmitted with it may contain 
> information that is privileged, confidential and/or exempt from disclosure 
> under applicable law. If you are not the intended recipient, you are hereby 
> notified that any disclosure, copying, distribution, or use of the 
> information contained herein (including any reliance thereon) is strictly 
> prohibited. If you received this communication in error, please immediately 
> contact the sender and destroy the material in its entirety, whether in 
> electronic or hard copy format. Thank you.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: Struts 2: running processes/threads in background

2016-07-18 Thread Martin Gainty



> From: lukaszlen...@apache.org
> Date: Mon, 18 Jul 2016 07:49:28 +0200
> Subject: Re: Struts 2: running processes/threads in background
> To: user@struts.apache.org
> 
> Hi,
> 
> "execAndWait" result should be sufficient for your usecase. I was
> wondering if implementing something based on actors would make sense
> but not sure if this will play nicely with Servlets.
MG>could this be a solution to run struts with a Mock Dispatcher?

MG>https://en.wikipedia.org/wiki/Proactor_pattern
MG>is there a struts interface which can be used as Initiator?MG>is there a 
struts interface which can be used as Asynch Operation Processor?
MG>can we assume Actor AsyncOperation would be any method annotated @Async as 
suggested earlier?MG>if so who would manage Spring TaskExecutor..possibly 
struts-spring-plugin?
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2016-07-17 22:13 GMT+02:00 Adam Brin :
> > Execute and Wait would definitely work.  Alternately, if you're using
> > Spring in the background you could use their @Async methodology for simple
> > multi-threading, and just leave Struts for basic AJAX calls to start and
> > check status.
> >
> > On Sun, Jul 17, 2016 at 8:37 AM, Peter Hilzbrich  wrote:
> >
> >> Hello,
> >> I want to use Struts 2 to run my Java business logic in background and
> >> AngularJS for the front-end. I need to implement the following scenario: A
> >> user can make different configuration for the system to run. After
> >> configuration is made, the user clicks "start" and continuously receives
> >> new analysis data (e.g. by requesting data every second). To generate the
> >> analysis data I have to run some business logic in different threads
> >> continuously in background till the user clicks "stop". In my understanding
> >> with Struts 2 the front-end is requesting data which the business logic is
> >> generating as it is requested. Is there are way to start background
> >> processes and let them run long-time? For me, it seems that the
> >> ExecuteAndWaitInterceptor isn't the right choice..
> >>
> >> Best regards
> >> Thomas
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
> >
> > --
> > _
> > Adam Brin
> > Director of Technology, Digital Antiquity
> > 480.965.1278
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: jQuery query

2016-06-29 Thread Martin Gainty



> From: anamika.chouras...@gmail.com
> Date: Wed, 29 Jun 2016 13:57:56 +0530
> Subject: Re: jQuery query
> To: user@struts.apache.org
> 
> You need to put both textboxes of each group in one div, give this div an
> id and than user JQUEry inbuild function to toggle it
> 
> something like this
> $("#fieldGroup1").toggle(); on click event of "Field Group 1" link.
> $("#fieldGroup2").toggle(); on click event of "Field Group 2" link.
> 
>  cssStyle="width: 100%" tooltipIconPath="/images/icons/tooltip.gif">
> 
> 
> 
> Field
> Group 1
> 
> 
> **
>  requiredLabel="true" tooltip="%{getText('theBean.field1.tooltip')}"/>
> 
>  requiredLabel="true" tooltip="%{getText('theBean.field2.tooltip')}"/>
> 
> 
> 
> Field
> Group 2
> 
> 
> * *
>  requiredLabel="true" tooltip="%{getText('theBean.field3.tooltip')}"/>
MG>provided theBean is defined as variable in Action which holds accessors and 
mutators for field3,field4 so in your actionpublic class PatrickAction {private 
 Bean theBean; //theBean holds value, mutator and accessor for field3 and 
field4...MG>
> 
>  requiredLabel="true" tooltip="%{getText('theBean.field4.tooltip')}"/>
> 
> 
MG>since you will implement DIV..flip javascriptTooltip attribute to true..the 
default is false and your JS generateTooltip wont work

https://struts.apache.org/docs/div.html
> 
> On Wed, Jun 29, 2016 at 1:25 PM, Patrick Kelly <
> patrick.ke...@riverdynamics.com> wrote:
> 
> > correct
> >
> >
> > Patrick Kelly
> >
> > PatrickKelly
> > PrincipalConsultant
> > *River**Dynamics*
> >
> > E: patrick.ke...@riverdynamics.com  > >
> > W: www.riverdynamics.com 
> >
> > On 29/06/2016 5:48 PM, Anamika Chourasiya wrote:
> >
> >> Hi
> >>
> >> As per my understanding about the requirement, if the user clicks on the
> >> "Field Group 1"  field 1 and field 2 textboxes should get visible and if
> >> he
> >> again click on the same link they should get disappear. Same functionality
> >> for "Field Group 2". Am I right?
> >>
> >> On Wed, Jun 29, 2016 at 12:39 PM, Patrick Kelly <
> >> patrick.ke...@riverdynamics.com> wrote:
> >>
> >> Hi - I have a struts2 system (version 2.3.16) that contains many forms
> >>> that look like kind of like the example below.
> >>>
> >>> I want to use jquery to add some interactively to the the forms so the
> >>> user can click a link to show/hide all the fields within a field grouping
> >>> so that the heading is still visible but not the fields so the user can
> >>> view/edit just the portion of the form they want.
> >>>
> >>> Has anyone done this type of thing and could you provide the syntax
> >>> including the jquery function and the links to the function from within
> >>> the
> >>> form.
> >>>
> >>> I assume that this will need to use native jquery code rather than
> >>> anything that comes with the jquery struts2 plugin. Let me know if I have
> >>> that wrong.
> >>>
> >>> Thanks in advance.
> >>>
> >>>  >>> cssStyle="width: 100%" tooltipIconPath="/images/icons/tooltip.gif">
> >>>
> >>> 
> >>>  
> >>>  Field
> >>> Group 1
> >>>  
> >>> 
> >>>
> >>>  >>> requiredLabel="true" tooltip="%{getText('theBean.field1.tooltip')}"/>
> >>>
> >>>  >>> requiredLabel="true" tooltip="%{getText('theBean.field2.tooltip')}"/>
> >>>
> >>> 
> >>>  
> >>>  Field
> >>> Group 2
> >>>  
> >>> 
> >>>
> >>>  >>> requiredLabel="true" tooltip="%{getText('theBean.field3.tooltip')}"/>
> >>>
> >>>  >>> requiredLabel="true" tooltip="%{getText('theBean.field4.tooltip')}"/>
> >>>
> >>> 
> >>>
> >>>
> >>> --
> >>> Patrick Kelly
> >>>
> >>> PatrickKelly
> >>> PrincipalConsultant
> >>> *River**Dynamics*
> >>>
> >>> E: patrick.ke...@riverdynamics.com  >>> patrick.ke...@riverdynamics.com
> >>> W: www.riverdynamics.com 
> >>>
> >>>
> >>>
> >>
> >
> 
> 
> -- 
> Anamika Chourasiya
  

RE: interfaces with default methods on actions

2016-06-13 Thread Martin Gainty



> From: ab...@digitalantiquity.org
> Date: Sun, 12 Jun 2016 06:40:03 -0700
> Subject: Re: interfaces with default methods on actions
> To: user@struts.apache.org
> 
> It would be great if we could remove ASM3.  My naive investigation suggests
> that both ASM 3 and ASM 5 share some of the same clases in the same package
> structure which are likely the cause of some of our issues. If it really is
> that one class, it shouldn't be to complex.  Regarding Spring and ASM --
> spring repackages ASM under their own class path to avoid some of the
> compatibility change/issues:
> 
> (historic)
> http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/migration-3.2.html
> (current)
> http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/asm/package-summary.html
> MG>then struts spring plugin referencing spring-core version 3.2 *should* 
> pull ASM5.0.1 inline?MG>then struts spring plugin referencing spring core 
> version 4.x *must* pull ASM5.0.3 inline?
MG>appears that spring-plugin *can* implement spring 3.2 as long as we omit 
JSR-310 date-time, no parameter discovery via -parameters
MG>but spring-plugin may be forced to implement spring-core 4.0.3 as spring 
3.2.x will be deprecated in 2016?MG>can you confirm spring-plugin needs to 
upgrade spring 3.2.x to spring-core 4.0.3 mid 2016?

MG>switching spring-frameworks for compile-time/runtime scenarios can of course 
be handled thru maven profiles (if we know a-priori)
MG>Thanks Adam
> Thanks!
> 
> On Sun, Jun 12, 2016 at 5:42 AM, Martin Gainty <mgai...@hotmail.com> wrote:
> 
> >
> >
> >
> > > From: lukaszlen...@apache.org
> > > Date: Sun, 12 Jun 2016 11:31:26 +0200
> > > Subject: Re: interfaces with default methods on actions
> > > To: user@struts.apache.org
> > >
> > > 2016-06-12 6:46 GMT+02:00 Johannes Geppert <joh...@gmail.com>:
> > > > Is there still any reason to still use asm3?
> > > > Or should we change this with 2.5.x?
> > >
> > > Yes, we should drop ASM3 and the Java8 plugin as well and switch to ASM5.
> >
> > MG> with regards to spring plugin dependencies:
> > spring-beans,spring-core,spring-context,spring-webMG>for testing:
> > spring-testMG>which version of spring dependencies should we use to pull in
> > ASM5 transitive dependency?
> >
> > MG>is there a way to test struts spring plugin will work with ASM5 on
> > Java8 as well as Java7?
> > MG>Thanks Lukasz and Johannes
> > >
> > >
> > > 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
> > >
> >
> >
> 
> 
> 
> -- 
> _
> Adam Brin
> Director of Technology, Digital Antiquity
> 480.965.1278
  

RE: interfaces with default methods on actions

2016-06-12 Thread Martin Gainty



> From: lukaszlen...@apache.org
> Date: Sun, 12 Jun 2016 11:31:26 +0200
> Subject: Re: interfaces with default methods on actions
> To: user@struts.apache.org
> 
> 2016-06-12 6:46 GMT+02:00 Johannes Geppert :
> > Is there still any reason to still use asm3?
> > Or should we change this with 2.5.x?
> 
> Yes, we should drop ASM3 and the Java8 plugin as well and switch to ASM5.

MG> with regards to spring plugin dependencies: 
spring-beans,spring-core,spring-context,spring-webMG>for testing: 
spring-testMG>which version of spring dependencies should we use to pull in 
ASM5 transitive dependency?

MG>is there a way to test struts spring plugin will work with ASM5 on Java8 as 
well as Java7?
MG>Thanks Lukasz and Johannes
> 
> 
> 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: Unable to load configuration

2016-06-07 Thread Martin Gainty



> From: jadt...@gmail.com
> Date: Tue, 7 Jun 2016 22:10:26 +0100
> Subject: Unable to load configuration
> To: user@struts.apache.org
> 
> I have been wasted all this afternoon with a strange error.
> 
> My app only have an action called VerySimpleAction.
> I configured in the struts.xml
> 
> -
> 
> 
> 
>  
> "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> 
> "http://struts.apache.org/dtds/struts-2.3.dtd;>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> /WEB-INF/jsps/verysimple.jsp

Linea Nueve>donde verysimple.jsp?Linea Nueve>where is verysimple.jsp?
> 
> 
> 
> 
> 
> 
> 
> -
> 
> I deployed in the wildly server and i put in the browser:
> 
> localhost:8080/example/verysimple.action
> 
> 
> I found the strange error.
> 
> 
> --
> Context Path:
> /example
> 
> 
> Servlet Path:
> /verysimple.action
> 
> 
> Path Info:
> null
> 
> 
> Query String:
> null
> 
> 
> *Stack Trace*
> Unable to load configuration. - action -
> vfs:/Users/jdeltru/PFC/wildfly-10.0.0.Final/standalone/deployments/example.war/WEB-INF/classes/struts.xml:9:74
> org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:491)
> 
> --
> 
> 
> 9:74 ---> is the line of the action name and class are correctly
> 
> Why?
> 
> The action class exist in the package pfc.struts2.example
> 
> 
> 
> 
> Un saludo,
> José A.

MG>/Saludos/MG>Martín 

RE: struts2-rest-plugin issues getting non-restful urls to cooperate

2016-05-30 Thread Martin Gainty



> From: lukaszlen...@apache.org
> Date: Mon, 30 May 2016 08:18:28 +0200
> Subject: Re: struts2-rest-plugin issues getting non-restful urls to cooperate
> To: user@struts.apache.org
> 
> 2016-05-27 17:41 GMT+02:00 Ken McWilliams :
> > I got it working but I think the documentation could be made with more
> > "hand holding". I'll post a "How to set up struts2 with conventions and
> > both restful and non-restful urls". Then self-answer  the question this
> > weekend with all the configuration and project set-up steps and then post
> > the link here for review, in-case there are any differences/recommendations
> > in setup.
MG>REST response will be plain HTML
MG>non rest SOAP response will be XML so client will need a parser
MG>DOM/SAX/StAX ??MG>thanks ken and lukasz
> 
> Great! Looking forward :)
> 
> 
> Best
> -- 
> Ł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: struts2 interceptor session timeout with ajax

2016-03-30 Thread Martin Gainty
MG>pls see below

> From: lukaszlen...@apache.org
> Date: Wed, 30 Mar 2016 07:59:28 +0200
> Subject: Re: struts2 interceptor session timeout with ajax
> To: user@struts.apache.org
> 
> I think you must use `onSuccessTopics` instead of `onErrorTopics` -
> returning 403 doesn't mean an error

MG>if browser client sees 403 you will want to redirect to a Secure SSL3/TLS 
connection index.jsp default page with username/password fields
MG>FYI: tomcat Connector can define a secure port for redirects on the 
connection via attribute  redirectPort="8443"
http://stackoverflow.com/questions/24736543/tomcat-7-automatically-redirect-https-requests-to-port-8443
> 
> 2016-03-29 21:59 GMT+02:00 fea jabi :
> > Thanks, it worked but now trying this and not sure how to fix this.
> >
> > Have a  on a page.
> > After session timeout trying to click on another tab of tabbed panel should 
> > redirect the user to login page.
> >  panel not firing the onErrorTopics. The javascript function is 
> > not getting called. The server is sending result 403. Please see below and 
> > guide me on how to fix this issue. I am seeing in fire bug that the 403 
> > error is thrown but I am unable to catch it in jsp. Need help with the same.
> >
> > struts.xml
> >
> >  > class="com.xxx.secondPanelAction">
> > 
> >
> > /jsp/secondPanel.jsp
> > 
> > 403
> > User session expired  
> > 
> > 
> > 
> >
> > jsp
> >
> >  > hide="'fade'" collapsible="true" sortable="true" onErrorTopics="loadError">
> >  > onErrorTopics="loadError"/>
> >  > onErrorTopics="loadError"/>
> > 
> >
> > 
> > $(document).ready(function() {
> >   $.subscribe('loadError', function(event, status, data) { 
> > alert('in error');
> >   var status1 = event.status;
> >
> >   if(status1 == 403 ) {
> >   window.location.href = "/Sample/login.action";
> >   }
> > });
> > 
> >
> >
> >
> >
> >
> >
> >
> > 
> > From: Lukasz Lenart 
> > Sent: Friday, March 11, 2016 2:21 PM
> > To: Struts Users Mailing List
> > Subject: Re: struts2 interceptor session timeout with ajax
> >
> > It won't work that way, when using Ajax you must use Ajax to redirect
> > to a login page. You can use something like this
> >
> > http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/
> >
> > so your interceptor must return 403 status code (it can return also an
> > url to login page to redirect to) and you must handle redirect on
> > client side
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > 2016-03-11 15:31 GMT+01:00 fea jabi :
> >> Need help with this please.
> >>
> >> 
> >> From: fea jabi 
> >> Sent: Wednesday, March 9, 2016 10:51 AM
> >> To: user@struts.apache.org
> >> Subject: struts2 interceptor session timeout with ajax
> >>
> >> Have jquery tabbed panel in a jsp page which has a button to Save the form 
> >> in the tabbed panel which is making an ajax call and is working fine.
> >>
> >> Now trying to implement the session management for all requests in the 
> >> application and imlemented the new interceptor to perform the same. Having 
> >> issue with session management with the ajax calls. Have the below package 
> >> for ajax requests in which configured the new interceptor created and the 
> >> default interceptor. But, the below is not redirecting to the login page 
> >> instead opening the popup with login page html in it. what am I missing 
> >> here?
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> true
> >>
> >> true
> >>
> >> jsonResult
> >>
> >> 
> >>
> >> 
> >>
> >> appLogin
> >>
> >> /
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >> 
> >>
> >>
> >> -
> >> 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
> >
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: Different name mapping in Struts 2.3.28 (was Re: [ANN] Apache Struts 2.3.28 GA)

2016-03-30 Thread Martin Gainty
  


> Subject: Re: Different name mapping in Struts 2.3.28 (was Re: [ANN] Apache 
> Struts 2.3.28 GA)
> To: user@struts.apache.org
> From: markus.fisc...@knipp.de
> Date: Wed, 30 Mar 2016 15:20:25 +0200
> 
> Hi Łukasz,
> 
> >> after migrating from Struts 2.3.24.1 to 2.3.28, I get several FreeMarker
> >> template errors for missing/null elements for expressions that worked
> >> fine before, like this:
> >>
> >> ==> iPhone (Method name: isIPhone)
> >>
> >> Expr.   | 2.3.24.1  | 2.3.28
> >> iPhone  | OK| error
> >> IPhone  | OK| OK 

MG>markus ..who/what generates text string iPhone instead of IPhone?..can i 
assume this is USER-AGENT HTTP Header?

MG>does anyone know if new Freemarker 2.3.28+ will provide OGNL workaround for 
this testcase?
> 
> > It's due to fixed OGNL version which properly supports JavaBean
> > Specifications now. You can revert to prior version of OGNL to keep
> > the old behaviour.
> 
> thank you very much for the quick reply (and all your work for the
> Struts project).
> 
> Cheers,
> Markus
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: Specific Exception Handling

2016-03-22 Thread Martin Gainty

Date: Tue, 22 Mar 2016 20:13:37 +
Subject: Specific Exception Handling
From: jadt...@gmail.com
To: user@struts.apache.org

In the example of exception - handling explains how to configure an specific 
exception for an action.
It is simple, only write the exception-mapping into the action node. But i 
don't know how it works and why we need two result nodes.


I understood that if the method throwSecurityException of the Register class 
throws SecurityBreachException, the action returns the result login and then it 
redirects to login.jsp but:
In which part of the app use the URL action actionspecificexeption?
MG>when op first executes login.jsp as seen below:   
 
  /register.jsp
  /login.jsp
   If the method throwsSecurityException always throws 
SecurityBreachException why do we need the other result?

MG>/register.jsp is default result when processed by 
org.apache.struts.register.action.Register that returns SUCCESS
MG>https://struts.apache.org/docs/exception-handling.html
-- 
Un saludo,José A.
MG>¿Claro?MG>/Saludos Cordiales/MG>Martín
  

RE: Log4j dtd

2016-03-21 Thread Martin Gainty
Eclipse cleans classes folder so perhaps put a copy of log4j.xml into \src ?
For maven put a copy of log4j.xml into \src\main\resources
http://stackoverflow.com/questions/9554805/log4j-xml-in-eclipse
Saludos/
Martín
__ 

  


> From: jadt...@gmail.com
> Subject: Re: Log4j dtd
> Date: Mon, 21 Mar 2016 22:21:28 +
> To: user@struts.apache.org
> 
> Well there are some difference between the online documentation tutorial 
> basic-struts and the github examples.
> 
> In the documentation
> log4j.xml
> and in the pom the dependency log4j as artifactId.
> 
> In the github
> lo4j2.xml
> and in the pom the dependency log4j-core like artifactId
> 
> i used the first, i find log4j.jar in my local repository but i still see the 
> Eclipse warning in the xml file
> (file cannot be validated as the XML definition) Eclipse look up in the 
> workspace for log4j.dtd
> 
> Why Eclipse doesn't find did file in the log4j.jar?
> Is there an important difference between log4j and log4j2?
> 
> 
>  
> > On 21 Mar 2016, at 19:44, Lukasz Lenart  wrote:
> > 
> > 2016-03-21 19:00 GMT+01:00 José Antonio Delgado Trujillo 
> > :
> >> Hi,
> >> 
> >> i'm doing the getting started struts2 tutorial and i have a warning 
> >> message with log4j.xml file.
> >> 
> >> In the tutorial the second line in log4j.xml is
> >> 
> >>  >> "log4j.dtd">
> >> 
> >> but eclipse can't located log4j.dtd in my workspace.
> >> 
> >> How can i fix the problem?
> >> isn't there a external place to locate log4j.dtd?
> > 
> > It should be inside a jar with Log4j and why Log4j and not Log4j2?
> > 
> > 
> > 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: how to use ejb 3.1/3.2 in struts2?

2016-03-08 Thread Martin Gainty



> From: hongw...@163.com
> Subject: Re: how to use ejb 3.1/3.2 in struts2?
> Date: Wed, 9 Mar 2016 06:38:39 +0800
> To: user@struts.apache.org
> 
> Hi, Paul
> 
> Thanks your response, yes. I used ee 7, 
> would you share with me some examples?
> 
> Thanks
> 
> Mike

MG>suggest downloading and configuring Glassfish AppServer then download @EJB 
injection examples at

MG>https://glassfish.java.net/javaee5/ejb/examples/Sless.html

MG>look at spring @EJB examples inside 
struts-2.3.18/spring-bom-plugin/spring-framework/spring-context specifically:
.\src\main\java\org\springframework\context\annotation\CommonAnnotationBeanPostProcessor.java
static {ClassLoader cl = 
CommonAnnotationBeanPostProcessor.class.getClassLoader();  try {
   @SuppressWarnings("unchecked")  Class clazz = (Class) 
cl.loadClass("javax.xml.ws.WebServiceRef");   
webServiceRefClass = clazz; }   catch 
(ClassNotFoundException ex) { webServiceRefClass = null;
  }   try {   
@SuppressWarnings("unchecked")  Class 
clazz = (Class) cl.loadClass("javax.ejb.EJB");
ejbRefClass = clazz;}   catch 
(ClassNotFoundException ex) { ejbRefClass = null;   
  }   }
and the @EJB test:

.\src\test\java\org\springframework\context\annotation\CommonAnnotationBeanPostProcessorTests.java
public static class ExtendedEjbInjectionBean extends ResourceInjectionBean {
@EJB(name="testBean4", beanInterface=TestBean.class)
protected ITestBean testBean3;
MG>
> 
> 
> Sent from my iPhone
> 
> > 在 2016年3月8日,23:50,Paul Benedict  写道:
> > 
> > Are you using an EE 7 server? I believe 7 integrates CDI and EJB so you can
> > @Inject your remote bean interfaces. This may also be available in 6, but
> > you'd have to research that.
> > 
> > PS: @EJB is a specialized injection annotation that only deals with EJB.
> > Obviously, but just wanted to point that out.
> > 
> > Cheers,
> > Paul
> > 
> >> On Tue, Mar 8, 2016 at 9:44 AM, Mike Guo  wrote:
> >> 
> >> Hello, everyone.
> >> 
> >> I suppose this is very old question to struts user list.
> >> 
> >> how to use EJB 3.1/3.2 in struts2?
> >> 
> >> I did some research on google.  but I totally no idea what’s the exactly
> >> solution for this.
> >> 
> >> some one said use cdi plugin. but if I use cdi plugin,  I guess it can be
> >> @inject a ebb into action class. but if I want to inject a remote EJB
> >> interface, I think it is not work.
> >> 
> >> also, some one said use JNDI lookup , I suppose it can get it done.  but I
> >> think it is very ugly way for it.
> >> 
> >> 
> >> is there any better solution for this?
> >> 
> >> any comments?
> >> 
> >> 
> >> Many many thanks
> >> 
> >> 
> >> Mike
> >> 
> >> 
> >> 
> >> -
> >> 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: CVE-2015-5209

2016-02-22 Thread Martin Gainty
Hi Brent
apply following regex to exclude vulnerable parameters from Request
"(^|\\%\\{)((#?)(top(\\.|\\['|\\[\")|\\[\\d\\]\\.)?)(dojo|struts|session|request|response|application|servlet(Request|Response|Context)|parameters|context|_memberAccess)(\\.|\\[).*","^(action|method):.*"
https://struts.apache.org/docs/s2-026.html
or upgrade to Struts 2.3.24.1

Good Question!
Martin 
__ 



> Date: Mon, 22 Feb 2016 11:10:39 -0700
> Subject: CVE-2015-5209
> From: brentbark...@gmail.com
> To: user@struts.apache.org
> 
> Hi,
> 
> We are upgrading struts to patch a potential security hole (S2-026
> <https://cwiki.apache.org/confluence/display/WW/S2-026>) I want to ensure
> the vulnerability no longer exists in our application after upgrading to
> v2.3.24.1. Would someone mind pointing me in the right direction to test
> the vulnerability?
> 
> Thanks in advance!
  

RE: Jodd/Madvoc MVC framework

2016-01-26 Thread Martin Gainty
I had the wrong providers listed in $JAVA_HOME/jre/lib/security/java.securityas 
soon as I security.removeProvider SunPKCS11 provider and replaced with 
sun.security.rsa.SunRsaSign I was able to grab the gradle distro and unpack, 
compile, run-tests and assemble
security.provider.10=sun.security.rsa.SunRsaSignsecurity.removeProvider.10=sun.security.pkcs11.SunPKCS11
also igor made 2 changes yesterday which you should incorporate:build.gradle
dependencies:
org.codehaus.groovy:groovy-all:2.2.1 upgraded to 
org.codehaus.groovy:groovy-all:2.4.4
gradle-wrapper.propertiesdistributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zipdistributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
https://github.com/oblac/jodd/compare/master@%7B1day%7D...master
 gradlew.bat build
produced windows specific errors:

513 tests completed, 2 failed, 3 skipped:jodd-core:test FAILED
jodd.io.FileNameUtilTestexpected:<C:\Users\mgainty]/> but 
was:<[~]/>jodd.util.PathUtilTestorg.junit.ComparisonFailure: 
expected:<[/aaa/bbb/]ccc> but was:<[\aaa\bbb\]ccc>
FAILURE: Build failed with an exception.
* What went wrong:Execution failed for task ':jodd-core:test'.> There were 
failing tests. See the report at: 
/jodd2/jodd-core/build/reports/tests/index.html(easily correctable)

I am curious why integration tests need both MySQL Database AND Postgres 
Database?For integration tests you will need also to set up databases named: 
'jodd-test' on localMySql (access: root/root!) and PostgreSQL (postgres/root!).
Thanks Christoph!
Martin
> To: user@struts.apache.org
> Subject: Re: Jodd/Madvoc MVC framework
> From: christoph.nenn...@lex-com.net
> Date: Tue, 26 Jan 2016 10:26:37 +0100
> 
> > I'm just not a fan of declaring things based on strings, including 
> result
> > types.
> > 
> > I don't know what the easiest/best answer is, probably I'll end up doing
> > nothing :(
> > 
> 
> Well, result type strings could be avoided with specialized classes, like
> 
> return new InstantDispatcherResult("foo.jsp");
> return new InstantActionRedirectResult("fooAction");
> 
> 
> Regards,
> Christoph
> 
> This Email was scanned by Sophos Anti Virus
  

RE: Jodd/Madvoc MVC framework

2016-01-25 Thread Martin Gainty
>java -versionjava version "1.8.0_40"Java(TM) SE Runtime Environment (build 
>1.8.0_40-b26)Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
jodd2>gradlew buildDownloading 
https://services.gradle.org/distributions/gradle-2.10-bin.zip
Exception in thread "main" javax.net.ssl.SSLException: 
java.security.ProviderException: SunPKCS11 requires configuration file argument
>gradle 
>-versionGradle 
>2.3Build time:   
>2015-02-16 05:09:33 UTCBuild number: noneRevision: 
>586be72bf6e3df1ee7676d1f2a3afd9157341274Groovy:   2.3.9Ant:  
>Apache Ant(TM) version 1.9.3 compiled on December 23 2013JVM:  
>1.8.0_40 (Oracle Corporation 25.40-b25)OS:   Windows 7 6.1 amd64
is JDK 1.8.0_40 ok?is ANT 1.9.3 ok?
is Gradle 2.3 ok?
is there a SunPKCS11 configuration item missing for  
$JAVA_HOME/jre/lib/security/java.policy?

if I run gradle from the jodd directory I see:
jodd2>gradle
FAILURE: Build failed with an exception.
* What went wrong:Could not resolve all dependencies for configuration 
':runtime'.> Could not resolve org.codehaus.groovy:groovy-all:2.4.4.  Required 
by:  :buildSrc:unspecified   > Could not GET 
'https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.4.4/groovy-all-2.4.4.pom'.
  > peer not authenticatedMG>how to authenticate ?

> Could not resolve org.yaml:snakeyaml:1.13.MG>how to specify repo for this 
> artifact ?

  Required by:  :buildSrc:unspecified   > Could not HEAD 
'https://repo1.maven.org/maven2/org/yaml/snakeyaml/1.13/snakeyaml-1.13.pom'.
  > peer not authenticatedMG>How to authenticate ?

> Could not resolve 
> org.codehaus.groovy.modules.http-builder:http-builder:0.7.1.MG>where is 
> http-builder located ?
  Required by:  :buildSrc:unspecified   > Could not GET 
'https://repo1.maven.org/maven2/org/codehaus/groovy/modules/http-builder/http-builder/0.7.1/http-builder-0.7.1.pom'.
  > peer not authenticated> Could not resolve 
org.apache.httpcomponents:httpmime:4.3.  Required by:  
:buildSrc:unspecified   > Could not GET 
'https://repo1.maven.org/maven2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom'.
  > peer not authenticated
MG>How to authenticate ?
* Try:Run with --stacktrace option to get the stack trace. Run with --info or 
--debug option to get more log output.
BUILD FAILED
Total time: 10.994 secs
thanks!
Martin
__ 

 


From: i...@jodd.org
To: mgai...@hotmail.com
CC: user@struts.apache.org
Subject: Re: Jodd/Madvoc MVC framework
Date: Mon, 25 Jan 2016 19:31:00 +0100

Ok, fixed :) Travis is working 
again.
The issue was that 
gradle 2.10 uses groovy 2.4.4 and we used some old groovy version. We have 
some gradle 
plugins.
Please let me 
know if this worked now. Thanx!

On Mon, Jan 25, 2016 at 
19:19, Igor Spasic <i...@jodd.org> wrote:
Uh, there is some strange gradle (wrapper) 
behavior...Sorry for all the trouble, I will let you know when 
its fixed.
On Mon, Jan 25, 2016 at 
19:11, Igor Spasic <i...@jodd.org> wrote:
Hi!
Can 
you check now? We moved to Gradle 2.10 yesterday, but obviously there was a 
left over from previous version 
(2.6).
Would you be so 
kind to pull the change and try again? It worked 
here.

On Mon, Jan 25, 2016 at 
18:34, Martin Gainty <mgai...@hotmail.com> wrote:



can anyone clone ?
>gradlew buildDownloading 
https://services.gradle.org/distributions/gradle-2.6-all.zip
Exception 
in thread "main" javax.net.ssl.SSLException: 
java.security.ProviderException: SunPKCS11 requires 
configuration file argument
...if I bypass cert checking I 
get the zip...wget --no-check-certificate 
https://services.gradle.org/distributions/gradle-2.6-all.zip

what is 
gradlew missing to download 
https\://services.gradle.org/distributions/gradle-2.6-all.zip 
?
Martin 
 
__ 



> 
Date: Mon, 25 Jan 2016 10:32:45 -0500
> Subject: Re: Jodd/Madvoc MVC 
framework
> From: davelnew...@gmail.com
> To: 
user@struts.apache.org
> 
> I'm just not a fan of declaring 
things based on strings, including result
> types.
> 
> I 
don't know what the easiest/best answer is, probably I'll end up 
doing
> nothing :(
> 
> On Mon, Jan 25, 2016 at 10:01 AM, 
Christoph Nenning <
> christoph.nenn...@lex-com.net> 
wrote:
> 
> > > The async thing is nice; that would be a 
good thing to bring into S2.
> > >
> > > I still 
don't like the string-based action returns; strings are just
> > 
awful.
> > > I don't have a better solution (yet).
> > 
>
> > > It might be a good t

RE: Jodd/Madvoc MVC framework

2016-01-25 Thread Martin Gainty
this is what I have for instructions:
>git clone https://github.com/oblac/jodd.git
>gradlew build
Please verify
Thanks!
Martin
__ 

  


> From: i...@jodd.org
> To: mgai...@hotmail.com
> CC: user@struts.apache.org
> Subject: Re: Jodd/Madvoc MVC framework
> Date: Mon, 25 Jan 2016 19:11:38 +0100
> 
> Hi!
> Can you check now? We moved to Gradle 2.10 yesterday, but obviously there 
> was a
> left over from previous version (2.6).
> Would you be so kind to pull the change and try again? It worked here.
> 
> On Mon, Jan 25, 2016 at 18:34, Martin Gainty <mgai...@hotmail.com> wrote:
> can anyone clone ?
>  > gradlew build Downloading 
> https://services.gradle.org/distributions/gradle-2.6-all.zip
> Exception in thread "main" javax.net.ssl.SSLException: 
> java.security.ProviderExc eption: SunPKCS11 requires configuration file 
> argument
> ...if I bypass cert checking I get the zip... wget --no-check-certificate
> https://services.gradle.org/distributions/gradle-2.6-all.zip
> 
> what is gradlew missing to download
> https\://services.gradle.org/distributions/gradle-2.6-all.zip
> ?
> Martin
> __
> 
> 
> 
>  > Date: Mon, 25 Jan 2016 10:32:45 -0500
>  > Subject: Re: Jodd/Madvoc MVC framework
>  > From: davelnew...@gmail.com
>  > To: user@struts.apache.org
>  >
>  > I'm just not a fan of declaring things based on strings, including 
> result
>  > types.
>  >
>  > I don't know what the easiest/best answer is, probably I'll end up doing
>  > nothing :(
>  >
>  > On Mon, Jan 25, 2016 at 10:01 AM, Christoph Nenning <
>  > christoph.nenn...@lex-com.net> wrote:
>  >
>  > > > The async thing is nice; that would be a good thing to bring into 
> S2.
>  > > >
>  > > > I still don't like the string-based action returns; strings are just
>  > > awful.
>  > > > I don't have a better solution (yet).
>  > > >
>  > > > It might be a good time for me to rethink the code-based config I'd
>  > > > implemented some time ago, e.g., use a Groovy or whatever DSL to 
> config
>  > > the
>  > > > results, that way they end up being code artifacts.
>  > > >
>  > > >
>  > >
>  > > Another approach could be to define a Result class to avoid mapping of
>  > > strings, e.g.:
>  > >
>  > > return new Result("dispatch", "test.jsp");
>  > >
>  > >
>  > > This would keep current result types with all their string-parameters. 
> But
>  > > it would not be necessary to configure them and no name-matching would
>  > > take place.
>  > >
>  > >
>  > >
>  > > Regards,
>  > > Christoph
>  > >
>  > > This Email was scanned by Sophos Anti Virus
>  > >
>  >
>  >
>  >
>  > --
>  > 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>
  

RE: Jodd/Madvoc MVC framework

2016-01-25 Thread Martin Gainty
can anyone clone ?
>gradlew buildDownloading 
>https://services.gradle.org/distributions/gradle-2.6-all.zip
Exception in thread "main" javax.net.ssl.SSLException: 
java.security.ProviderException: SunPKCS11 requires configuration file argument
...if I bypass cert checking I get the zip...wget --no-check-certificate 
https://services.gradle.org/distributions/gradle-2.6-all.zip

what is gradlew missing to download 
https\://services.gradle.org/distributions/gradle-2.6-all.zip 
?
Martin  
__ 



> Date: Mon, 25 Jan 2016 10:32:45 -0500
> Subject: Re: Jodd/Madvoc MVC framework
> From: davelnew...@gmail.com
> To: user@struts.apache.org
> 
> I'm just not a fan of declaring things based on strings, including result
> types.
> 
> I don't know what the easiest/best answer is, probably I'll end up doing
> nothing :(
> 
> On Mon, Jan 25, 2016 at 10:01 AM, Christoph Nenning <
> christoph.nenn...@lex-com.net> wrote:
> 
> > > The async thing is nice; that would be a good thing to bring into S2.
> > >
> > > I still don't like the string-based action returns; strings are just
> > awful.
> > > I don't have a better solution (yet).
> > >
> > > It might be a good time for me to rethink the code-based config I'd
> > > implemented some time ago, e.g., use a Groovy or whatever DSL to config
> > the
> > > results, that way they end up being code artifacts.
> > >
> > >
> >
> > Another approach could be to define a Result class to avoid mapping of
> > strings, e.g.:
> >
> > return new Result("dispatch", "test.jsp");
> >
> >
> > This would keep current result types with all their string-parameters. But
> > it would not be necessary to configure them and no name-matching would
> > take place.
> >
> >
> >
> > Regards,
> > Christoph
> >
> > This Email was scanned by Sophos Anti Virus
> >
> 
> 
> 
> -- 
> 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>
  

RE: Issue with jakarta-stream multipart parser

2016-01-05 Thread Martin Gainty
difficulty locating error message "Prefix string too short"

If I download struts-2.3.4.1 and expand struts2-2.3.4.1 from 
https://www.apache.org/dist/struts/2.3.24.1/
struts2-2.3.24.1>grep -S -l "Prefix string too short" *there are no hits?

Please confirm https://www.apache.org/dist/struts/2.3.24.1/ is the struts 
2.3.4.1 you are working with
Martin 
__ 

 


> To: user@struts.apache.org
> From: stephen+li...@jiglu.com
> Subject: Issue with jakarta-stream multipart parser
> Date: Tue, 5 Jan 2016 15:58:30 +
> 
> I'm having a problem using the jakarta-stream multipart parser when a 
> filename is used that is just a single character long excluding the 
> suffix. This triggers a check in java.io.File.createTempFile that 
> ensures that a supplied prefix must be at least three characters long:
> 
> java.lang.IllegalArgumentException: Prefix string too short
>   at java.io.File.createTempFile(Unknown Source)
>   at 
> org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest.createTemporaryFile(JakartaStreamMultiPartRequest.java:436)
>   at 
> org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest.processFileItemStreamAsFileField(JakartaStreamMultiPartRequest.java:398)
>   at 
> org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest.processUpload(JakartaStreamMultiPartRequest.java:313)
>   at 
> org.apache.struts2.dispatcher.multipart.JakartaStreamMultiPartRequest.parse(JakartaStreamMultiPartRequest.java:247)
>   at 
> org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper.(MultiPartRequestWrapper.java:84)
> 
> Should JakartaStreamMultiPartRequest.createTemporaryFile() add an extra 
> padding character when the prefix is too short? For now I assume the 
> only way to catch it in an action is by looking for that string in the 
> action errors?
> 
> This is with 2.3.24.1.
> 
> Stephen.
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: Annotation example

2015-11-08 Thread Martin Gainty
 – By default, this is set to 
${basedir}/src/main/webapp. If your static sources are in a different location, 
set this parameter 
accordingly.https://wiki.eclipse.org/Jetty/Feature/Jetty_Maven_Plugin#Multiple_webapp_root_directories

?
Saludos
Martín  
   



> From: jadt...@gmail.com
> Subject: Annotation example
> Date: Sun, 8 Nov 2015 21:03:13 +
> To: user@struts.apache.org
> 
> I’ve problem with the annotation example.
> 
> I’ve added the convention-plugin dependency in my POM.
> But when i put localhost:8080/annotations/index tsp the result is NOT FOUND 
> PAGE
> 
> However when i copy the index.jsp in /src/main/webapp all is correct.
> 
> I’m using wildly 9 as server.
> My POM is:
> 
> 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
> pfc.struts2
> annotations
> 0.0.1-SNAPSHOT
> war
> 
> 
> 2.5-BETA2
> 2.3
> UTF-8
> 
> 
> 
> 
> 
> 
> 
> 
>   org.apache.struts
>   struts2-convention-plugin
>   2.5-BETA2
> 
> 
>   javax.servlet
>   javax.servlet-api
>   3.1.0
> 
> 
>   org.apache.struts
>   struts2-core
>   2.5-BETA2
> 
> 
>   org.apache.logging.log4j
>   log4j-core
>   2.3
> 
> 
> 
> 
> 
> 
> maven-compiler-plugin
> 3.3
> 
> 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/
> 
> 
> ${basedir}/src/main/webapp/WEB-INF/web.xml
> 
> 
> 
> 
> 
> Annotations
> Example Struts2 Application using annotationsand convention 
> plugin.
> 
> 
> What is happening?
  

RE: Spring BeanPostProcessor called twice for Struts managed beans

2015-10-15 Thread Martin Gainty



> From: lukaszlen...@apache.org
> Date: Thu, 15 Oct 2015 07:56:24 +0200
> Subject: Re: Spring BeanPostProcessor called twice for Struts managed beans
> To: user@struts.apache.org
> 
> You are probably right :) Please register an issue and target 2.3.25
> as a fix version.
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2015-10-15 6:57 GMT+02:00 CRANFORD, CHRIS :
> > In a recent BeanPostProcessor implementation, I noticed our logic was being 
> > invoked twice in both the before and after initialization callbacks for 
> > struts constructed objects like actions, interceptors, etc while normal 
> > constructed Spring beans via component scanning were only being invoked 
> > once.
> >
> > After debugging in 3.2.24.1, I narrowed the issue down to the 
> > SpringObjectFactory implementation in Xwork2 at lines 194 to 197.  It seems 
> > XWork's implementation manually calls the before and after 
> > BeanPostProcessor callbacks.  Looking at the Spring source for 
> > AbstractAutowireCapableBeanFactory, it seems initializeBean's 
> > implementation also calls these callback methods too, which is what leads 
> > to re-evaluating the struts constructed objects twice.
> >
> > I believe the plugin is based on Spring 3.0.5 (IIRC) and even reviewing the 
> > code base at that release along with the latest 4.2.1 release, both confirm 
> > that initializeBean has always invoked the BeanPostProcessor callbacks 
> > internally and therefore, XWork's implementation really should not worry 
> > with manually invoking them too.
> >
> > Is there a technical reason why the SpringObjectFactory is doing this or is 
> > this an oversight?
> > This just seems like a significant overhead on bean management that could 
> > be avoided, right?
> >
> > Thanks,
> > Chris
MG>2 leads who preceeded Lukasz didnt test out the 
alwaysRespectAutowireStrategy = false logic
MG>no testcase means bug buried deep within code and  never shouldve seen light 
of day in a Continous Integration environment
MG>all features have at least one testcase..so
MG>if juergens spring code detects property assignment on a bean has already 
been set..maybe we can catch detect that 
/**
 * Perform operations after the bean has been instantiated, via a 
constructor or factory method,
 * but before Spring property population (from explicit properties or 
autowiring) occurs.
 * This is the ideal callback for performing field injection on the 
given bean instance.
 * See Spring's own {@link 
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor}
 * for a typical example.
 * @param bean the bean instance created, with properties not having been 
set yet
 * @param beanName the name of the bean
 * @return {@code true} if properties should be set on the bean; {@code 
false}
 * if property population should be skipped. Normal implementations should 
return {@code true}.
 * Returning {@code false} will also prevent any subsequent 
InstantiationAwareBeanPostProcessor
 * instances being invoked on this bean instance.
 * @throws org.springframework.beans.BeansException in case of errors
 */
boolean postProcessAfterInstantiation(Object bean, String beanName) throws 
BeansException;
MG>Good Catch Chris!
> >
> >
> > -
> > 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: Spring BeanPostProcessor called twice for Struts managed beans

2015-10-15 Thread Martin Gainty




> From: chris.cranf...@setech.com
> To: user@struts.apache.org
> Subject: RE: Spring BeanPostProcessor called twice for Struts managed beans
> Date: Thu, 15 Oct 2015 13:26:01 +
> 
> I could be mistaken, but that would only solve not invoking the post 
> instantiation callbacks on the bean and would also imply that the 
> BeanPostProcessor implementations actually implement the 
> InstantiationAwareBeanPostProcessor interface I believe.   It also seems far 
> more logical to put this burn on the dependency injection framework itself, 
> particularly since the framework already manages this bean lifecycle workflow 
> itself.  

MG>how would DI lifecycle framework detect "This Spring bean has already been 
initialised"?
MG>if we can guarantee synchronised access to the initialised bean perhaps some 
manner of registration such as MG>SingletonBeanRegistry.registerSingleton(
MG>http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/config/SingletonBeanRegistry.html#registerSingleton-java.lang.String-java.lang.Object-
MG>afterward we detect "has this initialised bean already been registered" with 
getSingleton(String beanName)
MG>WDYT?
> 
> -Original Message-
> From: Martin Gainty [mailto:mgai...@hotmail.com] 
> Sent: Thursday, October 15, 2015 7:29 AM
> To: Struts Users Mailing List <user@struts.apache.org>
> Subject: RE: Spring BeanPostProcessor called twice for Struts managed beans
> 
> > From: lukaszlen...@apache.org
> > Date: Thu, 15 Oct 2015 07:56:24 +0200
> > Subject: Re: Spring BeanPostProcessor called twice for Struts managed 
> > beans
> > To: user@struts.apache.org
> > 
> > You are probably right :) Please register an issue and target 2.3.25 
> > as a fix version.
> > 
> > 
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> > 
> > 2015-10-15 6:57 GMT+02:00 CRANFORD, CHRIS <chris.cranf...@setech.com>:
> > > In a recent BeanPostProcessor implementation, I noticed our logic was 
> > > being invoked twice in both the before and after initialization callbacks 
> > > for struts constructed objects like actions, interceptors, etc while 
> > > normal constructed Spring beans via component scanning were only being 
> > > invoked once.
> > >
> > > After debugging in 3.2.24.1, I narrowed the issue down to the 
> > > SpringObjectFactory implementation in Xwork2 at lines 194 to 197.  It 
> > > seems XWork's implementation manually calls the before and after 
> > > BeanPostProcessor callbacks.  Looking at the Spring source for 
> > > AbstractAutowireCapableBeanFactory, it seems initializeBean's 
> > > implementation also calls these callback methods too, which is what leads 
> > > to re-evaluating the struts constructed objects twice.
> > >
> > > I believe the plugin is based on Spring 3.0.5 (IIRC) and even reviewing 
> > > the code base at that release along with the latest 4.2.1 release, both 
> > > confirm that initializeBean has always invoked the BeanPostProcessor 
> > > callbacks internally and therefore, XWork's implementation really should 
> > > not worry with manually invoking them too.
> > >
> > > Is there a technical reason why the SpringObjectFactory is doing this or 
> > > is this an oversight?
> > > This just seems like a significant overhead on bean management that could 
> > > be avoided, right?
> > >
> > > Thanks,
> > > Chris
> MG>2 leads who preceeded Lukasz didnt test out the 
> MG>alwaysRespectAutowireStrategy = false logic no testcase means bug 
> MG>buried deep within code and  never shouldve seen light of day in a 
> MG>Continous Integration environment all features have at least one 
> MG>testcase..so if juergens spring code detects property assignment on a 
> MG>bean has already been set..maybe we can catch detect that
> /**
>  * Perform operations after the bean has been instantiated, via a 
> constructor or factory method,
>  * but before Spring property population (from explicit properties or 
> autowiring) occurs.
>  * This is the ideal callback for performing field injection on the 
> given bean instance.
>  * See Spring's own {@link 
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor}
>  * for a typical example.
>  * @param bean the bean instance created, with properties not having been 
> set yet
>  * @param beanName the name of the bean
>  * @return {@code true} if prop

RE: sj:grid --- action errors and highlight the row/row cell that failed validation

2015-10-09 Thread Martin Gainty




> From: zy...@hotmail.com
> To: user@struts.apache.org
> Subject: RE: sj:grid --- action errors and highlight the row/row cell that 
> failed validation
> Date: Fri, 9 Oct 2015 15:50:39 -0400
> 
> Still looking for help on this please...
>  
> > From: zy...@hotmail.com
> > To: user@struts.apache.org
> > Subject: sj:grid --- action errors and highlight the row/row cell that 
> > failed validation
> > Date: Fri, 18 Sep 2015 16:17:33 -0400
> > 
> >  Trying to display action errors when trying to save a row in a   
> >  Is there an example I can follow?
> >  
> > 
> > Followed 
> > 
> > https://code.google.com/p/struts2-jquery/wiki/EditGrid   Simple Edit  
> >  and wrote validate method which is returning the action errors.
> >  
> > 
> > 1. How should be the struts.xml configured? 
MG>one is provided in each sample application

 as success return type is json, what should it be for input?
> >  
> >  > class="xxx.EditAddEmpGridEntryAction">
> > 
> >  
> > 
> > 
> > 
> > /jsp/createFidAddCas.jsp
MG>you didnt specify default type for package so if type attribute is not 
specified, the framework will MG>use the default dispatcher type, which 
forwards to another web resource
https://struts.apache.org/docs/result-configuration.html
> > 
> > 
> >  
> >  
> > 2. how to display these action errors 

/ckeditor/ckeditorError.ftl

https://struts.apache.org/docs/result-types.html

and how to highlight the column cell in the grid that's not valid. 
MG>you have to add stylesheet class which contains, font,size and color of the 
css stylesheet class to the control in question..
MG>here is an example of cranking up the font size for tag id="errorElement"
MG>$("#errorElement").style.fontSize="20px";
> >  
> > 
> > Need help with this please.
MG>you should have enough information 
MG>consider paying for further help in answering your questions
> >   
> 
  

RE: Strict Method Invocation

2015-10-03 Thread Martin Gainty




> From: lukaszlen...@apache.org
> Date: Sat, 3 Oct 2015 09:35:04 +0200
> Subject: Strict Method Invocation
> To: user@struts.apache.org
> 
> Hi,
> 
> I have updated docs about the latest SMI addition:
> 
> https://cwiki.apache.org/confluence/display/WW/Security#Security-StrictMethodInvocation
> https://cwiki.apache.org/confluence/display/WW/Action+Configuration#ActionConfiguration-DynamicMethodInvocation
> 
> wdyt?
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

MG>Dzięki Lukasz
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: Accessing action properties from JSPs

2015-10-03 Thread Martin Gainty
> To: user@struts.apache.org
> From: ch...@christopherschultz.net
> Subject: Accessing action properties from JSPs
> Date: Sat, 3 Oct 2015 11:50:31 -0400
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> All,
> 
> Is this the latest wisdom for accessing action properties from JSPs
> using EL?
> 
> https://struts.apache.org/docs/access-to-valuestack-from-jsps.html
> 
> So if my action has a "public String getItems)" method, I'd like to do
> something as close as possible to this:
> 
> 
> 
> 
> It looks like I can do this very quickly:
> 
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core; prefix="c" %>
> <%@ taglib prefix="s" uri="/struts-tags" %>
> 
> 
> ...
> 
> 
> Is there something I can do to bind "action" to the actual action
> instance?
MG>the jsp is 'bound' inside struts-config.xml to parent 
https://struts.apache.org/docs/action-configuration.html
MG>if on the other hand you want to use a different method to execute then you 
can use DMI
https://cwiki.apache.org/confluence/display/WW/Action+Configuration#ActionConfiguration-DynamicMethodInvocation
> 
> Or I can use the Struts 2 "iterate" tag:
> 
> <%@ taglib prefix="s" uri="/struts-tags" %>
> 
> 
> 
> I realize that this is a simple example, but is there a recommended
> technique, here? EL gives me the ability to do things like print
> values with somewhat less code: "${fn:escapeXml(foo)}" versus
> 
> 
> In general, EL seems to be more universally understood, while the s2
> tags are a bit more specialized.
MG>s2 tag resolution provides access to struts value stack via OGNL 
expression(s)
> 
> Any suggestions are appreciated.
> 
> (After writing all of the above and experimenting, I've found that I
> can reference ${items} in my JSP without doing anything with the
> Struts2 tags: no  required. How is that working?
MG>in that case struts resolves this as a property placed on ValueStack
https://struts.apache.org/docs/tag-syntax.html

Does S2 export
> all my beans from the action (and other places?) to the request
> attributes?).
MG>if specified by scope attrib e.g. 
https://struts.apache.org/docs/set.html

> 
> Thanks,
> - -chris
MG>does that answer your understanding of struts-tags?

> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> 
> iQIcBAEBCAAGBQJWD/lHAAoJEBzwKT+lPKRYAjkQAMfH92JS4kudGX8KJg1FH2zx
> FC0Uvz4GZWtDDZhBy5EPZOuoLZhZevheejQq5dT9uRlWJaSBB39OrT2Lcdv+jNdL
> vSQoP8bSQiHMD76SWe5GfeFcqTH0zNDutmrEiu+YjKcKcWIysDMDVveDrnKvWTQh
> ZB13yys4HaDvE6r/gTxevVExSKcEe5s8GD/HRS9xtF5yjbKbA15i/LXa4XsnQvi+
> guacbXPOewvs9CuRzV1JCR1y4YxJfjb+FJXnO3WtN3V5+kPHj/gE9ne/QcJHsQ2h
> BOLjNve62kt2KRuiDA86c2cESD9Zv763udDfZ1LKI4q8xq4YaFl3uDFnwgB4zgxx
> aIs2ftNnfMdhNXYlWSOFQL1HVA0iY78zsLdw5Xzu7Z9Jhioo20pxnt2PsiFdwa4z
> jkMQAblJcmNCxHkVk1soayzv936GUVqvCIZbjqSQs/oPwZCpJF/fFmsmTTN/G4+R
> iWXo0G9M/Zq9HpcmdXVlpjiGxW7EjTt6bYiqoKi0psvV3Rmy7UPVQUHh8Z9hKGz3
> j5Wvl0m0Zhaf7dWMFpl5FnUICtOi1WUYUT6EQa3+usjEVdvoG/aB+6qreCl4G3Lo
> 1EU8lmT0IRORw6MaxZft152wCLPuGqiS3J+EFDzEexoPMd7M2Z37VF1KwogPA1N/
> AJeYTvrTp5EillHT4ulu
> =QyOq
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
  

RE: Spring Injection Strange behaviour - SOLVED!

2015-09-06 Thread Martin Gainty
"Once you eliminate the impossible, whatever remains, no matter how improbable, 
must be the truth"Arthur Conan Doyle
You had to eliminate the other Tomcats as the cause

"Genius is one percent inspiration and ninety-nine percent perspiration." - 
Thomas A. Edison
Then you set out the hardwork to find where the auto-wiring is happening

By Doyles definition you have "good investigative technique"
By Edisons definition you are a genius

Congratulations Chris!
Martin  
__ 

  


> From: crisp...@gmx.us
> To: user@struts.apache.org
> CC: user@struts.apache.org
> Subject: Re: RE: Spring Injection Strange behaviour - SOLVED!
> Date: Sun, 6 Sep 2015 06:38:47 +0200
> 
> 
> Finally I found the root cause.
>  
> It seems I had some Spring jars of an earlier version in my Tomcat lib 
> directory on my dev machine, since I have more than one version of tomcat on 
> my system I was looking in the wrong instance of tomcat when I was trying 
> identify the cause. Sometimes I am such an idiot.
>  
> Thanks
>  
> Chris
>  
> 
> Sent: Sunday, September 06, 2015 at 3:32 AM
> From: Chris <crisp...@gmx.us>
> To: "Dave Newton" <davelnew...@gmail.com>, "Struts Users Mailing List" 
> <user@struts.apache.org>
> Subject: RE: Spring Injection Strange behaviour
> 
> Hi Dave,
>  
> Thanks for your reply.
>  
> I tried setting the scope of the action bean to prototype  (amoung 100 other 
> things) but it didn't change the behaviour.  I'm using Struts2 with Sping 
> plugin,  jdk1.8.0_51.
>  
> If it wasn't calling the setter that would make more sense, but sine it is 
> calling the setter that makes me beleive he autowiring is working, I just 
> can't understand why its later being set to null. I thought it might be a 
> scope issue but I don't know enough about struts to dig much deeper.
>  
> Thanks
>  
> Chris
>  
> -Original Message-
> From: Dave Newton [mailto:davelnew...@gmail.com]
> Sent: Saturday, September 5, 2015 11:27 PM
> To: Struts Users Mailing List
> Subject: Re: Spring Injection Strange behaviour
>  
> Not sure, but if nothing else the action should be set to `prototype` scope, 
> as they're instantiated per-request.
>  
> Are you using the Struts 2 Spring plugin?
>  
> On Sat, Sep 5, 2015 at 8:47 AM, Chris 
> <crisp...@gmx.us[mailto:crisp...@gmx.us]> wrote:
>  
> > I'm trying to use the Spring plugin to inject a dependency into my
> > action at runtime. This is the first time I've tried this with Struts2
> > so I may have missed something but I'm stumped because I can see the
> > dependency is injected but then the object is later null when I need
> > to use it. Here is my action class code:
> > 
> > public class UserRegisterAction extends ActionSupport {
> > private User user = new User();
> > 
> 
> -
> 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: Textfield onchange --> handling ajax error response to show action errors

2015-09-02 Thread Martin Gainty

> To: user@struts.apache.org
> Subject: RE: Textfield onchange --> handling ajax error response to show 
> action errors
> From: christoph.nenn...@lex-com.net
> Date: Wed, 2 Sep 2015 10:08:16 +0200
> 
> The documentation about ajax-validation might help you:
> 
> http://struts.apache.org/docs/ajax-validation.html
> 
> 
> Basically you have to create JSON with 'errors' like this:
> 
> http://struts.apache.org/docs/ajax-validation.html#AJAXValidation-Howitworks
> 
> 
> And you might use the JavaScript function 
> StrutsUtils.showValidationErrors( ) to display them. Of course you must 
> include struts utils.js to use that function.

MG>this would assume your errors are JSON formatted as:
{"errors": ["Global Error 1", "Global Error 2"],"fieldErrors": {
"field1": ["Field 1 Error 1", "Field 1 Error 2"],"field1": ["Field 2 
Error 1", "Field 2 Error 2"]  }}
MG>

MG>in StrutsUtils.getValidationErrors below if data is POJO return the POJO 
object
MG>otherwise return from position 2 after the /* as seen here
StrutsUtils.getValidationErrors = function(data) {
if (typeof data === "object") {
return data;
}
else {
if (data.indexOf("/* {") === 0) {  // /* { must be in position 0
return eval("( " + data.substring(2, data.length - 2) + " )");
} else {
return null;
}
}
};

MG>later on in StrutsUtils.showValidationErrors johann looks for the enclosing 
Div as seen here:
var enclosingDiv = findWWGrpNode(elem); // find wwgrp div/span
MG>so if your jsp contains NO div...then this wont work

MG>I always have 2 div tags in jsp:

MG>one for normal output response with green color:
WORKS

MG>one for error output response with red color:
DOESNT 
WORK

MG>in postValidation method up to receiving the text
function postValidation(request) { var form = $('form');   //clear 
previous validation errors, if any StrutsUtils.clearValidationErrors(form); 
  //get errors from response var text = request.responseText;
//this is where I would test text for error response or normal response
 if(text.indexOf("error")!=-1) 
{
if(isJson(text) == "false")  error.innerHTML = text; //normal error text
else error.innerHTML = JSON.parse(text);  //JSON error text
}
else 
{
 if(isJson(text) == "false") ok.innerHTML = text;   //normal response text
 else ok.innerHTML = JSON.parse(text);  //JSON response text
 form.submit();
}
} //end postValidation

function isJson( jsonData )
if (typeof jsonData == 'string') 
{

  if (! /^[\[|\{](\s|.*|\w)*[\]|\}]$/.test(jsonData)) 
  {
return "true";
}

}

try 
{
jsonData = $.parseJSON(jsonData);
} 
catch (e) 
{
return "false";
} //any exception will return false
return "true";//valid JSON formatted data 
) //end isJson

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
http://stackoverflow.com/questions/3710204/how-to-check-if-a-string-is-a-valid-json-string-in-javascript-without-using-try
http://www.w3schools.com/jsref/jsref_indexof.asp

HTH
Martin
> 
> 
> 
> regards,
> Christoph
> 
> 
> 
> 
> > From: fea jabi <zy...@hotmail.com>
> > To: "user@struts.apache.org" <user@struts.apache.org>, 
> > Date: 01.09.2015 14:37
> > Subject: RE: Textfield onchange --> handling ajax error response to 
> > show action errors
> > 
> > Can you point me to a link that has the sample which does this 
> > please? I tried but couldn't get the result.
> > 
> > Thanks, for trying to help me on this.
> > 
> > 
> > 
> > > From: lukaszlen...@apache.org
> > > Date: Sun, 30 Aug 2015 15:22:52 +0200
> > > Subject: Re: Textfield onchange --> handling ajax error response 
> > to show action errors
> > > To: user@struts.apache.org
> > > 
> > >  works on server side but JavaScript works on client
> > > side - it isn't possible to join them. You can only mimic its
> > > behaviour by adding the same html structure as  does.
> > > 
> > > 2015-08-28 17:14 GMT+02:00 fea jabi <zy...@hotmail.com>:
> > > >   text-field onchange ---> making ajax call.
> > > >
> > > >
> > > > onsucess ---> everything works fine as needed
> > > >
> > > >
> > > > on failure - > like user entered wrong data ---> How to show
> > the error messages in jsp. I added fieldError but not sure how to 
> > show it in jsp with the ajax stuff.
> > > >
> > > > In jsp
> > > > 
> > > > 
> > > >
> > > > 

RE: sj:autocompleter dependable

2015-08-27 Thread Martin Gainty
based on your other emails it appears you are missing your Struts action class
you are also probably missing struts.xml which defines the Struts Action class 
and results and any configuration params
whats more the jsp you are using probably does not have 
sj=/struts-jquery-tags declaration 
so its best you start with a complete download of 
base the basic struts-jquery-tags with a working Struts Action class

download from
https://github.com/struts-community-plugins/struts2-jquery
download zip

once you have the base struts2-jquery plugin war built and deployed to your 
container
(if you have any problems packaging or deploying you can ping 
us...@maven.apache.org)

then you can add in the sj:autocompleter example from: 
http://struts.jgeppert.com/struts2-jquery-showcase/index.action
to your main jsp

its important that you have a complete Struts Action class deployed and working 
before adding in the sj:autocompleter code

Nota Bene:
list=%{customers} where variable customers should be populated from Action
if the variables are NOT populated in action you can always use hardcoded 
values 
list=[Mary, Lukasz, Dave]
then once you get familiar with Beans and how to use populate accessors and 
mutators with bean contents to customers then you can switch back to populating 
your list
list=%{customers} 

you can also use also use this shortcut to convert array of strings to 
'customers'
private ListString customers;
public ListString getCustomers() {
return Arrays.asList(Mary, Lukasz, Dave);
}

HTH
Martin 
__ 



 From: zy...@hotmail.com
 To: user@struts.apache.org
 Subject: RE: sj:autocompleter dependable
 Date: Wed, 26 Aug 2015 22:07:57 -0400
 
 Thanks, for trying to help me on this. I did add the subscribe java script 
 functions as you've suggested. Still not working. Please need help.
  
   sj:autocompleter
 
 id=publisherNameId
 
 name=publisherName
 
 list=%{publishers}
 
 listValue=name
 
 listKey=code
 
 listLabel=code
 
 selectBox=true
 
 selectBoxIcon=true
 
 key=label.publisherName
 
 onChangeTopics=autocompleteChange
 
 onFocusTopics=autocompleteFocus
 
 onSelectTopics=autocompleteSelect
 
 size=34
 
 maxlength=34
 
 /
 
 
   sj:autocompleter
 
 id=publisherCodeId
 
 name=publisherCode
 
 list=%{publishers}
 
 listValue=code
 
 listKey=name
 
 selectBox=true
 
 selectBoxIcon=true
 
 key=label.publisherCode
 
 size=20 
 
 maxlength=20
 
 onChangeTopics=autocompleteChange
 
 onFocusTopics=autocompleteFocus
 
 onSelectTopics=autocompleteSelect   
 
 /
 
 
 script type=text/javascript 
 
 $(document).ready(function() {
 
 
 
 $.subscribe('autocompleteChange', function(event, data) {
 
 var ui = event.originalEvent.ui;
 
 var message = ui.item.value;
 
 if(ui.item.key) {
 
 message = '( '+ ui.item.key +' ) '+message;
 }
 $('#topics').html('b'+message+'/b');
 });
 
 
 $.subscribe('autocompleteFocus', function(event, data) {
 
 var ui = event.originalEvent.ui;
 
 var message = ui.item.value;
 
 if(ui.item.key) {
 
 message = '( '+ ui.item.key +' ) '+message;
 
 }
 $('#topics').html('u'+message+'/u');
 });
 
 
 
   $.subscribe('autocompleteSelect', function(event, data) {
 var ui = event.originalEvent.ui;
 
 var message = ui.item.value;
 if(ui.item.key) {
 
 message = '( '+ ui.item.key +' ) '+message;
 }
 $('#topics').html('i'+message+'/i');
 });
 
 });   
 /script
  
 
  
  From: mgai...@hotmail.com
  To: user@struts.apache.org
  Subject: RE: sj:autocompleter dependable
  Date: Wed, 26 Aug 2015 20:36:27 -0400
  
  MGfollow the example to the letter
  
  
   From: zy...@hotmail.com
   To: user@struts.apache.org
   Subject: RE: sj:autocompleter dependable
   Date: Wed, 26 Aug 2015 13:21:13 -0400
   
   I tried doing this  onSelectTopics of first autocompleter to select value 
   of the second autocompleter but didn't work. Any suggessions?

   First autocompleter
   sj:autocompleter
   
   onChangeTopics=publisherDescChange
   onSelectTopics=publisherDescSelect  
   .
   /

  MG !-- handle publisherDescChange first with subscribe statement below --
  $.subscribe('publisherDescChange', function(event, data) {
  var ui = event.originalEvent.ui;
  var message = ui.item.value;
  if(ui.item.key) {
  message = '( '+ ui.item.key +' ) '+message;
  }
  $('#topics').html('b'+message+'/b');
  });  
  MG
  
  MG!-- handle publisherDescSelect  with subscribe statement below --
  $.subscribe('publisherDescSelect', function(event, data) {
  var ui = event.originalEvent.ui;
  var message = ui.item.value;
  if(ui.item.key) {
  message = '( '+ ui.item.key +' ) '+message;
  }
  $('#topics').html('i'+message+'/i');
  });
  MG
  
  http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE
  
  MGNow when you select the list is the javascript function for second

RE: sj:autocompleter dependable

2015-08-26 Thread Martin Gainty
MGfollow the example to the letter


 From: zy...@hotmail.com
 To: user@struts.apache.org
 Subject: RE: sj:autocompleter dependable
 Date: Wed, 26 Aug 2015 13:21:13 -0400
 
 I tried doing this  onSelectTopics of first autocompleter to select value of 
 the second autocompleter but didn't work. Any suggessions?
  
 First autocompleter
 sj:autocompleter
 
 onChangeTopics=publisherDescChange
 onSelectTopics=publisherDescSelect  
 .
 /
  
MG !-- handle publisherDescChange first with subscribe statement below --
$.subscribe('publisherDescChange', function(event, data) {
var ui = event.originalEvent.ui;
var message = ui.item.value;
if(ui.item.key) {
message = '( '+ ui.item.key +' ) '+message;
}
$('#topics').html('b'+message+'/b');
});  
MG

MG!-- handle publisherDescSelect  with subscribe statement below --
$.subscribe('publisherDescSelect', function(event, data) {
var ui = event.originalEvent.ui;
var message = ui.item.value;
if(ui.item.key) {
message = '( '+ ui.item.key +' ) '+message;
}
$('#topics').html('i'+message+'/i');
});
MG

http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE

MGNow when you select the list is the javascript function for second 
subscribe('publisherDescSelect' ... called ?
MGNow when you change the list is the javascript function for first 
subscribe('publisherDescChange' ... called ?
MGits important you implement everything you see in the autocompleter example
MGif you do not your results will be 'undefined'
  
  From: zy...@hotmail.com
  To: user@struts.apache.org
  Subject: RE: sj:autocompleter dependable
  Date: Wed, 26 Aug 2015 09:55:53 -0400
  
  As mentioned earlier have 2 autocompleters with same list of Managers. Only 
  difference being the Manger.description is shown as drop down in one and 
  Manager.code is shown in the drop down in another. 
  
  
  In the first autocompleter when Manager.description is selected it should 
  automatically select the second autocompleter with corresponding 
  Manager.code value and vise versa.
  
  
  How to do this?
  
  
   I am new to both struts2 and jquery. Please need help with this.
   
  I tried adding the subscribe mentioned below that didn't auto select the 
  option in the second autocompleter.
  
   
   From: mgai...@hotmail.com
   To: user@struts.apache.org
   Subject: RE: sj:autocompleter dependable
   Date: Tue, 25 Aug 2015 07:09:12 -0400
   
   you will notice in the autocompleter tutorial posted at 
   http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE
   
   there exists a sj:autocompleter with 
   onChangeTopics=autocompleteChangebut there is no (jquery) function 
   subscribed to listen to autocompleteChange topic ..
   if you look at bottom of tutorial you will see:
   $.subscribe('autocompleteChange', function(event, data) {
 var ui = event.originalEvent.ui;
 var message = ui.item.value;
 if(ui.item.key) {
 message = '( '+ ui.item.key +' ) '+message;
 }
 $('#topics').html('b'+message+'/b');
 });
   
   when you publish an event topic you will also need to subscribe listener 
   for the same event topic
   HTH
   Martin
   
From: zy...@hotmail.com
To: user@struts.apache.org
Subject: sj:autocompleter dependable
Date: Mon, 24 Aug 2015 15:59:49 -0400

 I am new to struts2 and need help with the struts2 jquery 
autocompleter tag
 


Have an object 

Publisher

code

description
 
 


In Action

getPublishers()
 


I am trying to use 2 dependable sj:autocompleter tags. In both it 
should display the Publishers list but

 in one it should display the description of publisher and in another 
it should display the code


If the user changes discription in one of the autocompleter then it 
should change the code and vise versa on the second autocompleter.
 


I am not not sure how the selected value goes to the action class. I'll 
want the selected publisher to be set to corresponding Publisher object 
selected to the selectedPublisherOfPublisherDescription attribute. 
 

How will it change the second autocompleter code on change of the first 
one. But, it's not working. Your help is appreciated.
 

I tried the below

sj:autocompleter

id=publisherDescriptionId

name=publisherDescription


value=%{selectedPublisherOfPublisherDescription}

list=%{publishers

RE: OGNL error --- Unexpected Exception caught setting ... on 'class.........

2015-08-26 Thread Martin Gainty



 From: zy...@hotmail.com
 To: user@struts.apache.org
 Subject: OGNL error --- Unexpected Exception caught setting ... on 
 'class.
 Date: Wed, 26 Aug 2015 19:42:36 -0400
 
  Have a Publisher class with attributes
 Publisher ---class
 name
 code
  
 Action class
 private String[] publisherName; //why is this an Array of String 
 instead of String publisherName;
MGwhere are you setting the publisherName?.. in constructor of Action 
class?

 ListPublisher publishers= new ArrayListPublisher();
  
 getters and setters for the same too in it.
  
  
 JSP
   sj:autocompleter
 id=publisherNameId
 
 name=publisherName
 
 list=%{publishers}
 
 listValue=name
 
 listKey=code
 
 listLabel=code
 
 selectBox=true
 
 selectBoxIcon=true
 
 key=label.publisherName
 
 onChangeTopics=publisherNameChange
 
 onFocusTopics=publisherNameFocus
 
 onSelectTopics=publisherNameSelect
 
 size=34
 
 maxlength=34
 
 /
MGwhere is your subscribe javascript function?
  
 When I don't select anything in autocompleter and submit the form seeing this 
 in console
 Unexpected Exception caught setting 'publisherName' on 'class 
 com.xxx.createAction: Error setting expression 'publisherName' with value 
 ['', ]
  
 when I select something in autocompleter and submit the form seeing this in 
 console
 Unexpected Exception caught setting 'publisherName' on 'class 
 com.xxx.createAction: Error setting expression 'publisherName' with value 
 ['macode2', ]
 Unexpected Exception caught setting 'publisherName_widget' on 'class 
 com.xxx.createAction: Error setting expression 'publisherName_widget' with 
 value ['macode2', ]

MGLooks like corruption of values for variables publisherName and 
publisherName_widget
MGcan you get a senior guy from your team to oversee what you're doing?
  
 Is this the right way to declare in the Action class for autocompleter?
MGif none of your action variables are populated then the answer would be no

 Please need help on this.
  
 
  

RE: sj:autocompleter dependable

2015-08-25 Thread Martin Gainty
you will notice in the autocompleter tutorial posted at 
http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE

there exists a sj:autocompleter with 
onChangeTopics=autocompleteChangebut there is no (jquery) function subscribed 
to listen to autocompleteChange topic ..
if you look at bottom of tutorial you will see:
$.subscribe('autocompleteChange', function(event, data) {
var ui = event.originalEvent.ui;
var message = ui.item.value;
if(ui.item.key) {
message = '( '+ ui.item.key +' ) '+message;
}
$('#topics').html('b'+message+'/b');
});

when you publish an event topic you will also need to subscribe listener for 
the same event topic
HTH
Martin

 From: zy...@hotmail.com
 To: user@struts.apache.org
 Subject: sj:autocompleter dependable
 Date: Mon, 24 Aug 2015 15:59:49 -0400
 
  I am new to struts2 and need help with the struts2 jquery autocompleter tag
  
 
 
 Have an object 
 
 Publisher
 
 code
 
 description
  
  
 
 
 In Action
 
 getPublishers()
  
 
 
 I am trying to use 2 dependable sj:autocompleter tags. In both it should 
 display the Publishers list but
 
  in one it should display the description of publisher and in another it 
 should display the code
 
 
 If the user changes discription in one of the autocompleter then it should 
 change the code and vise versa on the second autocompleter.
  
 
 
 I am not not sure how the selected value goes to the action class. I'll want 
 the selected publisher to be set to corresponding Publisher object selected 
 to the selectedPublisherOfPublisherDescription attribute. 
  
 
 How will it change the second autocompleter code on change of the first one. 
 But, it's not working. Your help is appreciated.
  
 
 I tried the below
 
   sj:autocompleter
 
   id=publisherDescriptionId
 
   name=publisherDescription
 
   
 value=%{selectedPublisherOfPublisherDescription}
 
   list=%{publishers}
 
   listValue=description
 
   listKey=code
 
   selectBox=true
 
   selectBoxIcon=true
 
   label=Publisher Description
 
   onChangeTopics=publisherChange
 
/
 

 
   sj:autocompleter
 
   id=publisherCodeId
 
   name=publisherCode
 
   value=%{selectedPublisherOfMPublisherCode}
 
   list=%{publishers}
 
   listValue=code
 
   listKey=description
 
   selectBox=true
 
   selectBoxIcon=true
 
   label=Publisher Code
 
   listenTopics=publisherChange
 
  

RE: Struts2 resource bundle labels not showing up

2015-08-24 Thread Martin Gainty
any reason why you are not supplying line breaks between key1=value1key2=value2 
in properties file:
label.user=Userlabel.password=Password

instead of:
label.user=User
label.password=Password

?
Martin




 From: zy...@hotmail.com
 To: user@struts.apache.org
 Subject: Struts2 resource bundle labels not showing up
 Date: Mon, 24 Aug 2015 08:24:54 -0400
 
 Still need help with this please.
  
  From: zy...@hotmail.com
  To: user@struts.apache.org
  Subject: Struts2 resource bundle labels not showing up
  Date: Fri, 21 Aug 2015 02:17:08 -0400
  
  
  
  Using struts2 in iRad
  
   
  
  1. In src folder have package
  com.xyx.actions  in this have LoginAction.java
  
  2. Created
  resources --  of type  Source Folder
  
  in it I added a package
  com.xyx.actions   in this added LoginAction.properties
  
  I added couple of label and
  error properties in it.
  
   
  
  3. In LoginAction -
  validate method is handling errors and adding the key from
  LoginAction.properties file and on field error in jsp the value from 
  properties
  file is read and displaying in jsp correctly. i.e error messages are 
  showing correct from th properties file.
  
   
  
  4. In the same properties file,
  I added label properties like
  
  label.user=Userlabel.password=Passwordbtn.login=Login 
  errors.user.required=Please enter usererrors.password.required=Please enter 
  password
   
  
  The jsp is not getting the
  label properties and displaying the key itself as label.user s:label 
  key=label.loginInfo/
  s:textfield name=user key=label.user/s:textfield
  s:submit key=btn.login align=center cssClass=button/s:submit
  
  
   
  
  what is that I am
  missing? How to fix this? Any help on this appreciated. Thanks.
  

 
  

RE: Struts2 tabbed panel not working

2015-08-21 Thread Martin Gainty
you'll need to coordinate the URI of the taglib specified in jsp with location 
of the struts-dojo-tags.tld
assuming struts-dojo-tags.tld is located in folder WEB-INF
insert these 4 lines before /webapp in web.xml

   jsp-config
taglib-uri/struts-dojo-tags/taglib-uri
taglib-location/WEB-INF/struts-dojo-tags.tld/taglib-location
/jsp-config

...
/web-app

Martin 



 From: zy...@hotmail.com
 To: user@struts.apache.org
 Subject: RE: Struts2 tabbed panel not working
 Date: Fri, 21 Aug 2015 03:41:14 -0400
 
 Thanks, got this after using the struts2-jquery-plugin.
  
  From: zy...@hotmail.com
  To: user@struts.apache.org
  Subject: RE: Struts2 tabbed panel not working
  Date: Fri, 21 Aug 2015 02:20:26 -0400
  
  Thanks, for your reply. 
   
  sorry, I saw an example on web and tried that. What do I use then? Any 
  example link you can provide please? 
   
  
   
   Date: Fri, 21 Aug 2015 02:13:01 -0400
   Subject: Re: Struts2 tabbed panel not working
   From: davelnew...@gmail.com
   To: user@struts.apache.org
   
   Why are you using the long-deprecated Dojo tags?
   On Aug 21, 2015 2:06 AM, fea jabi zy...@hotmail.com wrote:
   
 Using Struts2.3 . Using the below code to display the tabbed panel but
it's not working. What am I missing in this? All I see is some text of 
Tab1
Tab2 on screen. no css is applied.  Have struts2-dojo-plugin in build 
path.
What else do I need?
   
Using struts2 tiles too. Any help is appreciated.
   
%@ taglib prefix=s uri=/struts-tags %
   
%@ taglib prefix=sx uri=/struts-dojo-tags%
   
html
   
head
   
meta http-equiv=Content-Type content=text/html;
charset=UTF-8  META HTTP-EQUIV=Expires CONTENT=0
 META HTTP-EQUIV=Pragma CONTENT=no-cache   META
HTTP-EQUIV=Cache-Control CONTENT=no-cacheMETA
HTTP-EQUIV=Cache-Control CONTENT=no-store   s:head/
 sx:head/
   
link rel=stylesheet type=text/css
href=theme/test.css   script src=scripts/test.js 
//script
   /head
   
body
   s:form
  sx:tabbedpanel id=tabContainer
   
 sx:div label=Tab 1Tab 1/sx:div
   
 sx:div label=Tab 2Tab 2/sx:div
   
  /sx:tabbedpanel
   
   /s:form
/body
/html
   
   
   

 
  

RE: JSON + REST

2015-08-21 Thread Martin Gainty


 


 Date: Fri, 21 Aug 2015 19:10:27 +0530
 Subject: Re: JSON + REST
 From: ghotankaru...@gmail.com
 To: user@struts.apache.org
 
 I was looking for exactly same thing.
 
 Anyone knows how we can reduce the json result coming from Rest plugin with
 combination of conventions  JSON plugin?
 
 I understand one answer is create model per action but looks like its a
 little too big ask from design perspective.
 
 
 
 On Mon, Aug 12, 2013 at 5:05 PM, Felipe Lorenz 
 felipe.lor...@idealogic.com.br wrote:
 
  Hi,
 
  I'm working on a project using conventions with rest plugin and I am
  looking for a way to restrict the output of the json results. Since the
  Actions class has many attributes, like lists, and so on, would be good if
  I could restrict the output.
 
  I know that json plugin can do it for me using the param includeParams,
  but the rest plugins already has json result, so I dont want to add another
  plugin.
 
  Is there a way to limit the json output just using rest plugin with
  annotations?

org.apache.commons.httpclient.methods.PostMethod method = new
org.apache.commons.httpclient.methods.PostMethod(org.apache.struts2.rest.example.ParameterUtils.getBaseUrl()+/orders.json);
method.setRequestEntity(new 
org.apache.commons.httpclient.methods.StringRequestEntity({\amount\:33}));
org.apache.commons.httpclient.HttpClient httpClient=new 
org.apache.commons.httpclient.HttpClient().
httpClient.executeMethod(method);
String response = method.getResponseBodyAsString();

//A resposta do filtro
 ?

Obrigado!

  Thanks,
 
  Felipe Lorenz
 
 
 
 
 -- 
 
 
 
 *With Best Regards,*
 
 Amol Ghotankar
 Technical Lead
 M: +91 9960 980 419 http://www.cursivetech.com
  

RE: Origin of struts log messages misleading

2015-07-22 Thread Martin Gainty
which is the reason I always put %L  (line number)
in my Log4j PatternLayout

be careful with log4j cache

log4j.logger.classPath.myClass = INFO, CACHE
log4j.appender.CACHE=org.apache.log4j.RollingFileAppender
log4j.appender.CACHE.File = ./logs/cache.log
log4j.appender.CACHE.bufferedIO = false

log4j.appender.CACHE.ImmediateFlush=true //never implement cache without flush

if you dont RollingFileAppender will cache the original entry until its flushed

Martin 



 Subject: Re: Origin of struts log messages misleading
 To: user@struts.apache.org
 From: nhar...@gmx.at
 Date: Wed, 22 Jul 2015 10:12:00 +0200
 
 Hi Martin.
 
 Absolutely true. And Struts doesn't reimplement it anyway. Rather the 
 wrapper around the logger (either JDK, log4j or other) screws up the 
 information that is logged. In my original mail I used JDK (java.util) 
 logging. Now here is an example after I switched struts to log4j:
 
 2015-07-22 09:54:16,333 DEBUG 
 com.opensymphony.xwork2.util.LocalizedTextUtil.debug:73 - Resource 
 bundles reloaded
 2015-07-22 09:54:16,786 DEBUG 
 org.apache.struts2.interceptor.FileUploadInterceptor.debug:73 - 
 Überspringe //home
 2015-07-22 09:54:44,320 DEBUG 
 com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.debug:73 
 - Setting static parameters {}
 
 Notice, that it says it was logged at debug:73 on every line. That is a 
 bit misleading. It's the line number and method of the logging wrapper 
 com.opensymphony.xwork2.util.logging.log4j2.Log4j2Logger.
 The last log line was actually coming from 
 com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept:130.
 
 But Lukasz Lenart said it is worked on anyway. So no big deal.
 
 Regards,
 Norbert.
 
 PS: And yes. log4j is awesome :-)
 
 
 On 21.07.2015 14:24, Martin Gainty wrote:
  Morning Norbert
  ceki gulcu spent years mastering the art of incorporating PatternLayouts 
  and different Appenders into log4j
  Say you have a thread that is spiking CPU or heap when processing a 
  particular algo
  algos code is out of reach from IDEs and you want to test it near Prod 
  environment (where there there are no Ides)
  so you want your logging to NOT add more heap requirement and  to NOT add 
  CPU usage
  Latest 2.3 log4j release version allows asynchronous logging
  imagine having a staggering 2,652,412 log messages processed/sec  (or 
  1,715,344 log messages processed/sec windows) within the same thread
  why should anyone want to duplicate these features when log4j already 
  fulfills those requirements?
 
  http://logging.apache.org/log4j/2.x/
  HTH
  Martin
 
  Subject: Re: Origin of struts log messages misleading
  To: user@struts.apache.org
  From: nhar...@gmx.at
  Date: Tue, 21 Jul 2015 13:00:02 +0200
 
  Alright. Only need to be patient then :-)
 
  Thanks.
 
  On 18.07.2015 19:55, Lukasz Lenart wrote:
  2015-07-17 23:57 GMT+02:00 Norbert Harrer nhar...@gmx.at:
  Hi.
 
  I noticed, that all log messages from struts look like this:
 
  Jul 17, 2015 11:31:39 PM 
  com.opensymphony.xwork2.util.logging.jdk.JdkLogger
  info
  INFO: Parsing configuration file [struts-plugin.xml]
  Jul 17, 2015 11:31:39 PM 
  com.opensymphony.xwork2.util.logging.jdk.JdkLogger
  info
  INFO: Parsing configuration file [struts.xml]
  Jul 17, 2015 11:31:39 PM 
  com.opensymphony.xwork2.util.logging.jdk.JdkLogger
  info
  INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
 
  They are all coming from the logging wrapper
  com.opensymphony.xwork2.util.logging.jdk.JdkLogger.
 
  While this is true, wouldn't it be much more helpful if the log would 
  show
  the actual class that made the logger call?
  Sometimes it's helpful to examine the source code of struts classes where
  log messages come from. But that way it's very hard to find out where the
  log message actually originated from.
  That's why we have deprecated the existing logging layer in XWork and
  switched to Log4j2 in Struts 2.5
 
 
  Regards
 
  -
  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: Origin of struts log messages misleading

2015-07-21 Thread Martin Gainty
Morning Norbert
ceki gulcu spent years mastering the art of incorporating PatternLayouts and 
different Appenders into log4j
Say you have a thread that is spiking CPU or heap when processing a particular 
algo
algos code is out of reach from IDEs and you want to test it near Prod 
environment (where there there are no Ides)
so you want your logging to NOT add more heap requirement and  to NOT add CPU 
usage
Latest 2.3 log4j release version allows asynchronous logging
imagine having a staggering 2,652,412 log messages processed/sec  (or 1,715,344 
log messages processed/sec windows) within the same thread
why should anyone want to duplicate these features when log4j already fulfills 
those requirements?

http://logging.apache.org/log4j/2.x/
HTH
Martin

 Subject: Re: Origin of struts log messages misleading
 To: user@struts.apache.org
 From: nhar...@gmx.at
 Date: Tue, 21 Jul 2015 13:00:02 +0200
 
 Alright. Only need to be patient then :-)
 
 Thanks.
 
 On 18.07.2015 19:55, Lukasz Lenart wrote:
  2015-07-17 23:57 GMT+02:00 Norbert Harrer nhar...@gmx.at:
  Hi.
 
  I noticed, that all log messages from struts look like this:
 
  Jul 17, 2015 11:31:39 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger
  info
  INFO: Parsing configuration file [struts-plugin.xml]
  Jul 17, 2015 11:31:39 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger
  info
  INFO: Parsing configuration file [struts.xml]
  Jul 17, 2015 11:31:39 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger
  info
  INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
 
  They are all coming from the logging wrapper
  com.opensymphony.xwork2.util.logging.jdk.JdkLogger.
 
  While this is true, wouldn't it be much more helpful if the log would show
  the actual class that made the logger call?
  Sometimes it's helpful to examine the source code of struts classes where
  log messages come from. But that way it's very hard to find out where the
  log message actually originated from.
  That's why we have deprecated the existing logging layer in XWork and
  switched to Log4j2 in Struts 2.5
 
 
  Regards
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  

RE: Origin of struts log messages misleading

2015-07-17 Thread Martin Gainty
Norbert:
you can always dig out the class name e.g. 
logger.getClass().getName()

OR implement log4j and configure log4j.xml thusly:

Configuration status=warn name=MyApp packages=
  Appenders
File name=MyFile fileName=logs/app.log
  PatternLayout
Pattern%2 %d %p %c{1.} [%t] %m%n/Pattern
  /PatternLayout
/File

/Appenders
/Configuration

Pattern of %2 is your class name
http://logging.apache.org/log4j/2.x/faq.html

best regards,
Martin



 To: user@struts.apache.org
 From: nhar...@gmx.at
 Subject: Origin of struts log messages misleading
 Date: Fri, 17 Jul 2015 23:57:36 +0200
 
 Hi.
 
 I noticed, that all log messages from struts look like this:
 
 Jul 17, 2015 11:31:39 PM 
 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
 INFO: Parsing configuration file [struts-plugin.xml]
 Jul 17, 2015 11:31:39 PM 
 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
 INFO: Parsing configuration file [struts.xml]
 Jul 17, 2015 11:31:39 PM 
 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
 INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
 
 They are all coming from the logging wrapper 
 com.opensymphony.xwork2.util.logging.jdk.JdkLogger.
 
 While this is true, wouldn't it be much more helpful if the log would 
 show the actual class that made the logger call?
 Sometimes it's helpful to examine the source code of struts classes 
 where log messages come from. But that way it's very hard to find out 
 where the log message actually originated from.
 
 I am using:
 struts-2.3.24
 tomcat-7.0.61
 
 Thanks and regards,
 Norbert.
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  

RE: [s1] ActionForward redirect to localhost loses the hostname

2015-06-28 Thread Martin Gainty
//ActionMapping#findForward code
public ActionForward findForward(String forwardName) {
ForwardConfig config = findForwardConfig(forwardName);

if (config == null) {
config = getModuleConfig().findForwardConfig(forwardName);
}

if (config == null) {
if (log.isWarnEnabled()) {
log.warn(Unable to find ' + forwardName + ' forward.);
}
}

return ((ActionForward) config);
}

//findForwardConfig defined in ActionConfig.java
public ForwardConfig findForwardConfig(String name) {
return ((ForwardConfig) forwards.get(name));
}

//where forwards is a HashMap defined in ActionConfig
/**
 * p The set of local forward configurations for this action, if any,
 * keyed by the codename/code property. /p
 */
protected HashMap forwards = new HashMap();
//no stripping of localhost or sending back HTTP status code 302

/* alternative 2 */
//getModuleConfig() from ActionConfig
public ModuleConfig getModuleConfig() {
return (this.moduleConfig);
}

//which is referenced by impl class ActionConfig and routed to 
findForwardConfig implementor
public ForwardConfig findForwardConfig(String name) {
return ((ForwardConfig) forwards.get(name));
}

//pulls the forwards entry keyed by name directly from HashMap defined here
protected HashMap forwards = new HashMap();

so the solution from your end is to supply a rel= parameter when you make the 
call

in Javascript:
window.location = http://localhost:8080 + response.data;
in java:
org.apache.struts.action.ActionForward validActionForward;
try {
 validActionForward = mapping.findForward(success);
}
catch(Exception e)
{
 boolean redirect=true; //if you have no session data
//boolean redirec=false; //if you have session data you want to preserve
 validActionForward= new 
org.apache.struts.action.ActionForward(http://localhost:8080/path/to/something.do;,
 boolean redirect);
}
return validActionForward;
my question to Tomcat expert is I need to replace an incorrect version jar 
which now exists in Tomcat-7.0.40 bootclasspath
How do i do that

?
Martin 
__ 

   


 Date: Fri, 26 Jun 2015 17:45:20 -0400
 From: ch...@christopherschultz.net
 To: user@struts.apache.org
 Subject: [s1] ActionForward redirect to localhost loses the hostname
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 All,
 
 I'm running Struts 1.3.8 (yeah, I know), and I'm having an odd
 experience with certain actions.
 
 I'll do something simple like:
 
   return mapping.findForward(success);
 
 ... where the success forward is defined like this:
 
 forward name=success
  path=/path/to/something.do
  redirect=true /
 
 This has been working fine ... basically forever. For some reason
 lately, when working on my own dev environment (localhost), I'll get a
 response from the server like this:
 
 302 Found
 ...
 Location: http://webapp/path/to/something.do
 
 i.e. completely losing the localhost that used to be in there.
 
 This does not happen on all pages. I can't seem to isolate anything
 that might be different about this redirect than any others.
 
 Any clues as to what might be happening?
 
 Thanks,
 - -chris
 -BEGIN PGP SIGNATURE-
 Comment: GPGTools - http://gpgtools.org
 
 iQIcBAEBCAAGBQJVjcfwAAoJEBzwKT+lPKRYaa0P/RUgp98IYrNGxKdyCO84buUT
 xAhY4XouuD8qpTxwWtw/nGxhNQB2dNFThYvveTlyGITyFbV0aDBjhoc4lOqdRi4S
 snZkAUbvcfwzexSKnW6U+dX1UIiSiM3s9W4ZByfYoPJyWDmN73/Lg4yXGu3lfmmc
 3nkxJWEKGzmC1OTnfDbtrQGem8nITwa/Nrobbp8J1+0Nz1KgyQi1I7jM+/oi4fcq
 ISHX+8+P+GKZ8O0yVutnZ/+CJ6oisuaQdB1b9gOr1IVZt7zu059KyidMQQL1OVvi
 67aHAuqJ+NyOSk3BzX8FZtxIX5EeDb8ULRT9pxMjRMad5JRdzcu/PN0oOichCSv5
 Nd3uHxwHdAadOLi/abq2YKWEPSQkWGBOmdNvqSqHJJK35PPRVCG7tLHqG+r9edHo
 dzTihYZAyT6Lisu03z6RSVyavlxwa5wVb4lbypROewX0TRcEaDc1jOgytRROf2WA
 pLzEz3CdytZU8S0Ra7QDrxOqREqt21OvKWssTsbRq0EAq9uf986MfXIgt0m+JT3o
 iSKisRj+bs4CNtI68ZKoCpLs7PmcPP/plWrEGCHVXnYzlIAiILDDYmy4W/M+SpS5
 NaZ0MGOfMmKiVVSAWXGbUl4VuqgwWmGoWGR+2oyYtcfbFsSHUL9uw5nEXyWQDxVy
 cDOWiZOhDODH7d01ybq5
 =OpHv
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  

RE: Get single value from a row with displaytag and struts 2

2015-06-17 Thread Martin Gainty
Hi Chris-
i dont see documentId in TableTag.java from displaytag source ?

/**
 * Licensed under the Artistic License; you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://displaytag.sourceforge.net/license.html
 *
 * THIS PACKAGE IS PROVIDED AS IS AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */
package org.displaytag.tags;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.LongRange;
import org.apache.commons.lang.math.Range;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.displaytag.decorator.DecoratorFactory;
import org.displaytag.decorator.TableDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.exception.ExportException;
import org.displaytag.exception.FactoryInstantiationException;
import org.displaytag.exception.InvalidTagAttributeValueException;
import org.displaytag.exception.ObjectLookupException;
import org.displaytag.exception.WrappedRuntimeException;
import org.displaytag.export.BinaryExportView;
import org.displaytag.export.ExportView;
import org.displaytag.export.ExportViewFactory;
import org.displaytag.export.TextExportView;
import org.displaytag.model.Cell;
import org.displaytag.model.Column;
import org.displaytag.model.ColumnIterator;
import org.displaytag.model.HeaderCell;
import org.displaytag.model.Row;
import org.displaytag.model.RowIterator;
import org.displaytag.model.TableModel;
import org.displaytag.pagination.SmartListHelper;
import org.displaytag.properties.MediaTypeEnum;
import org.displaytag.properties.SortOrderEnum;
import org.displaytag.properties.TableProperties;
import org.displaytag.util.Anchor;
import org.displaytag.util.CollectionUtil;
import org.displaytag.util.DependencyChecker;
import org.displaytag.util.Href;
import org.displaytag.util.ParamEncoder;
import org.displaytag.util.RequestHelper;
import org.displaytag.util.RequestHelperFactory;
import org.displaytag.util.TagConstants;


/**
 * This tag takes a list of objects and creates a table to display those 
objects. With the help of column tags, you
 * simply provide the name of properties (get Methods) that are called against 
the objects in your list that gets
 * displayed. This tag works very much like the struts iterator tag, most of 
the attributes have the same name and
 * functionality as the struts tag.
 * @author mraible
 * @author Fabrizio Giustina
 * @version $Revision: 1.99 $ ($Author: fgiust $)
 */
public class TableTag extends HtmlTableTag
{

/**
 * name of the attribute added to page scope when exporting, containing an 
MediaTypeEnum this can be used in column
 * content to detect the output type and to return different data when 
exporting.
 */
public static final String PAGE_ATTRIBUTE_MEDIA = mediaType; //$NON-NLS-1$

/**
 * If this variable is found in the request, assume the export filter is 
enabled.
 */
public static final String FILTER_CONTENT_OVERRIDE_BODY = //
org.displaytag.filter.ResponseOverrideFilter.CONTENT_OVERRIDE_BODY; 
//$NON-NLS-1$

/**
 * D1597A17A6.
 */
private static final long serialVersionUID = 899149338534L;

/**
 * logger.
 */
private static Log log = LogFactory.getLog(TableTag.class);

/**
 * RequestHelperFactory instance used for link generation.
 */
private static RequestHelperFactory rhf;

/**
 * Object (collection, list) on which the table is based. This is not set 
directly using a tag attribute and can be
 * cleaned.
 */
protected Object list;

// -- start tag attributes --

/**
 * Object (collection, list) on which the table is based. Set directly 
using the list attribute or evaluated from
 * expression.
 */
protected Object listAttribute;

/**
 * actual row number, updated during iteration.
 */
private int rowNumber = 1;

/**
 * name of the object to use for iteration. Can contain expressions.
 */
private String name;

/**
 * property to get into the bean defined by name.
 * @deprecated Use expressions in name attribute
 */
private String 

RE: Issues with Tomcat 7.0.57 not loading ActionServlets

2015-05-24 Thread Martin Gainty
No Problem...that is what we are here for

Have a Productive Week Raj!
Martin Gainty 
__ 




 Date: Sat, 23 May 2015 16:05:55 -0500
 Subject: Re: Issues with Tomcat 7.0.57 not loading ActionServlets
 From: bsudershan...@gmail.com
 To: user@struts.apache.org
 
 Hi Martin,
 The dtd for validations.xml, validator-rules.xml and struts-config.xml are
 not same and that was causing this issue. However, this is fixed after made
 it same for all.
 
 Thanks a lot Martin for all your help
 
 -Raj
 
 
 
 On Sat, May 23, 2015 at 12:07 PM, Raj bsudershan...@gmail.com wrote:
 
  Hi Martin,
  I have verified tiles.jar file was not there under /WEB_INF/lib folder but
  I have added *struts-tiles-1.3.10.jar *under /WEB_INF/lib folder and
  still does not make any difference. Even the old application does not have
  tiles.jar file. we just deployed the old application on the new tomcat
  7.0.57.
 
  Here is what we have in struts-config.xml
 
/action-mappings
 
message-resourcesparameter=ApplicationResources/
 
plug-in className=org.apache.struts.validator.ValidatorPlugIn
 
  set-property  property=pathnames
 
  value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/
 
/plug-in
 
  Here is what we have in web.xml
 
  !-- Action Servlet Configuration --
 
 servlet
 
  servlet-nameaction/servlet-name
 
  servlet-classorg.apache.struts.action.ActionServlet/servlet-class
 
  init-param
 
   param-nameconfig/param-name
 
   param-value/WEB-INF/struts-config.xml/param-value
 
  /init-param
 
  load-on-startup1/load-on-startup
 
  /servlet
 
 
  we even tried your suggestion of removing the validator-rules.xml from the
  struts-config.xml but of no use. The exception we are seeing is not giving
  enough details. Is there any other way we can get more detail exceptions.
 
 
  Thanks
 
  Raj
 
  On Thu, May 21, 2015 at 7:50 PM, Martin Gainty mgai...@hotmail.com
  wrote:
 
  If Maven is a Lamborghini ..then Ant is a Yugo
  You can drive to end of the block with Yugo if you dont mind repairing it
  every few feet
  Once you start driving your builds with Maven I guarantee you *wont* go
  back to Ant
 
  *keep us apprised*
  Martin
  __
 
 
 
   Subject: Re: Issues with Tomcat 7.0.57 not loading ActionServlets
   From: bsudershan...@gmail.com
   Date: Tue, 19 May 2015 11:28:48 -0500
   To: user@struts.apache.org
  
   Hi Martin,
   Thanks for your quick response
  
   We are not using Maven. It's ant build and have got no documentation. I
  have just started supporting this application with no proper documentation.
   I will check if tiles.jar file exists under lib folder and get back to
  you after working on your suggestions
  
   Thanks
   Raj
  
   Sent from my iPhone
  
On May 19, 2015, at 5:33 AM, Martin Gainty mgai...@hotmail.com
  wrote:
   
please confirm url,connection,developerConnection entries are pointed
  to struts1 in scm section your pom.xml:
   
 scm
  connectionscm:svn:
  http://svn.apache.org/repos/asf/struts/struts1/trunk/connection
  developerConnectionscm:svn:
  https://svn.apache.org/repos/asf/struts/struts1/trunk
  /developerConnection
  urlhttp://svn.apache.org/viewcvs.cgi/struts/struts1/trunk
  /url
   /scm
   
please confirm the commons-validator dependency is present in pom.xml:
  dependency
   groupIdcommons-validator/groupId
   artifactIdcommons-validator/artifactId
   version1.3.1/version
   exclusions
   exclusion
   groupIdxml-apis/groupId
   artifactIdxml-apis/artifactId
   /exclusion
   /exclusions
   /dependency
   
please confirm  validatorValidatorPlugin exists in
  /WEB-INF/struts-config.xml e.g
   
plug-in className=org.apache.struts.validator.ValidatorPlugIn
   set-property property=pathnames
   
  value=/org/apache/struts/validator/validator-rules.xml,
/WEB-INF/validation.xml/
 /plug-in
   
please confirm you added add tiles.jar to WEB-INF/lib
   
finally when something goes awry I usually comment out the
  validator-rules,xml configuration and bring in one validator entry at a
  time
!---
validator...
validator..
--
if Servlet still wont load then you may have a misconfigure in
  struts-config.xml or even possibly misconfig in web.xml
or possibly omitted required parameter in pom.xml
   
if Servlet DOES load then you can enable each of the validators in
  validator-rules.xml one at a time
   
Let us know how it goes,
Martin
__
   
Subject: Re: Issues with Tomcat 7.0.57 not loading

RE: Issues with Tomcat 7.0.57 not loading ActionServlets

2015-05-21 Thread Martin Gainty
If Maven is a Lamborghini ..then Ant is a Yugo
You can drive to end of the block with Yugo if you dont mind repairing it every 
few feet
Once you start driving your builds with Maven I guarantee you *wont* go back to 
Ant

*keep us apprised*
Martin 
__ 




 Subject: Re: Issues with Tomcat 7.0.57 not loading ActionServlets
 From: bsudershan...@gmail.com
 Date: Tue, 19 May 2015 11:28:48 -0500
 To: user@struts.apache.org
 
 Hi Martin,
 Thanks for your quick response 
 
 We are not using Maven. It's ant build and have got no documentation. I have 
 just started supporting this application with no proper documentation.
 I will check if tiles.jar file exists under lib folder and get back to you 
 after working on your suggestions
 
 Thanks
 Raj
 
 Sent from my iPhone
 
  On May 19, 2015, at 5:33 AM, Martin Gainty mgai...@hotmail.com wrote:
  
  please confirm url,connection,developerConnection entries are pointed to 
  struts1 in scm section your pom.xml:
  
   scm

  connectionscm:svn:http://svn.apache.org/repos/asf/struts/struts1/trunk/connection

  developerConnectionscm:svn:https://svn.apache.org/repos/asf/struts/struts1/trunk/developerConnection
urlhttp://svn.apache.org/viewcvs.cgi/struts/struts1/trunk/url
 /scm
  
  please confirm the commons-validator dependency is present in pom.xml:
dependency
 groupIdcommons-validator/groupId
 artifactIdcommons-validator/artifactId
 version1.3.1/version
 exclusions
 exclusion
 groupIdxml-apis/groupId
 artifactIdxml-apis/artifactId
 /exclusion
 /exclusions
 /dependency
  
  please confirm  validatorValidatorPlugin exists in 
  /WEB-INF/struts-config.xml e.g
  
  plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property property=pathnames 
   
  value=/org/apache/struts/validator/validator-rules.xml,
  /WEB-INF/validation.xml/
   /plug-in
  
  please confirm you added add tiles.jar to WEB-INF/lib
  
  finally when something goes awry I usually comment out the 
  validator-rules,xml configuration and bring in one validator entry at a 
  time
  !---
  validator...
  validator..
  --
  if Servlet still wont load then you may have a misconfigure in 
  struts-config.xml or even possibly misconfig in web.xml
  or possibly omitted required parameter in pom.xml
  
  if Servlet DOES load then you can enable each of the validators in 
  validator-rules.xml one at a time
  
  Let us know how it goes,
  Martin 
  __ 
  
  Subject: Re: Issues with Tomcat 7.0.57 not loading ActionServlets
  From: bsudershan...@gmail.com
  Date: Mon, 18 May 2015 17:40:12 -0500
  To: user@struts.apache.org
  
  Yes Martin,
  That file does exists in that folder.
  
  Thanks
  Raj
  
  Sent from my iPhone
  
  On May 16, 2015, at 7:54 PM, Martin Gainty mgai...@hotmail.com wrote:
  
  Raj-
  
  did you check for the existence of 
  /WEB-INF/validator-rules.xmlin 
  $TOMCAT_HOME/webapps/NameOfYourWebappGoesHere
  ?
  Martin 
  __ 
  
  
  
  Date: Wed, 6 May 2015 20:29:34 -0500
  Subject: Issues with Tomcat 7.0.57 not loading ActionServlets
  From: bsudershan...@gmail.com
  To: user@struts.apache.org
  
  I upgraded my application from tomcat 5.5.15, JDK 1.5, Struts 1.1 on 
  Debian
  2.6.32 to
  tomcat 7.0.57, JDK 1.6, struts 1.1 on ubuntu14.04 and Action Servlets are
  not loading.
  I am thinking of this is something to do with version conflict. Please 
  let
  me know what I am missing.
  
  Below is the error
  
  Apr 24, 2015 9:00:20 PM org.apache.catalina.core.ApplicationContext log
  
  INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain:
  [org.apache.webapp.balancer.RuleChain: RoundRobinRule@643fd34a]
  
  Apr 24, 2015 9:00:20 PM org.apache.catalina.core.ApplicationContext log
  
  INFO: Marking servlet action as unavailable
  
  Apr 24, 2015 9:00:20 PM org.apache.catalina.core.StandardContext
  loadOnStartup
  
  SEVERE: Servlet  threw load() exception
  
  javax.servlet.UnavailableException: Cannot load a validator resource from
  '/WEB-INF/validator-rules.xml'
  
  at
  org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174)
  
  at
  org.apache.struts.action.ActionServlet.initModulePlugIns(
  ActionServlet.java:839)
  
  at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
  
  at javax.servlet.GenericServlet.init(GenericServlet.java:158)
  
  at
  org.apache.catalina.core.StandardWrapper.initServlet(
  StandardWrapper.java:1284)
  
  at
  org.apache.catalina.core.StandardWrapper.loadServlet(
  StandardWrapper.java:1197

RE: Issues with Tomcat 7.0.57 not loading ActionServlets

2015-05-19 Thread Martin Gainty
please confirm url,connection,developerConnection entries are pointed to 
struts1 in scm section your pom.xml:

  scm
   
connectionscm:svn:http://svn.apache.org/repos/asf/struts/struts1/trunk/connection
   
developerConnectionscm:svn:https://svn.apache.org/repos/asf/struts/struts1/trunk/developerConnection
   urlhttp://svn.apache.org/viewcvs.cgi/struts/struts1/trunk/url
/scm

please confirm the commons-validator dependency is present in pom.xml:
   dependency
groupIdcommons-validator/groupId
artifactIdcommons-validator/artifactId
version1.3.1/version
exclusions
exclusion
groupIdxml-apis/groupId
artifactIdxml-apis/artifactId
/exclusion
/exclusions
/dependency

please confirm  validatorValidatorPlugin exists in /WEB-INF/struts-config.xml 
e.g

 plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames 
  value=/org/apache/struts/validator/validator-rules.xml,
 /WEB-INF/validation.xml/
  /plug-in

please confirm you added add tiles.jar to WEB-INF/lib

finally when something goes awry I usually comment out the 
validator-rules,xml configuration and bring in one validator entry at a time
!---
 validator...
validator..
--
if Servlet still wont load then you may have a misconfigure in 
struts-config.xml or even possibly misconfig in web.xml
or possibly omitted required parameter in pom.xml

if Servlet DOES load then you can enable each of the validators in 
validator-rules.xml one at a time

Let us know how it goes,
Martin 
__ 

 Subject: Re: Issues with Tomcat 7.0.57 not loading ActionServlets
 From: bsudershan...@gmail.com
 Date: Mon, 18 May 2015 17:40:12 -0500
 To: user@struts.apache.org
 
 Yes Martin,
 That file does exists in that folder.
 
 Thanks
 Raj
 
 Sent from my iPhone
 
  On May 16, 2015, at 7:54 PM, Martin Gainty mgai...@hotmail.com wrote:
  
  Raj-
  
  did you check for the existence of 
  /WEB-INF/validator-rules.xmlin $TOMCAT_HOME/webapps/NameOfYourWebappGoesHere
  ?
  Martin 
  __ 
  
  
  
  Date: Wed, 6 May 2015 20:29:34 -0500
  Subject: Issues with Tomcat 7.0.57 not loading ActionServlets
  From: bsudershan...@gmail.com
  To: user@struts.apache.org
  
  I upgraded my application from tomcat 5.5.15, JDK 1.5, Struts 1.1 on Debian
  2.6.32 to
  tomcat 7.0.57, JDK 1.6, struts 1.1 on ubuntu14.04 and Action Servlets are
  not loading.
  I am thinking of this is something to do with version conflict. Please let
  me know what I am missing.
  
  Below is the error
  
  Apr 24, 2015 9:00:20 PM org.apache.catalina.core.ApplicationContext log
  
  INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain:
  [org.apache.webapp.balancer.RuleChain: RoundRobinRule@643fd34a]
  
  Apr 24, 2015 9:00:20 PM org.apache.catalina.core.ApplicationContext log
  
  INFO: Marking servlet action as unavailable
  
  Apr 24, 2015 9:00:20 PM org.apache.catalina.core.StandardContext
  loadOnStartup
  
  SEVERE: Servlet  threw load() exception
  
  javax.servlet.UnavailableException: Cannot load a validator resource from
  '/WEB-INF/validator-rules.xml'
  
  at
  org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174)
  
  at
  org.apache.struts.action.ActionServlet.initModulePlugIns(
  ActionServlet.java:839)
  
  at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
  
  at javax.servlet.GenericServlet.init(GenericServlet.java:158)
  
  at
  org.apache.catalina.core.StandardWrapper.initServlet(
  StandardWrapper.java:1284)
  
  at
  org.apache.catalina.core.StandardWrapper.loadServlet(
  StandardWrapper.java:1197)
  
  at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
  
  at
  org.apache.catalina.core.StandardContext.loadOnStartup(
  StandardContext.java:5231)
  
  at
  org.apache.catalina.core.StandardContext.startInternal(
  StandardContext.java:5518)
  
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  
  at
  org.apache.catalina.core.ContainerBase.addChildInternal(
  ContainerBase.java:901)
  
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
  
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
  
  at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
  
  at
  org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
  
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
  
  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
  
  at java.util.concurrent.FutureTask.run(FutureTask.java:166)
  
  at
  java.util.concurrent.ThreadPoolExecutor.runWorker(
  ThreadPoolExecutor.java:1146

RE: Issues with Tomcat 7.0.57 not loading ActionServlets

2015-05-16 Thread Martin Gainty
Raj-

did you check for the existence of 
/WEB-INF/validator-rules.xmlin $TOMCAT_HOME/webapps/NameOfYourWebappGoesHere
?
Martin 
__ 



 Date: Wed, 6 May 2015 20:29:34 -0500
 Subject: Issues with Tomcat 7.0.57 not loading ActionServlets
 From: bsudershan...@gmail.com
 To: user@struts.apache.org
 
 I upgraded my application from tomcat 5.5.15, JDK 1.5, Struts 1.1 on Debian
 2.6.32 to
 tomcat 7.0.57, JDK 1.6, struts 1.1 on ubuntu14.04 and Action Servlets are
 not loading.
 I am thinking of this is something to do with version conflict. Please let
 me know what I am missing.
 
 Below is the error
 
 Apr 24, 2015 9:00:20 PM org.apache.catalina.core.ApplicationContext log
 
 INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain:
 [org.apache.webapp.balancer.RuleChain: RoundRobinRule@643fd34a]
 
 Apr 24, 2015 9:00:20 PM org.apache.catalina.core.ApplicationContext log
 
 INFO: Marking servlet action as unavailable
 
 Apr 24, 2015 9:00:20 PM org.apache.catalina.core.StandardContext
 loadOnStartup
 
 SEVERE: Servlet  threw load() exception
 
 javax.servlet.UnavailableException: Cannot load a validator resource from
 '/WEB-INF/validator-rules.xml'
 
 at
 org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174)
 
 at
 org.apache.struts.action.ActionServlet.initModulePlugIns(
 ActionServlet.java:839)
 
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
 
 at javax.servlet.GenericServlet.init(GenericServlet.java:158)
 
 at
 org.apache.catalina.core.StandardWrapper.initServlet(
 StandardWrapper.java:1284)
 
 at
 org.apache.catalina.core.StandardWrapper.loadServlet(
 StandardWrapper.java:1197)
 
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
 
 at
 org.apache.catalina.core.StandardContext.loadOnStartup(
 StandardContext.java:5231)
 
 at
 org.apache.catalina.core.StandardContext.startInternal(
 StandardContext.java:5518)
 
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(
 ContainerBase.java:901)
 
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
 
 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
 
 at
 org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
 
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
 
 at java.util.concurrent.FutureTask.run(FutureTask.java:166)
 
 at
 java.util.concurrent.ThreadPoolExecutor.runWorker(
 ThreadPoolExecutor.java:1146)
 
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(
 ThreadPoolExecutor.java:615)
 
 at java.lang.Thread.run(Thread.java:701)
 
 Thanks
  

RE: Running local process from within web application.

2015-03-23 Thread Martin Gainty

David-

Runtime.getRuntime().exec(fubar.sh);
I would launch this in a thread so as to not disrupt WebServer from receiving 
requests/producing Responses
http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html

in production you probably want to consider Message Queues Technologies such as 
JMS/Quartz/MQSeries
create JMS message, publish your JMS Queued Message to JMS provider and let JMS 
run it 
http://docs.oracle.com/javaee/6/tutorial/doc/bncdx.html

When building the war/ear and a Task is to be launched Jenkins PostBuildTask is 
your best best bet
http://wiki.hudson-ci.org/display/HUDSON/Post+build+task

HTH
Martin 
__ 

  


 From: davidrfi...@gmail.com
 Subject: Running local process from within web application. 
 Date: Mon, 23 Mar 2015 12:43:51 +0200
 To: user@struts.apache.org
 
 Is it possible, and if so how, to run a local process (normally run from the 
 command line), within a struts web application. 
 Thanks 
 
 Sent from my iPhone
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  

RE: Struts 1.x documentation and javadocs

2015-03-11 Thread Martin Gainty
mkdir /EmptyFolder
cd /EmptyFolder
wget -r http://www.laconiadatasystems.com/struts-1.3.8/docs/ 
Please do this today before my host provider finds out I uploaded at least 2 gb 
of apache stuff to the site

ping back if you have any questions,
Martin 
__ 

 


 From: lukaszlen...@apache.org
 Date: Wed, 11 Mar 2015 13:20:35 +0100
 Subject: Re: Struts 1.x documentation and javadocs
 To: user@struts.apache.org
 
 Yes, only as a downloadable versions, this allowed to simplify results
 in Google index
 
 2015-03-11 12:23 GMT+01:00 Christopher Schultz ch...@christopherschultz.net:
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA256
 
  All,
 
  I realize that S1 is EOL but the press release says that the
  documentation will still be available from the Struts home page.
 
  I can't seem to find the 1.3.x API Javadocs on the site, and neither
  can Google. Are the Javadocs still available from the Struts web site,
  or do I need to download the documentation package and install it locally?
 
  Thanks,
  - -chris
  -BEGIN PGP SIGNATURE-
  Version: GnuPG v1
  Comment: GPGTools - http://gpgtools.org
 
  iQIcBAEBCAAGBQJVACWXAAoJEBzwKT+lPKRYq/8P/0nLxdg0ZyWHF2tuo04zsU/3
  pRpKI3NSgANQ0N8Pzi40jOTGmTNb0r60oJMTSMc0ZyTx2ZSN8GPd0oVxRqfDUZmb
  ElGUjcXOz4a4In4aYT6ZQ2LLl0gEYx2VHHjUHDqt8JlTe9ytqUxyMQw7SRlxZmGS
  NoQLFRTY2nBVxhv7y2rr1HFFrZOhqfm3r7jykOMehSrx4khJ6BUKx1Svu/gltkx5
  QUCVz63j85VnLgiCrtJqx9aQhNTO0p4JrMgeKKaiNG4iTvYFpm0L4Bi1xnjLAL75
  r8OZwxpo0ZgZ/aNFIbJl/iZqr4LhnFscRVRBlBjkfm17zLg5igLnvYKTi5Ogqw1d
  qgKqgGH/gHk0deIpzwG2leUfrxBDGn90aN2Cvy31+bXRXyQWbDPllcoygIT7gqC8
  vTDqC+XUsu/wq+JmfoKkMIW+3nEwUYCB0yrhm2NMp0anbbPCctH8t49yTHtathCn
  vqh08rQclWb+OUCcLcwifCynhvyCaXEKJNv/GM+3Uq/QvRsmB5X4YME/Uno5hQas
  mzstcFqLUtCkWdl3CZb2V04uDEhmCOY65yvFAB7O4T4V0YYeJv+yrCfuaw/661Kn
  Y9rkkvr+piewrw+9gE3cdPLRHi4c5otCvt5U0UQF40t55IiOQtYw06GscP6Y7RFs
  Z3xTwrhAUVX/9UHr1oya
  =Ontf
  -END PGP SIGNATURE-
 
  -
  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: Select multiple values from a dropdown

2015-02-22 Thread Martin Gainty

 Date: Sun, 22 Feb 2015 09:11:58 -0500
 Subject: RE: Select multiple values from a dropdown
 From: lilylove2s...@yahoo.com.INVALID
 To: user@struts.apache.org
 
 Our application has a form on the right pane where user can create a request 
 and submit it.  After the request is submitted, it will be displayed on the 
 left pane.  The left pane lists all the submitted requests in the system.
 
 When user selects one of the requests on the left pane, the data will be 
 populated in the form on the right pane.  These data will be displayed in 
 uneditable mode until user selects the 'OPEN' request button.
 
 The issue we have is that the values in the dropdown box display the whole 
 list, instead of highlighting the selected values which user has chosen.
 
 Regards, 
MGstraight from the doc located at
http://struts.apache.org/maven/struts2-core/apidocs/org/apache/struts2/components/Select.html
 s:select label=Pets
name=petIds
list=petDao.pets
listKey=id
listValue=name
multiple=true
size=3
required=true
value=%{petDao.pets.{id}}
 /

 s:select label=Months
name=months
headerKey=-1 headerValue=Select Month
list=#{'01':'Jan', '02':'Feb', [...]}
value=selectedMonth
required=true
 /

 // The month id (01, 02, ...) returned by the getSelectedMonth() call
 // against the stack will be auto-selected
MGso in first case execute() would call the value getId()
MGin the second case value is selectedMonth so execute() would call 
getSelectedMonth() 


 

 

 Note: For any of the tags that use lists (select probably being the most 
ubiquitous), which uses the OGNL list
 notation (see the months example above), it should be noted that the map key 
created (in the months example,
 the '01', '02', etc.) is typed. 

'1' is a char, 

'01' is a String, 

1 is a String. 

This is important since if
 the value returned by your value attribute is NOT the same type as the key 
in the list attribute, they
 WILL NOT MATCH, even though their String values may be equivalent. If they 
don't match, nothing in your list
 will be auto-selected.
MG


 
 
  Date: Sat, 21 Feb 2015 04:50:33 +
  From: lilylove2s...@yahoo.com.INVALID
  To: user@struts.apache.org
  Subject: Re: Select multiple values from a dropdown
  
  Thanks Muralidhar.  I was able to do that.  The dropdown is a part of the 
  request form.  Another question is how do I keep the selected values 
  displayed in the dropdown when the user views the saved request? 
  
   On Friday, February 20, 2015 11:21 PM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
  
   the below is the select tag where you can choose multiple values
  
  s:select label=Pets
name=petIds
list=petDao.pets
listKey=id
listValue=name
multiple=true
size=3
required=true
value=%{petDao.pets.{id}}
  /
  
  *Thanks and Regards,*
  Muralidhar Yaragalla.
  
  *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
  On Sat, Feb 21, 2015 at 2:44 AM, lilylove2shop 
  lilylove2s...@yahoo.com.invalid wrote:
  
   Hi all,
  
   How do I select and display more than one value from a dropdown and
   display them in jsp using struts2?
  
   Thanks
  
  
  
  
  
  
 
 
  

RE: Select multiple values from a dropdown

2015-02-21 Thread Martin Gainty
MGthe dropdown list is populated from pets collection located inside the 
petDao class
MGeach value presented is based on unique id value of %{petDao.pets.{id}}

MG*if* you want the dropdown to dropdown you can hang a click handler for 
dropdown on your submit button
MGI have trouble understanding why you would want to dropdown the selected 
values upon saving
MGcould you explain this strategy?


 Date: Sat, 21 Feb 2015 04:50:33 +
 From: lilylove2s...@yahoo.com.INVALID
 To: user@struts.apache.org
 Subject: Re: Select multiple values from a dropdown
 
 Thanks Muralidhar.  I was able to do that.  The dropdown is a part of the 
 request form.  Another question is how do I keep the selected values 
 displayed in the dropdown when the user views the saved request? 
 
  On Friday, February 20, 2015 11:21 PM, Yaragalla Muralidhar 
 yaragallamur...@gmail.com wrote:

 
  the below is the select tag where you can choose multiple values
 
 s:select label=Pets
   name=petIds
   list=petDao.pets
   listKey=id
   listValue=name
   multiple=true
   size=3
   required=true
   value=%{petDao.pets.{id}}
 /
 
 *Thanks and Regards,*
 Muralidhar Yaragalla.
 
 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
 On Sat, Feb 21, 2015 at 2:44 AM, lilylove2shop 
 lilylove2s...@yahoo.com.invalid wrote:
 
  Hi all,
 
  How do I select and display more than one value from a dropdown and
  display them in jsp using struts2?
 
  Thanks
 
 
 
 
 
 

  

RE: double select tag

2015-02-18 Thread Martin Gainty



 Date: Thu, 19 Feb 2015 09:20:07 +1100
 From: patrick.ke...@riverdynamics.com
 To: user@struts.apache.org
 Subject: Re: double select tag
 
 Christoph, the html code used when the Edit link gets clicked looks 
 like the following. So the iterator has run and has pulled back a bunch 
 of records. Then for any of the items on the list you can click edit 
 which will extract the relevant data fields for the selected record and 
 populate the lower half of the screen.
 
 td class=oddRowa %=linkmouseover% 
 href=javascript:editPropertyContent('s:property value=itemRoom/', 
 's:property value=itemCategory/', 

MGs:property is not part of the HTML5 DOM
Elements not in the document are NOT searched by getElementById. When creating 
an element and assigning it an ID, you have to insert the element into the 
document tree with insertBefore or a similar method BEFORE you can access it 
with getElementById:
MGChristoph nailed it
MGyou may want to consider inserting property inside backing bean and access 
via #var_bean_name.property.
http://www.mkyong.com/struts2/struts-2-bean-tag-example/


's:property escape=false 
 value=itemDescriptionHtml/', 's:property escape=false 
 value=itemReplacementHtml/', 's:property escape=false 
 value=itemReplacementUrlHtml/', 's:property 
 value=itemReplacementValue/', 's:property 
 value=itemValidationStatus/', 's:property 
 value=itemFulfillmentStatus/');Edit/a/td
 
 We use this approach where we have a list at the top half of the screen 
 and a details area for adding and editing at the bottom half of the 
 screen a lot. And it does work OK. Except for this screen which is the 
 1st time we have experimented using the doubleselect tag.
 
 I thought maybe the problem was some of the auto generated code that 
 gets inserted into the html when the page loads. Perhaps the 2nd field 
 in the double select does get populated but then gets overwritten?
 
 Patrick Kelly
 
 PatrickKelly
 PrincipalConsultant
 *River**Dynamics*
 
 E: patrick.ke...@riverdynamics.com mailto:patrick.ke...@riverdynamics.com
 W: www.riverdynamics.com http://www.riverdynamics.com/
 
 On 18/02/2015 9:18 PM, Christoph Nenning wrote:
  Christoph - I think so. It was not throwing any javascript errors in
  Firefox javascript console.
 
  It was defined in the doubleselect statement below and i could see it in
  the generated html in view page source.
 
  s:doubleselect label=Select room and
  item name=claimContent.itemRoom id=itemRoom emptyOption=true
  requiredLabel=true list=#itemList.keySet()
  doubleName=claimContent.itemCategory doubleId=itemCategory
  doubleEmptyOption=true doubleList=#itemList[top]  tooltip=%
  {getText('claimContent.itemRoom.tooltip')}/
 
 
 
  In your first screenshot you showed us how the table of itmes looks. Can
  you post the HTML for that?
  How looks the whole JavaScript when you click the edit Link?
 
 
  You are using document.getElementById() but you have not just one single
  table row but multiple ones.
  So it seems the HTML-IDs you use are not unique.
 
 
  Regards,
  Christoph
 
 
 
 
 
 
 
  E: patrick.ke...@riverdynamics.com 
  mailto:patrick.ke...@riverdynamics.com
  W: www.riverdynamics.com http://www.riverdynamics.com/
 
  On 18/02/2015 7:20 PM, Christoph Nenning wrote:
document.getElementById(itemCategory).value = itemCategory;
  Are you sure that itemCategory is present in the html table and can be
  accessed by JavaScript?
 
 
 
 
 
  I am trying to get a double select tag to work for the 1st time and
  am having some problems.
 
  The JSP involved comprises a list in the top half of the page where
  an iterator fetches data from the database which is displayed in the
  list like so:
 
  [Bild entfernt]
 
 
  The bottom half of the screen comprises a form where you can add and
  edit an item before pressing save which updates the database and re-
  displays the page with the new or updated item now appearing in the
  list.
  The add/edit area looks like so when the page originally loads:
 
  [Bild entfernt]
 
 
  Adding an item works OK.
 
  I use the following tags in the add/edit area for the 2 fields that
  are populated via the double select (I have removed some of the
  options for brevity in this email):
 
s:set name=itemList value=#
  {'Antiques': {'Antiques'},
'Bathroom': {'Cosmetics', 'Hamper',
  'Lines', 'Medical items', 'Other', 'Scales', 'Shower curtains',
  'Sundries'},
'Garage': {'Hand tools', 'Other',
  'Power tools', 'Tool chests', 'Work bench'}}/
 
s:doubleselect label=Select room and
  item name=claimContent.itemRoom id=itemRoom emptyOption=true
  requiredLabel=true list=#itemList.keySet()
  doubleName=claimContent.itemCategory doubleId=itemCategory
  doubleEmptyOption=true doubleList=#itemList[top]  tooltip=%
  {getText('claimContent.itemRoom.tooltip')}/
 
  So that all seems OK.
 
  But if I want to edit 

RE: problem in xml validation

2015-02-17 Thread Martin Gainty


 Date: Tue, 17 Feb 2015 21:07:03 +0530
 Subject: Re: problem in xml validation
 From: yaragallamur...@gmail.com
 To: user@struts.apache.org
 
 No dave. It is because in the same Action class i have a validate method.
 So in this method if validation fails it is showing inpu jsp with the
 errors.
 
 *Thanks and Regards,*
 Muralidhar Yaragalla.

MGwhere is the action java class that dave asked for?
MGif you have any backing beans..display those as well?
MGwhere is web.xml?
MGwhere is struts.xml?
MGwhere is the jsp you expect to display?

 
 *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
 
 On Tue, Feb 17, 2015 at 9:03 PM, Dave Newton davelnew...@gmail.com wrote:
 
  ... If you want any help, you need to provide actionable information.
 
  My first guesses are that you're either missing an `input` definition, or
  its JSP page isn't where you think it is.
 
  On Tue, Feb 17, 2015 at 10:05 AM, Yaragalla Muralidhar 
  yaragallamur...@gmail.com wrote:
 
   Hi,
   I have written AddTestAction.class and placed
   AddTestAction-validation.xml file in the same package. but the field
   validations are not happening. i have written int validators. Instead
   showing validation errors the browser is displaying page not found.  if i
   remove validation xml file everthing is working fine. what could be the
   problem?
  
   do i need to paste the code?
  
   *Thanks and Regards,*
   Muralidhar Yaragalla.
  
   *http://yaragalla.blogspot.in/ http://yaragalla.blogspot.in/*
  
 
 
 
  --
  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
 
  

RE: Dynamic Attributes with Velocity

2015-01-28 Thread Martin Gainty




 From: sean.pow...@legalmatch.com
 To: user@struts.apache.org
 Subject: Dynamic Attributes with Velocity
 Date: Wed, 28 Jan 2015 22:07:13 +
 
 I have a question about how to set dynamic Attributes of a Struts 2 tag in a 
 Velocity template.
 
 I've been trying to do it this way, but Struts is treating my Map as a String.
 
 #stextfield(label=TFLable name=TFName value=TFValue id=TFId 
 dynamicAttributes=#{'data-ajax':'false'})

MGspecify dynamicAttributes as {K1:V1, K2:V2} e.g.
#assign s=JspTaglibs[/WEB-INF/struts.tld] /@s.textfield name=TFName 
dynamicAttributes={data-ajax:false,key:value}/http://struts.apache.org/docs/freemarker-support.html

 
 Thank you,
 
 Sean Powell
  

Storm Juno

2015-01-26 Thread Martin Gainty
http://www.cbsnews.com/videos/eye-opener-massive-blizzard-barrels-into-northeast/

Mon-pm Tuesday all day forecast is 24 inches for Western CT / Western Ma / 
Central NH
Cape will get  at LEAST12-24 inches with howling winds
30 inches snow for Hartford - Boston Corridor with 'signifcant winds'

Shout out your snow totals when you get 'em
Martin P
__ 

 
  

RE: Using Struts2 Rest Plugin with deep cascading actions

2015-01-26 Thread Martin Gainty
the dynamic namespace assignment ListPeopleAction example

package org.apache.struts2.showcase.person;
import java.util.ArrayList;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

@ParentPackage(person)
@Namespace(value=listPerson) //theoretically this should change namespace 
from /person to /listPerson
@Results({
@Result(name=list, location=list-people.action, type=redirect),
@Result(name=input, location = list-people.action, type=redirect),
@Result(name=success, location = listPerson.jsp, type=redirect)
//produces No result defined for action 
org.apache.struts2.showcase.person.NewPersonAction and result input

//com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:375)
//@Result(name=input, location=/person/editPerson.jsp),
})
public class ListPeopleAction extends ActionSupport {

private static final long serialVersionUID = 3608017189783645371L;
PersonManager personManager;
List people = new ArrayList();
public void setPersonManager(PersonManager personManager) {
this.personManager = personManager;
}
public String execute() {
people.addAll(personManager.getPeople());
return SUCCESS;
}
public List getPeople() {
return people;
}
public int getPeopleCount() {
return people.size();
}
}
theoretically listPerson namespace is supposed to replace default assigment of 
'person' so lets take a look at behavior once struts-showcase webapp is loaded:
http://localhost:8080/struts2-apps/person
I see the original 2 menu options:
1) Create a new Person
2) List all persons
I want to see if the /listPerson is assigned is working so I click on 2)List 
all persons and the dispatcher takes me to
http://localhost:8080/struts2-apps/person/listPeople.action
listPeople.action is correct because @Result(name=input, location = 
list-people.action, type=redirect)

but the dynamic re-assigment of namespace /person to listPerson has not taken 
plac
I then correct address bar
http://localhost:8080/struts2-apps/listPerson/listPeople.action
and am displayed 404 by dispatcher

2 possible courses of action
1)redact @Namespace since it doesnt invoke JDKProxy to redirect namespace 
'person' to 'listPerson'

2)is there a way to change xwork ObjectFactory to not use ProxyObjectFactory or 
CGLIB but the JDK Proxy change:
xwork
bean type=com.opensymphony.xwork2.ObjectFactory name=default 
class=com.opensymphony.xwork2.ProxyObjectFactory /

to a factory which will implement JDK Proxy e.g:
// Implement interface
Class? clazz = Class.forName(Namespace);

Object listenerInstance = Proxy.newProxyInstance(clazz.getClassLoader(), 
new Class?[]{clazz}, new InvocationHandler() {
  @Override
  public Object invoke(Object proxy, Method method, Object[] args) throws 
Throwable {
if(method.getName().equals(onReceive)){
  System.out.println(ARGS:  + (Integer)args[0] + ,  + 
(Integer)args[1]);
  return 1;
}
else return -1;
  }
}); 
Thoughts?
Martin 
-
The key to prevent a hacked email account is to change password more than every 
5 years..


 From: mgai...@hotmail.com
 To: user@struts.apache.org
 Subject: RE: Using Struts2 Rest Plugin with deep cascading actions
 Date: Sat, 24 Jan 2015 18:38:43 -0500
 
 
 
 
  Date: Sat, 24 Jan 2015 15:24:49 +0530
  Subject: Re: Using Struts2 Rest Plugin with deep cascading actions
  From: ghotankaru...@gmail.com
  To: user@struts.apache.org
  
  Well after doing some research on designing rest api ***best practices*** I
  realized I was doing something wrong.
  
  For getting all companies, we must use
  
  http://localhost/company
  
  For getting all locations of that company we can use
  
  http://localhost/company/111/locations
  
  For anything else to get from any particular location we can use
  
  http://localhost/company/locations/111 - to get location details
  (/company/ only in namespacing )
  
  http://localhost/company/locations/111/contacts - to get location contacts
  
  etc.
  
  
  Now question is how do we implement namespacing in struts2 rest api???
  
  As by default all actions are @root right?
  
  can we have @namespace(value=/company/) annotation in Location Action
  
  But this does not work for me, it redirects to company action only and says
  no method available.
  
  Or we must not use such namespacing and its better to use
  http://localhost/location instead of http://localhost/company/location
  
  Please suggest. 
 
 MGyou need to specify the namespace attribute in package specification
 MGhttp://www.mkyong.com/struts2/struts-2-namespace-configuration-example-and-explanation
 MGthere is a movement to add more

RE: ASM library issue when upgrading struts2.3.20 from struts2.3.16.3

2015-01-24 Thread Martin Gainty
this is a asm 3.3 to asm 5.0.2 library upgrade issue.redirecting


 Date: Sat, 24 Jan 2015 11:47:58 +0530
 Subject: ASM library issue when upgrading struts2.3.20 from struts2.3.16.3
 From: ghotankaru...@gmail.com
 To: user@struts.apache.org
 
 Hi,
 
 I am using spring aop along with struts2
 
 When using older version i.e struts2.3.16.3 my aop and project works
 properly
 
 Here is snapshot of my dependecy tree
 
 [INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.16.3:compile
 [INFO] |  +- org.apache.commons:commons-lang3:jar:3.1:compile
 [INFO] |  \- org.apache.struts:struts2-core:jar:2.3.16.3:compile
 [INFO] | +- org.apache.struts.xwork:xwork-core:jar:2.3.16.3:compile
 [INFO] | |  +- asm:asm:jar:3.3:compile
 [INFO] | |  \- asm:asm-commons:jar:3.3:compile
 [INFO] | | \- asm:asm-tree:jar:3.3:compile
 [INFO] | +- org.freemarker:freemarker:jar:2.3.19:compile
 [INFO] | +- ognl:ognl:jar:3.0.6:compile
 [INFO] | |  \- javassist:javassist:jar:3.11.0.GA:compile
 [INFO] | +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
 [INFO] | \- commons-io:commons-io:jar:2.2:compile
 [INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.3.16.3:compile
 [INFO] |  +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
 [INFO] |  +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
 [INFO] |  |  \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
 [INFO] |  +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
 [INFO] |  |  +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
 [INFO] |  |  \-
 org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
 [INFO] |  \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
 [INFO] | \- aopalliance:aopalliance:jar:1.0:compile
 
 But same does not work when I update the struts2 to 2.3.20
 
 [INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.20:compile
 [INFO] |  +- org.apache.commons:commons-lang3:jar:3.2:compile
 [INFO] |  \- org.apache.struts:struts2-core:jar:2.3.20:compile
 [INFO] | +- org.apache.struts.xwork:xwork-core:jar:2.3.20:compile
 [INFO] | |  +- org.ow2.asm:asm:jar:5.0.2:compile
 [INFO] | |  \- org.ow2.asm:asm-commons:jar:5.0.2:compile
 [INFO] | | \- org.ow2.asm:asm-tree:jar:5.0.2:compile
 [INFO] | +- org.freemarker:freemarker:jar:2.3.19:compile
 [INFO] | +- ognl:ognl:jar:3.0.6:compile
 [INFO] | |  \- javassist:javassist:jar:3.11.0.GA:compile
 [INFO] | +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
 [INFO] | \- commons-io:commons-io:jar:2.2:compile
 [INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.3.20:compile
 [INFO] |  +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
 [INFO] |  +- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
 [INFO] |  |  \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
 [INFO] |  +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
 [INFO] |  |  +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
 [INFO] |  |  \-
 org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
 [INFO] |  \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
 [INFO] | \- aopalliance:aopalliance:jar:1.0:compile
 
 As the asm library looks to be have updated to 5.0.2
 
 
 *Error that I get is class net.sf.cglib.core.DebuggingClassWriter overrides
 final method visit*
 
 This only happens when I using aop feature of spring and error comes during
 runtime and not compile time.
 
 I know this should be simple library dependecy issue, but not able to solve
 it as cglib  asm are almost used everywhere else too.
 
 Any suggestions of how to fix this?
 
 -- 
 
 
 
 *With Best Regards,*
 
 Amol Ghotankar
 Technical Lead
 M: +91 9960 980 419 http://www.cursivetech.com
  

RE: Using Struts2 Rest Plugin with deep cascading actions

2015-01-24 Thread Martin Gainty



 Date: Sat, 24 Jan 2015 15:24:49 +0530
 Subject: Re: Using Struts2 Rest Plugin with deep cascading actions
 From: ghotankaru...@gmail.com
 To: user@struts.apache.org
 
 Well after doing some research on designing rest api ***best practices*** I
 realized I was doing something wrong.
 
 For getting all companies, we must use
 
 http://localhost/company
 
 For getting all locations of that company we can use
 
 http://localhost/company/111/locations
 
 For anything else to get from any particular location we can use
 
 http://localhost/company/locations/111 - to get location details
 (/company/ only in namespacing )
 
 http://localhost/company/locations/111/contacts - to get location contacts
 
 etc.
 
 
 Now question is how do we implement namespacing in struts2 rest api???
 
 As by default all actions are @root right?
 
 can we have @namespace(value=/company/) annotation in Location Action
 
 But this does not work for me, it redirects to company action only and says
 no method available.
 
 Or we must not use such namespacing and its better to use
 http://localhost/location instead of http://localhost/company/location
 
 Please suggest. 

MGyou need to specify the namespace attribute in package specification
MGhttp://www.mkyong.com/struts2/struts-2-namespace-configuration-example-and-explanation
MGthere is a movement to add more annotation based specifications at 
ActionClass level in the new Struts 3.x
MGif you make a request in Struts JIRA and add a testcase then one of or more 
of us will follow thru if this feasible
MGhttps://issues.apache.org/jira/secure/Dashboard.jspa

 
 On Fri, Jan 23, 2015 at 4:20 PM, Amol Ghotankar ghotankaru...@gmail.com
 wrote:
 
  hi,
 
  I was trying out struts2 rest plugin and found it really cool.
 
  But was just wondering how will this work with action cascading ? i.e
 
  So When using http://localhost/company it goes to companyAction and
  executes respective mapped methods
 
  But how do we organize work when we
  http://localhost/company/1/locations/2/contact/2/ ???
 
  Will these be methods in same class? Class will grow too big  if not how
  does it get mapped to contactAction and pass values their?
 
  How about more complex case where we have
  http://localhost/company/1/locations/2/contact/2/order/2/transaction/1/payment
  or something like this???
 
  Domain objects are hibernate entities when company has locations has
  contacts has orders has transaction has payments?
 
  or should the rest url be something different and simplified? like
  http://localhost/order/2/transaction/1/payment but still has issues
  mapping things and reusing actions?
 
  Am I missing something in rest plugin?
 
  --
 
 
 
  *With Best Regards,*
 
  Amol Ghotankar
  Technical Lead
  M: +91 9960 980 419 http://www.cursivetech.com
 
 
 
 
 -- 
 
 
 
 *With Best Regards,*
 
 Amol Ghotankar
 Technical Lead
 M: +91 9960 980 419 http://www.cursivetech.com
  

RE: OGNL Static Method call wrapper

2015-01-19 Thread Martin Gainty
No
*Unless* you configure app to implement max heap  -Xmx2048M -XX:PermSize=2048M 
-XX:MaxPermSize=2048m 
dont declare any entity Static anything .statics are notorious for parking in 
Permgen
where of course the accumulation of other statics will eventually cause OOM
http://stackoverflow.com/questions/8387989/where-is-a-static-method-and-a-static-variable-stored-in-java-in-heap-or-in-sta

read this qa on how variables and methods and classes declared statically 
essentially violate OOP 
http://stackoverflow.com/questions/7026507/why-are-static-variables-considered-evil

Martin  
__ 



 Date: Mon, 19 Jan 2015 13:02:19 +
 From: afatt...@yahoo.com.INVALID
 To: user@struts.apache.org
 Subject: OGNL Static Method call wrapper
 
 As the OGNL static method will be disabled soon ... we could use a wrapper to 
 call those static methods 
 Do you think it is a good idea to add a method ActionSupport for calling the 
 static methods
 
 So instead of @foo.bar@isValidAmount(amount) 
 we can use callStaticMethod(foo.bar.isValidAmount,amount) 
 
 In this way there will be no need to add different method wrappers every time 
 we want to call static method and we can update the code lot easier, The 
 callStaticMethod (String methodName, String... Parameters)  can use 
 reflection to call static methods
 
 Please review 
 http://stackoverflow.com/questions/28018861/struts-2-refactoring-code-to-avoid-ognl-static-method-access
  
 
  ~Regards,
 ~~Alireza Fattahi
  

RE: Struts2 with AngularJS

2014-11-19 Thread Martin Gainty







 Date: Wed, 19 Nov 2014 17:20:00 +0700
 Subject: Re: Struts2 with AngularJS
 From: linut...@gmail.com
 To: user@struts.apache.org
 
 Hi,
 
 Thanks for the prompt reply, I'll have a look at the Struts2 AngularJS
 archetype
 But I meant AngularJS interceptor (
 https://docs.angularjs.org/api/ng/service/$http) which is still client
 side, AngularJS interceptor is meant to intercept {name:abc,address:abc}
 and change it to {customer:{name:abc,address:abc}}

MGNot a Struts Interceptor as Lukasz had mentionedbr
MGIf you are absolutely convinced that you want to use Angular instead of 
jquerybr
MG1) get Struts2-Jquery Showcase working from 
https://code.google.com/p/struts2-jquery/br
MG2)replace all jquery*.js with angular*.js in all of the source codebr
MG3)replace your default jquery library calls such as ajax calls for 
$.ajax(...) with  $http.get('./struts.action');br
MGthe failure you are experiencing is parsing the Javascript on the client 
sidebr
MGremember to build out your struts action call and querystring before calling 
$http.getbr
MG/struts.action?parm1=arg1,parm2=arg2br
MGIf on the other hand if you have struts.multipart.parser=jakarta in 
struts.properties or default.propertiesbr
MGthen your action is using method=POSR so call $http.post(./struts.action) 
instead
MGbuild out the parameters to pass in with hidden fields e.g. s:hidden 
name=fu value=bar/br
MGput parameters in JSON format e.g. string.toJSON(); 
MGplace JSON params into second argument to http.post e.g. 
[{fu:'bar'},{fu2:'bar2'}]br
MGif onsuccess method returns JSON coming back from server you can parse JSON 
with data=JSON.parse(response)br
MGJSON library is available in standard jquery-version.jsbr
MGget yourself a browser like Chrome enable JavaScript console (CTL SHIFT J) 
click on Sources pause on Caught Exceptionsbr
MGyou will see which calls are failingbr

 I'm looking at the source code for the REST plugin, looks like the magic
 happens in ContentTypeInterceptor, this gets the payload from http
 inputstream then maps it to the action. If I want to use
 {name:abc,address:abc},
 looks like I have to use @ModelDriven ?
 
 Is it fine to just use REST plugin's ContentTypeInterceptor and the
 JsonLibHandler and include them in my web application ?
 i.e. are they fairly standalone-ish ? or do they have dependencies with
 other components in the REST plugin ?
 
 
 
 On Wed, Nov 19, 2014 at 4:59 PM, Lukasz Lenart lukaszlen...@apache.org
 wrote:
 
  2014-11-19 9:51 GMT+01:00 foo bar linut...@gmail.com:
   Hi guys,
  
   I'm currently looking into ease of development of using AngularJS with
   Struts2.
   I'm wondering what is the best practice in general
   ie. AngularJS with $resource or $http, Struts2 with what plugin ?
   Is the REST + convention plugin a must to support AngularJS's RESTful
   nature ?
  
   I'm currently using Struts2 with no REST plugin and notice that if I do
   something like this
  
   CustomerService.save($scope.newCustomer);
  
   In Chrome's Developer tools, Content-Type:application/json;charset=UTF-8
   and data is a JSON string but it's in the Request Payload
   Normally it's Content-Type:application/x-www-form-urlencoded and data is
  in
   Form Data
  
   I have
  
   private Customer customer;
  
   in my Action class and the approriate getter and setter, but they are not
   called by the framework
   I understand that I can get the data via http request's inputstream, but
   then I have to transfer the data to my Customer object manually (I use
   Gson) and I think that will bypass all my interceptors, especially
   validation.
  
   Did a bit of research on the internet and it seems that using the REST
   plugin should work, but it needs a bit of modification on the AngularJS
   part ($http interceptor ?)
  
   Struts2 won't populate my Customer object with this (which is normal
  plain
   AngularJS)
  
   {name:abc,address:abc}
  
   Have to change to
  
   {customer:{name:abc,address:abc}}
 
  Maybe start with Struts AngularJS archetype first? Because it looks
  like I you're mixing things - client side ($http) and server side
  (interceptor)
 
 
  http://struts.apache.org/release/2.3.x/docs/struts-2-maven-archetypes.html#Struts2MavenArchetypes-TheAngularJSArchetype(struts2-archetype-angularjs)
 
 
  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: Struts2 with AngularJS

2014-11-19 Thread Martin Gainty







 Date: Wed, 19 Nov 2014 17:20:00 +0700
 Subject: Re: Struts2 with AngularJS
 From: linut...@gmail.com
 To: user@struts.apache.org
 
 Hi,
 
 Thanks for the prompt reply, I'll have a look at the Struts2 AngularJS
 archetype
 But I meant AngularJS interceptor (
 https://docs.angularjs.org/api/ng/service/$http) which is still client
 side, AngularJS interceptor is meant to intercept {name:abc,address:abc}
 and change it to {customer:{name:abc,address:abc}}

MGNot a Struts Interceptor as Lukasz had mentionedbr
MGIf you are absolutely convinced that you want to use Angular instead of 
jquerybr
MG1) get Struts2-Jquery Showcase working from 
https://code.google.com/p/struts2-jquery/br
MG2)replace all jquery*.js with angular*.js in all of the source codebr
MG3)replace your default jquery library calls such as ajax calls for 
$.ajax(...) with  $http.get('./struts.action');br
MGthe failure you are experiencing is parsing the Javascript on the client 
sidebr
MGremember to build out your struts action call and querystring before calling 
$http.getbr
MG/struts.action?parm1=arg1,parm2=arg2br
MGIf on the other hand if you have struts.multipart.parser=jakarta in 
struts.properties or default.propertiesbr
MGthen your action is using method=POSR so call $http.post(./struts.action) 
instead
MGbuild out the parameters to pass in with hidden fields e.g. s:hidden 
name=fu value=bar/br
MGput parameters in JSON format e.g. string.toJSON(); 
MGplace JSON params into second argument to http.post e.g. 
[{fu:'bar'},{fu2:'bar2'}]br
MGif onsuccess method returns JSON coming back from server you can parse JSON 
with data=JSON.parse(response)br
MGJSON library is available in standard jquery-version.jsbr
MGget yourself a browser like Chrome enable JavaScript console (CTL SHIFT J) 
click on Sources pause on Caught Exceptionsbr
MGyou will see which calls are failingbr

 I'm looking at the source code for the REST plugin, looks like the magic
 happens in ContentTypeInterceptor, this gets the payload from http
 inputstream then maps it to the action. If I want to use
 {name:abc,address:abc},
 looks like I have to use @ModelDriven ?
 
 Is it fine to just use REST plugin's ContentTypeInterceptor and the
 JsonLibHandler and include them in my web application ?
 i.e. are they fairly standalone-ish ? or do they have dependencies with
 other components in the REST plugin ?
 
 
 
 On Wed, Nov 19, 2014 at 4:59 PM, Lukasz Lenart lukaszlen...@apache.org
 wrote:
 
  2014-11-19 9:51 GMT+01:00 foo bar linut...@gmail.com:
   Hi guys,
  
   I'm currently looking into ease of development of using AngularJS with
   Struts2.
   I'm wondering what is the best practice in general
   ie. AngularJS with $resource or $http, Struts2 with what plugin ?
   Is the REST + convention plugin a must to support AngularJS's RESTful
   nature ?
  
   I'm currently using Struts2 with no REST plugin and notice that if I do
   something like this
  
   CustomerService.save($scope.newCustomer);
  
   In Chrome's Developer tools, Content-Type:application/json;charset=UTF-8
   and data is a JSON string but it's in the Request Payload
   Normally it's Content-Type:application/x-www-form-urlencoded and data is
  in
   Form Data
  
   I have
  
   private Customer customer;
  
   in my Action class and the approriate getter and setter, but they are not
   called by the framework
   I understand that I can get the data via http request's inputstream, but
   then I have to transfer the data to my Customer object manually (I use
   Gson) and I think that will bypass all my interceptors, especially
   validation.
  
   Did a bit of research on the internet and it seems that using the REST
   plugin should work, but it needs a bit of modification on the AngularJS
   part ($http interceptor ?)
  
   Struts2 won't populate my Customer object with this (which is normal
  plain
   AngularJS)
  
   {name:abc,address:abc}
  
   Have to change to
  
   {customer:{name:abc,address:abc}}
 
  Maybe start with Struts AngularJS archetype first? Because it looks
  like I you're mixing things - client side ($http) and server side
  (interceptor)
 
 
  http://struts.apache.org/release/2.3.x/docs/struts-2-maven-archetypes.html#Struts2MavenArchetypes-TheAngularJSArchetype(struts2-archetype-angularjs)
 
 
  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
 
 

  

  1   2   3   4   5   6   7   8   9   10   >