Add context to CspInterceptor reportUri

2023-12-16 Thread Andreas Sachs
Hello,
i'm using the CspInterceptor and want to add a reportUri. The destination is an 
action defined in my application.

To set the reportUri in struts.xml i have to specify the complete url (with 
context).

/context/report.action

Is there a parameter to get the context?

//report.action


Thanks
Andi



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



Aw: Re: Overwrite a TypeConverter for a Map with Generics

2015-02-23 Thread Andreas Sachs
Hello,
thanks for your answer. Have you tried your solution and got it working? I 
already tried that before, but it always picked up the global converter 
de..converter.StringTrimConverter. But maybe i did something wrong.

I tried it with @TypeConversion(rule = ConversionRule.MAP, converter = 
"de.converter...") (with annotations and also with a class-specific 
conversion-properties file).

If a specify a class name that does not exists, i get an exception. But if i 
use a class that exists, that class is not used for conversion.

I tried to debug DefaultObjectTypeDeterminer: it's looking for an @Element 
annotation. The class-specific properties file (Element_textfield) will only be 
used if i don't use generics.

Or do i need to implement a Map-Converter instead of a String-Converter?

Thanks
Andreas
 
 

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



Overwrite a TypeConverter for a Map with Generics

2015-02-22 Thread Andreas Sachs
Hello,
how can i overwrite a TypeConverter for a Map?
 
I defined the following global TypeConverter:
java.lang.String=de..converter.StringTrimConverter
(the converter removes blanks from the string)
 
This converter is used for every String, even inside maps. That's fine.
 
In one action i use the following map:
Map textfield = ...
How can i use the default/another String converter for this property?
Using a properties file for the action doesn't work. The Entry 
"Element_textfield" is not used because i use Generics.
 
Thanks
Andreas

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



Dojo datetimepicker problem

2010-09-08 Thread Andreas Sachs
Struts: 2.1.8.1 
Hi,
some of my users have a problem with the datetimepicker.
During an order process the users have to provide a date. Almost all users can 
do this (>7000 orders). But i have three error reports, that the date selection 
field is not shown (the text input field and the icon to open the popup are 
missing).

Two users have the problem with IE (one with IE8), but Firefox is working.
One user has the problem with IE and Firefox.

The main problem is, that i cannot reproduce the problem on my systems (tried 
with different OS, browsers,... Always working) to debug the javascript.

I got the following error message from a user:
Meldung: Das Objekt unterstützt diese Aktion nicht. (Object does not support 
operation)
Line: 1191
Zeichen: 1
Code: 0
URI: https://xx//struts/dojo/struts_dojo.js


Meldung: 'dojo.widget.manager' ist Null oder kein Objekt (is null or not an 
object)
Line: 27
Zeichen: 1
Code: 0
URI: https://xx//struts/ajax/dojoRequire.js


I found the following difference, but i'm not sure if this is related to this 
case:
Typically there are only a few request to dojo javascript files in the server 
log. But the browser of one of the users with the problem request a lot of 
different files.

Does anybody has some ideas what could be wrong?

Thanks
Andi

-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl

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



Re: [S2] Accept-language problem with tomcat/struts/tiles

2009-01-14 Thread Andreas Sachs

> Version of Tiles?

Thanks for this question. After upgrading from 2.1.0 to 2.1.1 the problem 
disappeared.

Andi



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



[S2] Accept-language problem with tomcat/struts/tiles

2009-01-14 Thread Andreas Sachs
Hello,
i have a strange problem with tomcat/struts/tiles. I'm not sure which component 
is responsible.

If i start tomcat, wait some seconds and access my application everything will 
work fine.

If i start tomcat and immediately access my application, it only works with 
firefox and not with IE.
That means, not only the first request has a problem, all requests doesn't work 
with IE. Even if the first request was with firefox, IE won't work.


I receive the following tiles error:

org.apache.tiles.definition.NoSuchDefinitionException: login
at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:612)
at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:307)


To analyze the problem i simulate the http request. I break it down to the 
following http header:

Firefox:
accept-language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3

IE
accept-language: de

If the first request is immediately after the start of the server, i will get a 
tiles error on every request with "accept-language: de". 
"accept-language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3" works fine.

If i wait some seconds after the start of the server, both headers work.

Has anybody seen this problem before or can give me some hints?

Environment:
Windows Vista
Tomcat 5.5
Struts 2.0.14

Thanks
Andi

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



S2 Grouping Validators

2009-01-09 Thread Andreas Sachs
Hello,
can anybody give me some hints on the configuration of validators to avoid 
redundant configuration.

Lets say, you have 3 actions, all off them have a username field. To validate 
the username three build-in validators are used (with annotation or via xml). 
If the validation rule changes, all three actions (annotations or xml) must be 
changed.

My target is to define a custom validator. Then i can use the custom validator 
within the three ActionClasses. 
Inside the custom validator i want to invoke the build-in validators.

The best thing would be, if the custom validator can be defined via xml.

Example:





...


12






...


5




The action uses the groupvalidator with parameter username or password.

Has anybody done something like this before and can give me some hints. 
Especially on calling validators inside a custom validator. Or are there any 
other solutions to define a set of validators, which can be used for different 
action classes.

Thanks 
Andi

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



Re: [S2] Session Created to late

2008-11-19 Thread Andreas Sachs

Hello,
i want to put a object in every new session which provides basic sessionbased 
functionality. E.g. 

isUserLoggedIn();
getUser();
getMenu(); (the menu depends on the user)

public ...sessionCreated() {
MainManager mM = new mainManager()
session.setattribut("mainManager",mM)
}

Within the jsp i use:

#session.mM.user.name
or
#session.mM.menu

I can initilize the session in the action, but i have some actions which are 
not sessionAware, because they don't need that. E.g. the start-page. It simply 
returns the welcome-result. With a new session #session.mM is not available in 
the jsp because the sessionCreated-Method is called to late (At least it looks 
like that).

Maybe i should initialize the session with an interceptor.

Thanks
Andi



 Original-Nachricht 
> Datum: Wed, 19 Nov 2008 19:25:54 +0100
> Von: "Nils-Helge Garli Hegvik" <[EMAIL PROTECTED]>
> An: "Struts Users Mailing List" 
> Betreff: Re: [S2] Session Created to late

> What is it exactly that you want to achieve?
> 
> Nils-H
> 
> On Wed, Nov 19, 2008 at 6:51 PM, Andreas Sachs <[EMAIL PROTECTED]> wrote:
> > Hello,
> > i try to initialize a session with a HttpSessionListener class.
> >
> > The sessionCreated-Method is called AFTER setSession(Map map) of an
> Action-Class with SessionAware interface.
> >
> > Whats the right way to initilize a session when using struts2?
> >
> > Thanks
> > Andi
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Sensationsangebot nur bis 30.11: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[S2] Session Created to late

2008-11-19 Thread Andreas Sachs
Hello,
i try to initialize a session with a HttpSessionListener class.

The sessionCreated-Method is called AFTER setSession(Map map) of an 
Action-Class with SessionAware interface.

Whats the right way to initilize a session when using struts2?

Thanks
Andi



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]