class in applet-jar not found

2009-04-27 Thread Stephan Schröder

this is actually not a struts2-problem, but it came up in a struts2 projet of
mine:
a applet of mine won't start because the main-class can't be found, which is
of course present in the applet.

I appended the applet and a test.html-file (
http://www.nabble.com/file/p23256861/MosaicUploaderTest.zip
MosaicUploaderTest.zip ) which does nothing but invoking the applet. People
having this problem had in most cases a broken jar but i don't see any
problem with this one.
Is there a way to check a applet-jar-file for integrity?

I get the following exception:
Caused by: java.io.FileNotFoundException:
D:\home\Downloads\MosaicUploaderTest\MosaicUploader.jar\applet\MosaicUploaderApplet.class
(The system cannot find the path specified)

The applet is compiled using Java5-compatibility.

Any ideas (or do you know a better forum to ask)?

Thanks,
Stephan
-- 
View this message in context: 
http://www.nabble.com/class-in-applet-jar-not-found-tp23256861p23256861.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Unable to find interceptor class referenced by ref-name gwt

2009-03-16 Thread Stephan Schröder

> Unable to find interceptor class referenced by ref-name gwt

solved, i forgot to extend the example-package from gwt-default instead of
struts-default.



Stephan Schröder wrote:
> 
> When deploying my HelloWorld-struts2-gwt-application i get this exception:
> 
> SCHWERWIEGEND: Exception starting filter struts2
> Unable to load configuration. - interceptor-ref -
> file:/D:/Programme/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/struts2gwt-helloworld/WEB-INF/classes/example.xml:15:39
>   at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
>   ...
> Caused by: Unable to find interceptor class referenced by ref-name gwt -
> interceptor-ref -
> file:/D:/Programme/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/struts2gwt-helloworld/WEB-INF/classes/example.xml:15:39
>   at
> com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:52)
>   ...
> 
> The gwt-interceptor is referenced in example.xml:
>  method="getMessage">
>   
> 
> 
> The gwt-interceptor is present in the struts2gwtplugin-0.2.1.jar which is
> of course added in WEB-INF/lib.
> I haven't yet compiled the gwt-part to javascript, so the application
> won't work as is, but the struts2-configuration should be loaded without
> problems. Here is the code:
>  http://www.nabble.com/file/p22534621/struts2gwt-helloworld.war
> struts2gwt-helloworld.war 
> 
> Regards,
> Stephan
> 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-find-interceptor-class-referenced-by-ref-name-gwt-tp22534621p22536904.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Unable to find interceptor class referenced by ref-name gwt

2009-03-16 Thread Stephan Schröder

When deploying my HelloWorld-struts2-gwt-application i get this exception:

SCHWERWIEGEND: Exception starting filter struts2
Unable to load configuration. - interceptor-ref -
file:/D:/Programme/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/struts2gwt-helloworld/WEB-INF/classes/example.xml:15:39
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
...
Caused by: Unable to find interceptor class referenced by ref-name gwt -
interceptor-ref -
file:/D:/Programme/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/struts2gwt-helloworld/WEB-INF/classes/example.xml:15:39
at
com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:52)
...

The gwt-interceptor is referenced in example.xml:




The gwt-interceptor is present in the struts2gwtplugin-0.2.1.jar which is of
course added in WEB-INF/lib.
I haven't yet compiled the gwt-part to javascript, so the application won't
work as is, but the struts2-configuration should be loaded without problems.
Here is the code:
http://www.nabble.com/file/p22534621/struts2gwt-helloworld.war
struts2gwt-helloworld.war 

Regards,
Stephan
-- 
View this message in context: 
http://www.nabble.com/Unable-to-find-interceptor-class-referenced-by-ref-name-gwt-tp22534621p22534621.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts 2 and GWT in Hosted Mode?

2009-03-13 Thread Stephan Schröder

> Am i right in saying that if you use struts 2 as the server backend of gwt,
> you can't use the hosted mode browser!?

Ok, i was wrong. The trick is to use the hosted mode browser without the
embedded tomcat server. Take a look here:
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=FAQ_HostedModeNoServer


Stephan Schröder wrote:
> 
> Am i right in saying that if you use struts 2 as the server backend of
> gwt, you can't use the hosted mode browser!?
> The hosted mode browser seems only capable of launching gwt modules not
> normal webapps.
> I'm i right?
> 
> Regards,
> Stephan
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-and-GWT-in-Hosted-Mode--tp22458264p22493047.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Struts 2 and GWT in Hosted Mode?

2009-03-11 Thread Stephan Schröder

Am i right in saying that if you use struts 2 as the server backend of gwt,
you can't use the hosted mode browser!?
The hosted mode browser seems only capable of launching gwt modules not
normal webapps.
I'm i right?

Regards,
Stephan
-- 
View this message in context: 
http://www.nabble.com/Struts-2-and-GWT-in-Hosted-Mode--tp22458264p22458264.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



ActionMapper doesn't add Parameter

2009-01-24 Thread Stephan Schröder

the objectiv is to be able to have url like ".../public/123.mp3" so this
customized ActionMapper was written.

public class MyActionMapper extends DefaultActionMapper {

   static ActionMapper fallback = new DefaultActionMapper();

   private static String getSongIdFromUrl(String s, String regex){

   Matcher m = Pattern.compile(regex).matcher(s);
   return m.find() ? m.group(1) : null;
   }

   @Override
   public ActionMapping getMapping(HttpServletRequest request,
   ConfigurationManager configManager) {
   String uri = getUri(request);
   String regex = "/public/(\\d+).mp3";
   String id = getSongIdFromUrl(uri, regex);
   if(id!=null){
   ActionMapping m = new ActionMapping();
   m.setExtension("");
   m.setMethod("download");
   m.setNamespace("/public");
   m.setName("fileDownload");
   Map params = new TreeMap();
   params.put("id", id);
   m.setParams(params);
   return m;
   }
   return fallback.getMapping(request, configManager);
   }
}

the problem is, that the id-Attribute altough correctly extracted from the
url dosn't become part of the parameter-list. The url
".../public/123.mp3?id=123" works by the way but is of course redundant. Why
doesn't 

params.put("id", id);
m.setParams(params);

work?
-- 
View this message in context: 
http://www.nabble.com/ActionMapper-doesn%27t-add-Parameter-tp21645204p21645204.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



How to use a localised enum in a checkboxlist

2009-01-04 Thread Stephan Schröder

i have a checkboxlist which entries are derived from possible values of an
enum (named TrainingAttribute).

This usage of the checkboxlist works
 <@s.checkboxlist label="Attribute" name="trainingAttributes" 
list="@domainobjects.util.trainingattrib...@values()}"/>

"trainingAttributes" gives an array of type TrainingAttribute with a subset
of TrainingAttribute.values().
Of course this displays the Java-Names of the enum-Instances therefore i
added the two methods for the key and the name:
public enum TrainingAttribute
{
  ADVANCED,BEGINNER,CHILDREN,WEAPON;
  
  public String getKey()
  {
return toString();
  }
  
  public String getName()
  {
switch( this ) {
  case ADVANCED: return "Fortgeschrittene";
  case BEGINNER: return "Anfänger";
  case CHILDREN: return "Kinder";
  case WEAPON:   return "Waffen";
}
throw new RuntimeException( "unknown enum:"+getClass().getName() );
  }
}

Now i added the listValue- and listKey-parameter:
<@s.checkboxlist label="Attribute" name="trainingAttributes" 
list="%...@domainobjects.util.trainingattribute@values()}" listValue="name"
listKey="key"/>

but no checkbox is checked. Using @s.select with the multiple=true option
doesn't prepopulate either.
So what's the right way to write and use a localised enum set in a
checkboxlist?

/Stephan
-- 
View this message in context: 
http://www.nabble.com/How-to-use-a-localised-enum-in-a-checkboxlist-tp21280363p21280363.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Is HttpSessionListener a singleton and/or initialized by Spring?

2008-12-10 Thread Stephan Schröder

I have a Struts 2 webapp with Spring 2.5 as ObjectFactory.
I have a HttpSessionListener-Class which is configured in web.xml:


  util.servlet.UserTimeoutListener


I assume that 
1) this class will be instanciated as a singleton.
2) Spring will have nothing to do with the instanciation.

Am i right on both accounts? 

/Stephan
-- 
View this message in context: 
http://www.nabble.com/Is-HttpSessionListener-a-singleton-and-or-initialized-by-Spring--tp20932453p20932453.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



different tiles definition depending on the package of the action mapping

2008-10-28 Thread Stephan Schröder

hi,

my app has three packages public, sucurity (login,register,...) and private.
These packages correspond in that all actions within this package should be
displayed with  the same menus. Therefore (i guess) i have (not yet, but
this is my idea) three base layouts from which to extend:


  
  



  
  



  
  


There seem to be three different ways to achieve my goal (with Tiles 2.1):
1) using Wildcards:


  


In that case my action mapping would have to provide the package name:

  ...
  
...

  package_public.body_nextPage 

  



Is there a better possiblity to replace the hardcoded package name with
something i don't have to type every time than extending the tiles-Result
with:

public class CustomTilesResult extends TilesResult{

  public void setLocation( String location ) {
this.location =
"package_"+ServletActionContext.getActionMapping.getNamespace().substring(1)+
".body_"+location;
  }
}

2)using EL:

  


This is much nicer than 1) because i don't have to code anything for the
action mappings. But is there an expression to compute the current package
with the EL? And how do i enable EL when i don't user the 
http://tiles.apache.org/framework/tutorial/advanced/el-support.html
TilesServlet   but the TilesListener (because i want
FreeMarker-integreation)?
Do i have access to the value stack when using the EL?

3)using a ViewPreparer to create the right menu:
in this version i wouldn't have my three base layouts but only one with a
viewpreparer that initialises the menu structure

  
  


So the MenuViewPrepare would by responsible to figure out which package is
used. That should work like this:
public void execute(TilesRequestContext tilesContext, AttributeContext
attributeContext) {
  switch( ServletActionContext.getActionMapping.getNamespace() ) {
case: ...
{


Which approach is preferable? Is there an even better approach?

I don't understand the "if you need"-part of this statement 
http://tiles.apache.org/framework/getting_started.html "if you need JSP
support, copy the tiles-jsp-VERSION.jar in the WEB-INF/lib directory of your
web application" . 
Don't you always use the JSP-Tags at least in your baseLayout-File?
I guess i also have to include this when using FreeMarker because i call the
JSP-Tags from within FreeMarker too!?

Regards,
Stephan
-- 
View this message in context: 
http://www.nabble.com/different-tiles-definition-depending-on-the-package-of-the-action-mapping-tp20206579p20206579.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Confused by Result-generation

2008-10-21 Thread Stephan Schröder

Ok, i found the answer with debugging
DefaultActionInvocation.invoke()-method. It's the first case even if one
interceptor doesn't call actionInvocation.invoke(). In that case the result
is generated surrounded by all of the previous interceptors.

If all (e.g.2) interceptors call actionInvocation.invoke() you get this
call-sequence: 
Interceptor 1-> Interceptor 2-> Action-> Result-> Interceptor 2->
Interceptor 1

If one (e.g. the second) interceptor doesn't call actionInvocation.invoke()
you get:
Interceptor 1-> Interceptor 2-> Result-> Interceptor 1

There's some tricky use of recursion.

Regards,
Stephan


Stephan Schröder wrote:
> 
> hi,
> 
> as far as i understand it, the calling sequenze of an action mapping looks
> like this:
> Interceptor 1-> Interceptor 2->...-> Action-> Result->...-> Interceptor
> 2-> Interceptor 1
> (see http://struts.apache.org/2.0.11.2/docs/big-picture.html)
> 
> But what happens when i use this AuthenticationInterceptor:
> 
> public class AuthenticationInterceptor extends AbstractInterceptor {
> 
>   public String intercept( ActionInvocation actionInvocation ) throws
> Exception
>   {
> Map session = actionInvocation.getInvocationContext().getSession();
> User user = (User) session.get( Struts2PortfolioConstants.USER );
> if (user == null) {
>   return Action.LOGIN;
> }
> else {
>   (( UserAwareAction ) actionInvocation.getAction()).setUser(user);
>   return actionInvocation.invoke();
> }
>   }
> 
> }
> This is adapted from "Struts 2 in Action" and it looks like here the
> calling sequence would be
> Interceptor 1-> AuthenticationInterceptor-> Interceptor 1-> Result
> 
> So in the normal case the Result is generated within the Interceptors
> while the second code suggests that the Result is generated aber the last
> Interceptor has returned.
> Or is both true?
> 
> Regards,
> Stephan 
> 

-- 
View this message in context: 
http://www.nabble.com/Confused-by-Result-generation-tp20067494p20088687.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Confused by Result-generation

2008-10-20 Thread Stephan Schröder

hi,

as far as i understand it, the calling sequenze of an action mapping looks
like this:
Interceptor 1-> Interceptor 2->...-> Action-> Result->...-> Interceptor 2->
Interceptor 1
(see http://struts.apache.org/2.0.11.2/docs/big-picture.html)

But what happens when i use this AuthenticationInterceptor:

public class AuthenticationInterceptor extends AbstractInterceptor {

  public String intercept( ActionInvocation actionInvocation ) throws
Exception
  {
Map session = actionInvocation.getInvocationContext().getSession();
User user = (User) session.get( Struts2PortfolioConstants.USER );
if (user == null) {
  return Action.LOGIN;
}
else {
  (( UserAwareAction ) actionInvocation.getAction()).setUser(user);
  return actionInvocation.invoke();
}
  }

}
This is adapted from "Struts 2 in Action" and it looks like here the calling
sequence would be
Interceptor 1-> AuthenticationInterceptor-> Interceptor 1-> Result

So in the normal case the Result is generated within the Interceptors while
the second code suggests that the Result is generated aber the last
Interceptor has returned.
Or is both true?

Regards,
Stephan
-- 
View this message in context: 
http://www.nabble.com/Confused-by-Result-generation-tp20067494p20067494.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: DefaultWorkflowInterceptor doesn't validate anymore!?

2008-10-09 Thread Stephan Schröder

>The validation one

Ok, but this seems to have a different semantic compared to the old
workflow-interceptor:

 * alwaysInvokeValidate - Defaults to true. If true validate() method
will always
 * be invoked, otherwise it will not.
 *
 * programmatic - Defaults to true. If true and the action is
Validateable call validate(),
 * and any method that starts with "validate".
 * 

1)What if my Action class has two "execute"-Methods (login and register) und
therefore a validateLogin and
validateRegister-method. 'workflow' was able two execute only the
appropriate validation-methode while 
'validation' will call "any method that starts with "validate"".

2)Also strange if alwaysInvokeValidate is false and programmatic is true:
doesn't the resulting "validate() method will not (always?) be invoked" and
the "If true and the action is Validateable call validate()" contradict
itself?

3) If booth are true, is validate() called twice?

Regards,
Stephan




Musachy Barroso wrote:
> 
> The validation one.
> 
> On Thu, Oct 9, 2008 at 9:13 AM, Stephan Schröder <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hi,
>>
>> i'm using Struts2.1.2 which uses Xwork2.1.2. When i tried to figure out
>> why
>> my validate-Method wasn't called anymore, i found out that the
>> DefaultWorkflowInterceptor just doesn't invoke it anymore, which seems to
>> be
>> on purpose (<-b->This interceptor does not perform any validation<-/b->.)
>> Which interceptor is now responsible for calling validate?
>>
>> regards,
>> Stephan
>>
>> http://www.nabble.com/file/p19898306/DefaultWorkflowInterceptor.java
>> DefaultWorkflowInterceptor.java
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/DefaultWorkflowInterceptor-doesn%27t-validate-anymore%21--tp19898306p19898306.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DefaultWorkflowInterceptor-doesn%27t-validate-anymore%21--tp19898306p19900670.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



DefaultWorkflowInterceptor doesn't validate anymore!?

2008-10-09 Thread Stephan Schröder

Hi,

i'm using Struts2.1.2 which uses Xwork2.1.2. When i tried to figure out why
my validate-Method wasn't called anymore, i found out that the
DefaultWorkflowInterceptor just doesn't invoke it anymore, which seems to be
on purpose (<-b->This interceptor does not perform any validation<-/b->.)
Which interceptor is now responsible for calling validate?

regards,
Stephan

http://www.nabble.com/file/p19898306/DefaultWorkflowInterceptor.java
DefaultWorkflowInterceptor.java 


-- 
View this message in context: 
http://www.nabble.com/DefaultWorkflowInterceptor-doesn%27t-validate-anymore%21--tp19898306p19898306.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: There is no Action mapped for namespace / and action name ...

2008-08-30 Thread Stephan Schröder

> If you are using trunk
not sure what you mean. you mean whether i use a new version from svn trunk?

I found the root of the problem. Struts doens't find my struts.xml file
(which includes my other files).
The XmlConfigurationProvider.loadConfigurationFiles(String fileName, Element
includeElement) calls ClassLoaderUtil.getRessources(
"struts.xml",XmlConfigurationProvider.class,false ) which returns an empty
Iterator.
There has to be a problem with the classloader. (It is called inside
getRessources.) I reinstalled Java, this time using synaptic instead of just
downloading it to a direrectory and wiring it inside Eclipse, but that
didn't help either. (Changing from sun1.6.07 to sun1.6.06 to 1.5.0gcj).
The strange thing is that deploying the war-file directly in tomcat works
(which uses 1.6.06). Only importing it in eclipse and deploying it from
there raises the exception.

Any ideas?

/Stephan


Musachy Barroso wrote:
> 
> If you are using trunk I would suggest to use the new filters, I also had
> some trouble using the "old" fillter, this is what I have in my web.xml
> and
> everything seems to work fine:
> 
>   
> struts-prepare
> 
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
> 
> 
> struts-execute
> 
> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
> 
> 
> sitemesh
> 
> com.opensymphony.module.sitemesh.filter.PageFilter
> 
> 
> struts-prepare
> /*
> 
> 
> sitemesh
> /*
> 
> 
> struts-execute
> /*
> 
> 
> musachy
> 
> On Sat, Aug 30, 2008 at 9:24 AM, Stephan Schröder <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> no, deleting the namespace-attribute on the package didn't work for me.
>>
>> I did a little debugging and i got this far: The Dispatcher init-method
>> invokes initTraditionalXMLConfigurations(). I think this is the place
>> where
>> all my namespace files (i got one for every package. they are included in
>> struts.xml) should be converted to Configuration instances, right?
>> The problem seems to be that initParams.get("config"); returns null and
>> therefore only default files (struts.xml,struts-default.xml and
>> struts-plugin.xml) are included. initParams is given to the depatcher via
>> a
>> constructor argument. So i'm not sure where it is initiated? I'm going to
>> check FilterDispatcher now but it's all a little bitte messy. So if you
>> know
>> where to look, please give me a hint.
>>
>> /Stephan
>>
>>
>> simson wrote:
>> >
>> > I had the same problem and the indication on the following link helped
>> me:
>> >
>> > http://www.roseindia.net/tutorialhelp/comment/58280
>> > regards,
>> > Simson
>> >
>> >
>> >
>> > Stephan Schröder wrote:
>> >>
>> >> having the same problem:
>> >> i use Struts2.0.11.2. and tomcat 6.0.16.
>> >> On my Windows desktop everything works fine. I exported the project as
>> >> war and imported it on my Linux laptop (so i can work a little bit in
>> my
>> >> hollidays).
>> >> But on the Linux laptop i only get a
>> >> "There is no Action mapped for action name index.".
>> >> My xml-files are UTF-8 coded on both machines so i have no idea where
>> the
>> >> problem is rooted in.
>> >> I'm using JRE1.6.0_07 on both machines, setting the compliance level
>> to
>> >> 1.5 didn't change anything. The tomcat startup shows no problems
>> either.
>> >>
>> >> What libraries did you change?
>> >>
>> >> /Stephan
>> >>
>> >>
>> >> John Moose wrote:
>> >>>
>> >>> re-ordered the libraries and builders, forced JDK compiler compliance
>> to
>> >>> 5.0
>> >>> ( definitely *not* 6.0 !!) in Eclipse and voila...runs great.  never
>> >>> *really* thought it was a Struts2 problem  ; )
>> >>>
>> >>> On Tue, Jul 29, 2008 at 9:26 AM, John Moose <[EMAIL PROTECTED]>
>> wrote:
>> >>>
>> >>>> A very wierd situation...I have two projects in the Eclipse
>> workspace
>> >>>> --
>> >>>> Tagging and Dashbd  They both use the REST plugin and follow the
>> naming
>> >>>> conventions, etc. Tagging will build, re-deploy and run perfectly.
>> When
>> >>>> I

Re: There is no Action mapped for namespace / and action name ...

2008-08-30 Thread Stephan Schröder

no, deleting the namespace-attribute on the package didn't work for me.

I did a little debugging and i got this far: The Dispatcher init-method
invokes initTraditionalXMLConfigurations(). I think this is the place where
all my namespace files (i got one for every package. they are included in
struts.xml) should be converted to Configuration instances, right?
The problem seems to be that initParams.get("config"); returns null and
therefore only default files (struts.xml,struts-default.xml and
struts-plugin.xml) are included. initParams is given to the depatcher via a
constructor argument. So i'm not sure where it is initiated? I'm going to
check FilterDispatcher now but it's all a little bitte messy. So if you know
where to look, please give me a hint.

/Stephan


simson wrote:
> 
> I had the same problem and the indication on the following link helped me:
> 
> http://www.roseindia.net/tutorialhelp/comment/58280
> regards,
> Simson
> 
> 
> 
> Stephan Schröder wrote:
>> 
>> having the same problem:
>> i use Struts2.0.11.2. and tomcat 6.0.16.
>> On my Windows desktop everything works fine. I exported the project as
>> war and imported it on my Linux laptop (so i can work a little bit in my
>> hollidays). 
>> But on the Linux laptop i only get a
>> "There is no Action mapped for action name index.".
>> My xml-files are UTF-8 coded on both machines so i have no idea where the
>> problem is rooted in.
>> I'm using JRE1.6.0_07 on both machines, setting the compliance level to
>> 1.5 didn't change anything. The tomcat startup shows no problems either.
>> 
>> What libraries did you change?
>> 
>> /Stephan
>> 
>> 
>> John Moose wrote:
>>> 
>>> re-ordered the libraries and builders, forced JDK compiler compliance to
>>> 5.0
>>> ( definitely *not* 6.0 !!) in Eclipse and voila...runs great.  never
>>> *really* thought it was a Struts2 problem  ; )
>>> 
>>> On Tue, Jul 29, 2008 at 9:26 AM, John Moose <[EMAIL PROTECTED]> wrote:
>>> 
>>>> A very wierd situation...I have two projects in the Eclipse workspace
>>>> --
>>>> Tagging and Dashbd  They both use the REST plugin and follow the naming
>>>> conventions, etc. Tagging will build, re-deploy and run perfectly. When
>>>> I
>>>> close that project and open Dashbd, build, re-deploy and run I get the
>>>> Action mapping failure as described. Both projects have source files in
>>>> the
>>>> "com.myeclipse.ozone" package name(space). Is it possible that there is
>>>> some
>>>> very persistent caching going on ??? like over multiple starts and
>>>> re-starts
>>>> of Tomcat?  just a WAG...
>>>>
>>>> -John
>>>>
>>>>
>>>> On Tue, Jul 29, 2008 at 5:08 AM, Pauli Savolainen <
>>>> [EMAIL PROTECTED]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am having exactly the same problem. I was using Struts 2.1.1,
>>>>> switched to struts 2.1.2 (including the restful and codebehind
>>>>> plugins) and started to get this 'no action found' error. I am quite
>>>>> confident that I did not do anything that should've resulted in this.
>>>>> Of course I cannot be 100% sure, because I did goof around with my
>>>>> code a bit, but I checked and rechecked and rerechecked everthing
>>>>> twice and couldn't find a reason for this behaviour.
>>>>>
>>>>> John's web.xml and the stacktrace are identical to mine. I don't
>>>>> declare any namespaces in my struts.xml packages nor in the login form
>>>>> from which I try to invoke the login action >>>> action="/login/execute" method="post">. (Also tried with an
>>>>> exclamation mark i.e. login!execute) I have a LoginAction.java with an
>>>>> execute method in the pacakge defined in the web.xml's actionPackages
>>>>> init parameter. At least this declaration used to send the control to
>>>>> the LoginAction's execute method. Doesn't do anymore.
>>>>>
>>>>> I am using the struts 2.1.2 tiles plugin as well. On my index.jsp I
>>>>> include a tiles main layout which in turn includes sub-layouts (such
>>>>> as the login form). I don't know if this has anything got to do with
>>>>> the problem I'm having.
>>>>>
>>>>

Re: There is no Action mapped for namespace / and action name ...

2008-08-29 Thread Stephan Schröder

having the same problem:
i use Struts2.0.11.2. and tomcat 6.0.16.
On my Windows desktop everything works fine. I exported the project as war
and imported it on my Linux laptop (so i can work a little bit in my
hollidays). 
But on the Linux laptop i only get a
"There is no Action mapped for action name index.".
My xml-files are UTF-8 coded on both machines so i have no idea where the
problem is rooted in.
I'm using JRE1.6.0_07 on both machines, setting the compliance level to 1.5
didn't change anything. The tomcat startup shows no problems either.

What libraries did you change?

/Stephan


John Moose wrote:
> 
> re-ordered the libraries and builders, forced JDK compiler compliance to
> 5.0
> ( definitely *not* 6.0 !!) in Eclipse and voila...runs great.  never
> *really* thought it was a Struts2 problem  ; )
> 
> On Tue, Jul 29, 2008 at 9:26 AM, John Moose <[EMAIL PROTECTED]> wrote:
> 
>> A very wierd situation...I have two projects in the Eclipse workspace --
>> Tagging and Dashbd  They both use the REST plugin and follow the naming
>> conventions, etc. Tagging will build, re-deploy and run perfectly. When I
>> close that project and open Dashbd, build, re-deploy and run I get the
>> Action mapping failure as described. Both projects have source files in
>> the
>> "com.myeclipse.ozone" package name(space). Is it possible that there is
>> some
>> very persistent caching going on ??? like over multiple starts and
>> re-starts
>> of Tomcat?  just a WAG...
>>
>> -John
>>
>>
>> On Tue, Jul 29, 2008 at 5:08 AM, Pauli Savolainen <
>> [EMAIL PROTECTED]> wrote:
>>
>>> Hi,
>>>
>>> I am having exactly the same problem. I was using Struts 2.1.1,
>>> switched to struts 2.1.2 (including the restful and codebehind
>>> plugins) and started to get this 'no action found' error. I am quite
>>> confident that I did not do anything that should've resulted in this.
>>> Of course I cannot be 100% sure, because I did goof around with my
>>> code a bit, but I checked and rechecked and rerechecked everthing
>>> twice and couldn't find a reason for this behaviour.
>>>
>>> John's web.xml and the stacktrace are identical to mine. I don't
>>> declare any namespaces in my struts.xml packages nor in the login form
>>> from which I try to invoke the login action >> action="/login/execute" method="post">. (Also tried with an
>>> exclamation mark i.e. login!execute) I have a LoginAction.java with an
>>> execute method in the pacakge defined in the web.xml's actionPackages
>>> init parameter. At least this declaration used to send the control to
>>> the LoginAction's execute method. Doesn't do anymore.
>>>
>>> I am using the struts 2.1.2 tiles plugin as well. On my index.jsp I
>>> include a tiles main layout which in turn includes sub-layouts (such
>>> as the login form). I don't know if this has anything got to do with
>>> the problem I'm having.
>>>
>>> So, is a result of something I did wrong or could it be something else?
>>>
>>> Thank you
>>>
>>> Pauli Savolainen
>>>
>>> 2008/7/28 Paul Benedict <[EMAIL PROTECTED]>:
>>> > What's the correct way of writing a good 404 or action not found page?
>>> Does
>>> > s2 have something like a fallback action if nothing can be found?
>>> >
>>> > Paul
>>> >
>>> > On Mon, Jul 28, 2008 at 4:04 PM, Dave Newton <[EMAIL PROTECTED]>
>>> wrote:
>>> >
>>> >> Hmm, I wonder if it was the same issue I was having with 2.1.3 a week
>>> or so
>>> >> ago that I haven't had time to re-visit--so it actually could be the
>>> web.xml
>>> >> (specifically the dispatcher being used) and I may have put my foot
>>> in
>>> my
>>> >> mouth (again).
>>> >>
>>> >> Somebody followed up saying the original FilterDispatcher worked,
>>> though,
>>> >> so maybe not. Hrm.
>>> >>
>>> >> Dave
>>> >>
>>> >> --- On Mon, 7/28/08, John Moose <[EMAIL PROTECTED]> wrote:
>>> >> > and I probably should have included this as well:
>>> >> >
>>> >> > Struts Problem Report
>>> >> >
>>> >> > Struts has detected an unhandled exception:
>>> >> >   *Messages*:
>>> >> > There is no Action mapped for namespace / and action name
>>> >> > dashbd.
>>> >> >  --
>>> >> > Stacktraces *There is no Action mapped for namespace / and
>>> >> > action name
>>> >> > dashbd. - [unknown location]*
>>> >> >
>>> >> >
>>> >> >
>>> >>
>>> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177)
>>> >> >
>>> >> >
>>> >>
>>> com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:59)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.struts2.rest.RestActionProxyFactory.createActionProxy(RestActionProxyFactory.java:40)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:439)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
>>> >> >
>>> >> >
>>> >>
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
>>> >> >
>>> >> >
>>> >>
>>> org.apa

Re: only serializable objects into Session?

2008-08-25 Thread Stephan Schröder
> > This seems to indicate that all the objects reachable
> > through this object should be serializable, too?!
> No, only the ones you want serialized.

So properties which don't implement Serializable will just be null afterwards? 
What about Lists of nonserializable classes, will these be empty?

/Stephan
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



only serializable objects into Session?

2008-08-25 Thread Stephan Schröder
hi,

i read the other day that only Objects which implement Serializable should be 
put into an HttpSession.
I gues this is valid for the Session in Struts2, too?!

This seems to indicate that all the objects reachable through this object 
should be serializable, too?!
That would be a problem since at this point the PersistenceManager is reachable 
from the User class. The PersistenceManager should clearly not be serialized, 
right?!
And there shouldn't be that many Objects reachable from User to start with, 
right?!

/Stephan

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



Re: help in build.xml

2008-08-25 Thread Stephan Schröder
why do you need a build.xml to run a struts2 application? Of course it's a good 
idea to use ant or maven2 as Build tools but it's not required.
I uploaded a helloWorld.war 
(http://www.file-upload.net/download-1066806/struts2helloworld.war.html) which 
you can download and then import in Eclipse by right-clicking on the Package 
Explorter and select Import. Then you select Web/War file. The you browse to my 
war-file and select it. You have to select or create a Target runtime too. Just 
use eclipses wizzards (i have Tomcat6 installed without any special 
configuration). Then click Finisch. Now right-click on your 
struts2helloworld-Project and select "Run As -> Run on Server". A few seconds 
later the message "Message: Hello World" should appear on your screen.
This assumes you have the eclipse Web Tools Platform (WTP) installed.

/Stephan

 Original-Nachricht 
> Datum: Mon, 25 Aug 2008 17:07:24 +0530
> Von: "Narasimha Raju Naidu" <[EMAIL PROTECTED]>
> An: user@struts.apache.org
> Betreff: help in build.xml

> hi to all,
> 
>  i am developing a struts web application on eclipse. in order to
> run struts application build.xml is required. can any one help me how to
> develop build.xml on eclipse and how to run a struts application on
> eclipse.
> waiting for your reply.
> 
> 
> 
> 
> 
> -- 
> Regards,
> Narasimha Raju.Naidu
> 
> Hyderabad.
> 
> 
> uni...

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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



Re: [OT] S2 Stream Result, downloading large file, advice needed

2008-08-23 Thread Stephan Schröder
> I'm still interested in hear any suggestions. I know that this is not
> strictly an S2 issue but it is related to using a Stream result type.  If
> I was writing a servlet I would just get the OutputStream and write directly
> to it, putting the burden of buffering etc. onto the container.

If you want to write directly on the OutputStream you can implement your own 
ResultType:

public class ByteContentResult implements Result,StrutsStatics
{
  public void execute( ActionInvocation invocation )
  throws Exception
  {
ByteContentProvider bytesProvider = (ByteContentProvider) 
invocation.getAction();
//HttpServletResponse response = 
org.apache.struts2.ServletActionContext.getResponse();
HttpServletResponse response = 
(HttpServletResponse)invocation.getInvocationContext().get( HTTP_RESPONSE );

response.setContentType(bytesProvider.getContentType());
byte[] content = bytesProvider.getBytes();
response.setContentLength( content.length );
ServletOutputStream outstream = response.getOutputStream();
outstream.write( content );
outstream.flush();
  }
}

The action class has only to implement this interface:
public interface ByteContentProvider
{
  public String getContentType();
  public byte[] getBytes();
}

Then make your result known in your my-struts-default.xml:

  


/Stephan
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: OGNL

2008-08-22 Thread Stephan Schröder
Here are the language and developer guides:
http://www.opensymphony.com/ognl/

I'm pretty sure that neither %{} nor ${} are actually part of OGNL. %{} is a 
marker for struts2 that the content should be evaluated as OGNL-Statement and 
not as String while ${} is the marker for freemarker, which is used in Struts2 
to generate html from tags, that the content should be evaluated with a 
customized data model which wraps the value stack.
The ValueStack isn't part of OGNL either. It's just a class with the special 
behavior regarding to OGNL. Normally OGNL walks the object path like this:
>
Map m = new Map();
m.put( "model",new DomainModel() ); //DomainModel has the Property id;
<
OGNL can now retrieve the ID with "m['model'].id"

The Value Stack now hides the fact that it's not the value stack that has a 
property but object that was given to it.
>>
ValueStack v = new ValueStack();
v.push( new DomainModel() ); 
<<
this is why OGNL can now ask "v.id" (and not "v.top.id") as if the ID was a 
property of the stack.

Because the Actionclass-Instance is added to the ValueStack automatically and 
every expression is evaluated against the value stack you can write "id" and 
retrieve the getId()-property of the action.

The action is the root of the context map wich uses OGNL as a starting point 
therefore you don't need the '#'-before the name of the variable. 

Normally when looking for a property on the value stack the first occurence of 
it (starting at the top of the stack) is returned. But some tags (eg. property) 
only evaluate 'top' which is the last element that was pushed on the Value 
Stack (which is the action instance itself at the start of the evaluation of 
you JSP/Freemarker/Velocity page).

/Stephan


 Original-Nachricht 
> Datum: Fri, 22 Aug 2008 17:32:34 +0530
> Von: "Muralidhar Y" <[EMAIL PROTECTED]>
> An: "\'Struts Users Mailing List\'" 
> Betreff: OGNL

> Hi friends,
> 
>  How to understand the OGNL. I am working with it,  most
> of
> the time I guess the things but I want to know how exactly the OGNL works.
> What is value stack? What is root and exactly how to write OGNL? Apart of
> the doc that is there on struts site, is there any good tutorial for OGNL
> so
> that I don't need to guess when writing OGNL when writing jsp pages using
> struts? I am really confused? Sometimes we use "%{}" notation, sometimes
> we
> use "${}" notation? Which is OGNL? I am really confused? Kindly help me in
> this.   
> 
>  
> 
> Warm regards,
> 
> Muralidhar Y
> 
> [EMAIL PROTECTED]
> 
>  
> 
> US Main: 877 KENSIUM (536.7486)
> India Main:  +91 9949495511
> 
> India Fax:   +91 9949495522
> 
> Kensium
> 
> 200 S Wacker Dr, Suite 3100
> 
> Chicago, IL 60606
> 
>  
> 
>  
> 
> Confidentiality Note:
> -
> The information contained in this e-mail is strictly confidential and for
> the intended use of the addressee only. Any disclosure, use or copying of
> the information by anyone other than the intended recipient is prohibited.
> If you have received this message in error, please notify the sender
> immediately by return e-mail and securely discard this message.
> 
>  
> 
>   _  
> 
>  
> 

-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: struts-hibernate-mysql date problem

2008-08-22 Thread Stephan Schröder
quick and dirty solution: i know that this works if you use hibernate with 
annotations so i'm certain that there is a possibility to do it with xml.
With annotations you can declare whether the data is extracted directly from 
the property or indirectly over the getter-method of the property. Make 
hibernate get the value directly from the property which uses the mm/dd/yy 
format.
Define the getter-method and setter-to format in and out of dd/mm/yy. Because 
Struts 2 always uses the getter-setter you alway have the right format.

class DomainModelObject
{
  //format = mm/dd/yy
  private String date;

  
  public String getDate()
  {
formatToDDMMYY( date );
  }

  public void setDate( String ddmmyyDate )
  {
date = formatToMMDDYY( ddmmyyDate );
  }
}

cleaner solution:
I'm certain there is a better way to do this because the i18n-part of Struts 2 
allows you to format the date differently depending on the locale of the date. 
Therefore you should save the date in the format hibernate wants and use 
DateFormat to format the Date for the view layer. Maybe you find something here:
http://struts.apache.org/2.0.11.2/docs/formatting-dates-and-numbers.html

/Stephan


 Original-Nachricht 
> Datum: Fri, 22 Aug 2008 03:31:30 -0700 (PDT)
> Von: Hardik Shah <[EMAIL PROTECTED]>
> An: user@struts.apache.org
> Betreff: struts-hibernate-mysql date problem

> 
> hi
> i am using hibernate 3 with s2 my problem is that
> 
> im mysql table i have field of date type 
> 
> so i have set type date  in hb mapping.xml and in pojo(if i am set as
> string
> in pojo and mapping file it gives error )
> 
> now i have to set date  in input  as format mm/dd/yy so mysql accepts it
> automatically and convert in its foramt type(YY-dd-mm)  otherwise it
> return
> to input result
> 
> but i want to show it as dd/mm/yy ,what i have to do for this any
> convertor
> of s2 apply or what?
> 
> please help to solve this problem
> 
> 
> -
> 
> 
> Java/J2EE developer 
> India
> 
> blogs
> http://hardik4u.wordpress.com wordpress blog 
> 
> -- 
> View this message in context:
> http://www.nabble.com/struts-hibernate-mysql-date-problem-tp19104863p19104863.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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



Re: [S2] Iterate through two lists

2008-08-22 Thread Stephan Schröder
> If all you're trying to do is set message properties why are you bothering
> with the push?
> 
> > 
> >   
> > 
> >   
> > 

Looks good (if fruit1 is accessable bei a getter in the action class). Does it 
work for you?

> >   
> > 
> >   
> > 
> >   
 
> I'm not sure why the push tag is causing the issue, though.

Maybe the param tag tries to bind with the push tag and not with the text tag???

/Stephan
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



Re: RE: Action as Welcome File

2008-08-21 Thread Stephan Schröder
> 
> struts2
> /*
> REQUEST
> FORWARD
> INCLUDE
> ERROR
> 

this result in an xml-error: The content of element type "filter-mapping" must 
match "(filter-name,(url-pattern|servlet-name))".

> In my web.xml I have:
> 
> 
> index.jsp
> 
> 
> and in index.jsp I have:
> 
>  <%
> String redirectURL = 
> "http://localhost:8080/myproject/MyAction.action";;
> response.sendRedirect(redirectURL);
> %>
> 
> Seems like a hack to me, but gets the job done.  Is there a more elegant 
> way?

Mine is slightly more elegant:

  index.html

 
 and in index.html I have:






one moment please...
Link



Is this an initialisation issue or why doesn't 
/public/index.action work?

/Stephan
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: Struts 2.1 Tree Problem

2008-08-21 Thread Stephan Schröder
>  some example i tried on struts-blank-2.1.2 it is working and recognizing
> events and responding. am i missing any imp" step in migration, is that
> replacing jar files is not enough for migration?

many of the struts2-tags use the "var"-attribute instead of "name" and "id", 
now. I'm not sure whether "id" and "name" still work in struts 2.1.

/Stephan

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Re: RE: [S2] Does struts set null values for pojo fields?

2008-08-21 Thread Stephan Schröder

> Can you define an interface that is common across all the actions/model
> objects. Then you can have the relevant Actions implement the interface
> and
> write an interceptor to check the value of the specified fields and set
> them
> to null if required after checking that the object is of the correct type
> (i.e. it implements your interface)

Nice Idea Andy! You don't even need common methods in the interface, it can 
just bee a signal

interface DomainModelObject{}

than you can have an interceptor

public class CleanerInterceptor extends AbstractInterceptor {

  public String intercept(ActionInvocation invocation) throws Exception {
Object action = invocation.getAction();
if( action instanceof ModelDriven ) {
  Object model = ((ModelDriven)action).getModel();
  //if the model is instance of DomainModelObject clean all of its 
properties
  if( model instanceof DomainModelObject ) {
DomainModelObject modelObject = (DomainModelObject)model;
Collection properties = getProperties( modelObject );
for( DomainObjectModel property:properties ) {
  cleanProperty( modelObject ,property );
}
  }
}
invocation.invoke();
  }

  private void cleanProperty( DomainObjectModel parent, DomainObjectModel model 
)
  {
if( model==null ) return;

Collection properties = getProperties( model );

if( allPropertiesNull( properties ) ) {
  setPropertyNullOnParent( parent,model );
}else{
  for( DomainObjectModel property:properties ) {
cleanProperty( model,property );
  }
}

  private Collection getProperties( DomainObjectModel model )
  {...
  }

  private void setPropertyNullOnParent( DomainObjectModel parent, 
DomainObjectModel model )
  {...
  }

  private boolean allPropertiesNull( Collection properties )
  {
for( DomainObjectModel property:properties ) {
  if( property!=null ) return false; 
}
return true;
  }
}

getProperties(...) and setPropertyNullOnParent(...) can both be programmed 
using Java Reflection and if you don't like DomainObjectModel being an 
Interface you can make it an annotation.
Then cleaner-Interceptor shoulb probably called last on you interceptorstack.

/Stephan
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: RE: [S2] Does struts set null values for pojo fields?

2008-08-21 Thread Stephan Schröder
> This is pretty much what I was looking to do, except that I was hoping
> struts2 could automatically remove an object if *all* of it's properties were
> null, not just one. Would your answer be the same given this minor
> difference?

This is actually not a question whether struts2 can do but whether OGNL can do 
it. OGNL is the expression language that struts 2 uses to navigate the object 
network.
-Maybe it works if you write your own OGNL PropertyAccessor 
(http://www.opensymphony.com/ognl/html/DeveloperGuide/propertyAccessors.html).
-I read that struts 2.1 will make the Expression Language plugable. Maybe 
different language works your way or is more easily extendable.

But booth these solutions are nontrivial. Maybe there is a better way hidden in 
the OGNL Documentaion:

Language Guide: http://www.opensymphony.com/ognl/html/LanguageGuide/index.html
Developer Guide: http://www.opensymphony.com/ognl/html/DeveloperGuide/index.html

/Stephan


 Original-Nachricht 
> Datum: Thu, 21 Aug 2008 11:36:47 +0100
> Von: "Gawain Hammond" <[EMAIL PROTECTED]>
> An: "Struts Users Mailing List" 
> Betreff: RE: [S2] Does struts set null values for pojo fields?

> Thanks very much for your reply.
> 
> The problem with this type of work around is that it completely messes up
> my fiendish master plan. If it wasn't for those pesky objects with null
> values! :-P
> 
> You see, I've probably been a bit too clever for my own good, and for the
> first time I've created a single action, a single service, and single dao
> to persist objects submitted from multiple struts forms. I'm currently
> persisting about 20 domain objects this way, and this is the last issue I need
> to solve to get it all working as desired.
> 
> This issue is a pretty common occurrence in my domain model, so I'd have
> to write code to check for null values in many places for every domain
> object. I've been thinking this problem would be best solved either in the
> struts/view layer, or maybe the persistence layer. I'm spreading myself a bit
> thin trying to work it out at both ends at the same time :-)
> 
> If you don't mind, I have one last question: You said:
> 
> "I think you cann't expect Struts 2 to automatically remove an object just
> because one of it's properties is set to null."
> 
> This is pretty much what I was looking to do, except that I was hoping
> struts2 could automatically remove an object if *all* of it's properties were
> null, not just one. Would your answer be the same given this minor
> difference?
> 
> 
> 
> -Original Message-
> From: "Stephan Schröder" [mailto:[EMAIL PROTECTED] 
> Sent: 21 August 2008 09:10
> To: Struts Users Mailing List
> Subject: Re: [S2] Does struts set null values for pojo fields?
> 
> I think you cann't expect Struts 2 to automatically remove an object just
> because one of it's properties is set to null. Ok, in your case it's the
> id-property but struts 2 (or better OGNL) doesn't know that.
> So i don't think this is worth a feature request.
> But here is the workaround i'd use:
> use the prepare-Interceptor after params and set group to null if the ID
> is null in the prepare method. That way the execute method stays a simple
> "persist( user );return SUCCESS;".
> 
> /Stephan
> 
> >  > headerValue="-- None --"
> > name="user.group.id"
> > value="%{user.group.id}"
> > list="%{#groupAction.list}"
> > listKey="id" listValue="name"
> > />
> > 
> > 
> > Does anyone know if this can be done? Can I configure struts to set
> > user.group as null rather than create an empty Group object if no
> > id/value has been specified in the drop down select box?
> > 
> > Is this something that is working as desired, and I'm the one who needs
> > to change? Or does struts maybe needs a new feature request in jira?
> -- 
> Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
> Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> --
> This transmission is strictly confidential, possibly legally privileged,
> and intended solely for the 
> addressee.  Any views or opinions expressed within it are those of the
> author and do not necessarily 
> represent those of 192.com, i-CD Publishing (UK) Ltd or any of it's
> subsidiary companies.  If you 
> are n

Re: [S2] Iterate through two lists

2008-08-21 Thread Stephan Schröder
this code here works for me:
<@s.set name="list1" value="%{{'apple','banana'}}" />
<@s.set name="list2" value="%{{'juice','cream'}}" />

<@s.iterator value="#list1" status="rowstatus">
  <@s.property />
  <@s.push value="#list2[#rowstatus.index]">
<@s.property />
  
  


(Notice: this is freemarker-Syntax, to get JSP-Syntax replace "@s." with "s:")

Maybe you forgot an '#' somewhere? How are fruit1,2 obtained?

/Stephan

 Original-Nachricht 
> Datum: Wed, 20 Aug 2008 09:05:55 -0700 (PDT)
> Von: Milan Milanovic <[EMAIL PROTECTED]>
> An: user@struts.apache.org
> Betreff: Re: [S2] Iterate through two lists

> 
> Dear Dave,
> 
> yes, I tried with index too, but it doesn't work. No, there is nothing in
> log.
> 
> --
> Regards, Milan
> 
> 
> newton.dave wrote:
> > 
> > --- On Wed, 8/20/08, Milan Milanovic wrote:
> >> No, this doesn't work. I get: "500 Internal Server
> >> Error" if I use this.
> > 
> > First of all, it should be rowStatus.index, which is zero-based (count
> is
> > one-based).
> > 
> > Second of all, is there anything in the log?
> > 
> > Dave
> > 
> >> "Stephan Schröder" wrote:
> >> > 
> >> > I'm not sure whether the syntax is completly right
> >> but it should work like
> >> > this:
> >> > 
> >> >  >> status="rowstatus">
> >> > 
> >> > 
> >> > 
> >> >  >> value="fruits2[#rowstatus.count]">
> >> > 
> >> > 
> >> > 
> >> > 
> >> > 
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/-S2--Iterate-through-two-lists-tp19052842p19052842.html
> >> > -- 
-- 
Pt! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

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



Re: [S2] Does struts set null values for pojo fields?

2008-08-21 Thread Stephan Schröder
I think you cann't expect Struts 2 to automatically remove an object just 
because one of it's properties is set to null. Ok, in your case it's the 
id-property but struts 2 (or better OGNL) doesn't know that.
So i don't think this is worth a feature request.
But here is the workaround i'd use:
use the prepare-Interceptor after params and set group to null if the ID is 
null in the prepare method. That way the execute method stays a simple 
"persist( user );return SUCCESS;".

/Stephan

>  headerValue="-- None --"
> name="user.group.id"
> value="%{user.group.id}"
> list="%{#groupAction.list}"
> listKey="id" listValue="name"
> />
> 
> 
> Does anyone know if this can be done? Can I configure struts to set
> user.group as null rather than create an empty Group object if no
> id/value has been specified in the drop down select box?
> 
> Is this something that is working as desired, and I'm the one who needs
> to change? Or does struts maybe needs a new feature request in jira?
-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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



Re: Why do s:select and s:submit add a ?

2008-08-20 Thread Stephan Schröder
> http://struts.apache.org/2.x/docs/xhtml-theme.html
> http://struts.apache.org/2.x/docs/themes-and-templates.html

short version: use the theme="simple" attribute

Are you user a html-form or the struts2-form-tag? I guess it's the html-form 
from what you write (which wouldn't be that good).
If you don't like the style struts-forms are displayed on default, write your 
on theme. See the "How to create your own themes based on existing themes" link 
on the themes-and-templates-page which has been given to you at the top.

/Stephan
-- 
Pt! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

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



Re: struts 2.0.11.2 problem

2008-08-20 Thread Stephan Schröder
> Initially when i don't have in my session
> 
> it is working if i write getters and setters for user object in my action 
> class
 
Exactly, because the action is pushed onto the value stack automatically.
You might want to read the short section on the Value Stack / OGNL on the 
freely available ebook "Starting Struts 2" 
(gestor-escolar.googlecode.com/files/struts2.pdf) on page 29 to 31 to 
understand which variables are accessible within tags.
An even better place to look is chapter 6.1 of "Struts 2 in Action" which is 
more detailed (but not available for free).

/Stephan
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: struts 2.0.11.2 problem

2008-08-20 Thread Stephan Schröder
your user is in the session not on the value stack therefore you should try 
this:


/Stephan

 Original-Nachricht 
> Datum: Wed, 20 Aug 2008 15:11:51 +0530
> Von: "ravindra" <[EMAIL PROTECTED]>
> An: user@struts.apache.org
> Betreff: struts 2.0.11.2  problem

> Hi all,
> 
>  
> 
> I have a user java bean object in my session; it has getter
> and
> setter for roleId.I have the following code in my jsp.Here I am trying to
> load different images
> 
> Based on the condition.
> 
>  
> 
> 
> 
>  style="border:none;" width="150" height="83">
> 
> 
> 
> 
> 
>   style="border:none;" width="150" height="83">
> 
> 
> 
>  
> 
> I think the syntax for test condition has changed in this version of
> struts.Please any one can help me with this issue.
> 
>  
> 
> Thankyou,
> 
> Ravindra.
> 
>  
> 

-- 
Pt! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

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



Re: is this right?

2008-08-20 Thread Stephan Schröder
> >> 12:35:31,491 WARN  [OgnlUtil] Caught OgnlException while setting property
> >> 'searchText' on type 
> >> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.

well, the problem is that ServletActionRedirectResult has no property called 
searchText which is of course clear if you think of it. The struts2-developers 
bended the semantics of the param-tag here but OGNL doesn't know that so it 
throws the warning. (I've seen this issue in the bug tracker so it's a known 
inconvenience.)

conclusion: live with the warning, the code is correct (and should work, 
doesn't it?)

/Stephan


> > Muralidhar Y wrote:
> >   
> >> If I do the same I am getting the following warning . I think it
> searching
> >> for the property in redirection class instead of action class. Kindly
> tell
> >> me what is the solution for this. 
> >>
> >> 12:35:31,491 WARN  [OgnlUtil] Caught OgnlException while setting
> property
> >> 'searchText' on type
> >> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
> >> ognl.NoSuchPropertyException:
> >> org.apache.struts2.dispatcher.ServletActionRedirectResult.searchText
> >>
> >> Warm regards,
> >> Muralidhar Y
> >> [EMAIL PROTECTED]
> >>  
> >> US Main: 877 KENSIUM (536.7486)
> >> India Main:  +91 9949495511
> >> India Fax:   +91 9949495522
> >> Kensium
> >> 200 S Wacker Dr, Suite 3100
> >> Chicago, IL 60606
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Re: [S2] Iterate through two lists

2008-08-20 Thread Stephan Schröder
I'm not sure whether the syntax is completly right but it should work like this:











> View this message in context:
> http://www.nabble.com/-S2--Iterate-through-two-lists-tp19052842p19052842.html
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



Re: struts2 getInputForward()

2008-08-18 Thread Stephan Schröder
look for Redirect (Action) Result.

/Stephan

> Maybe these resources can help:
> 
> http://struts.apache.org/2.x/docs/bootstrap.html
> http://struts.apache.org/2.x/docs/selecting-results.html
> http://struts.apache.org/2.x/docs/result-configuration.html
> http://struts.apache.org/2.x/docs/result-types.html
> 
> Nils-H
> 
> On Mon, Aug 18, 2008 at 11:31 AM, wanginfo <[EMAIL PROTECTED]> wrote:
> > how do i return to an actions input page/action? in struts1 there was
> the mapping.getInputForward() method, maybe i'm blind but i haven't found an
> equivalent in struts2.
> >
> > thanks in advance.
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser

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



Re: [S2] 2.1.3GA?

2008-08-18 Thread Stephan Schröder
> Is there an ETA on when 2.1.3 (or greater) will go GA?
 
not that i know of (which doesn't say much) but the bugtracker 
(https://issues.apache.org/struts/secure/Dashboard.jspa) site says it's 87% 
finisched.

/Stephan
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: Struts2 Application Structure

2008-08-18 Thread Stephan Schröder
Annother middle way would be to use the "plain text result" and no separate 
class attribute like this


  
  /intro.html


Advantages:
-no own Action class (ActionSupport is used)
-your static resources don't get processed which should save time
-you can still your Security interceptors to check the Authentication and 
Authorization of the user

/Stephan

> >> Roger wrote:
> >> > Having followed this group for a while I know that the generally
> >> accepted
> >> > wisdom is that every page should be handled via an Action. However, I
> >> > have an application that is probably going to be 70% static pages
> with
> >> > 30% Strut-able actions to handle form entry etc etc. This means that
> >> I'm
> >> > going to have an awful lot of action classes that do nothing other
> than
> >> > display the next page which feels kludgy. How would people deal with
> >> > this?
> >> >
> >> > Regards
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Re: Object put in HttpSession can't be found by S2

2008-08-17 Thread Stephan Schröder
> --- On Sun, 8/17/08, "Stephan Schröder" wrote:
> > i'm pretty sure  works too.
> 
> AFAIK the "#" syntax will work only if the variable was defined as a named
> stack context variable via something like  or as the value of a
> "var" ("id" in S2.0) attribute and so on.
> 
> Dave

good to know.

Thanks,
Stephan
-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Re: Validate associate Map

2008-08-17 Thread Stephan Schröder
i guess the short answer is: write it validateSave()-Method. The workflow 
interceptor should only call it if "save" is the invoke method.

> > I have to write custom validation method where I iterate all
> > "PageText" class and validate it. I want to use validate() 
> > method from ActionSupport class but the method is invoke always.
> > I need invoke validator method only when is invoke method
> > save(); Is better resolution?
> 
> One option would be to read the documentation for the validation
> interceptor [1,2] and its superclass, MethodFilterInterceptor [3].
> 
> Dave
> 
> [1] Validation interceptor overview:
> http://struts.apache.org/2.x/docs/validation-interceptor.html
> 
> [2] ValidationInterceptor Javadocs:
> http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/validator/ValidationInterceptor.html
> 
> [3] MethodFilterInterceptor Javadocs:
> http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/MethodFilterInterceptor.html
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Re: Object put in HttpSession can't be found by S2

2008-08-17 Thread Stephan Schröder
i'm pretty sure  works too.

/Stephan

> use "#session.skillsFound" or "#session[''skillsFound']"
> 
> musachy
> >
> > In my action I put a Set called "skillsFound" in the HttpSession. Then
> > I want to access it (and iterate through it) from a jsp, but this line
> > of code gives a False result:
> >
> > 
> >
> > Is there something I've forgotten to do or have I misunderstood things?
> >
> > Thanks in advance!
> >
> > /Ylva

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Re: RE: [S2]Validation with xml file not working

2008-08-15 Thread Stephan Schröder
> Stephan, are you getting this exception ("URI is not hierarchical") too?

actually i did, i just checked the logs (catalina.out). But the last time was 
on July 22th.
But i have some more straight forward errors now:

Caught exception while loading file 
actions/security/Login-register-validation.xml
www.opensymphony.com - Class: java.net.PlainSocketImpl
File: PlainSocketImpl.java
Method: connect
Line: 177 - java/net/PlainSocketImpl.java:177:-1
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)
...
Caused by: java.net.UnknownHostException: www.opensymphony.com
  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
...

Important Information: when i tested the webapp on my laptop the laptop wasn't 
online (local Tomcat6) :-)
So does that mean validation will always fail when the server has no internet 
connection?! Probably because it tries to check if the xml-file is well formed 
and fails to get the DTD? What could be done as workaround for this problem?

/Stephan

 Original-Nachricht 
> Datum: Fri, 15 Aug 2008 13:02:20 +0200
> Von: "Ylva Degerfeldt" <[EMAIL PROTECTED]>
> An: "Struts Users Mailing List" 
> Betreff: Re: RE: [S2]Validation with xml file not working

> About the interceptors on the default stack I don't know how to check
> that since it's built in. But "Struts in Action" says that in the
> struts-default.xml, the validation interceptor comes before the
> workflow interceptor. And I don't think that's the problem anyway
> since simple validation is working.
> 
> It's just this weird "URI is not hierarchical" exception which happens
> (among other places) in ValidatorFactory.parseValidators
> 
> Anyone who has any ideas why this is happening?
> 
> Stephan, are you getting this exception too?
> 
> /Ylva
> 
> On Fri, Aug 15, 2008 at 10:15 AM, "Stephan Schröder" <[EMAIL PROTECTED]>
> wrote:
> >
> > actually, now i have the same problem (or a variation of it) :-)
> >
> > I develop under Vista with eclipse. When i deploy the webapp from
> eclipse (to Tomcat6) validation works fine. But when i export to war-file and
> deploy it on my xubuntu laptop with Tomcat6, validation is omitted. The
> validation-files are present in the war-file. Could this be because of a
> different xml file encoding? (On vista it's UTF8. I have no idea what Tomcat6
> expects but UTF8 sounds reasonable.)
> >
> >  Original-Nachricht 
> >> Datum: Thu, 14 Aug 2008 18:38:02 -0700 (PDT)
> >> Von: Dave Newton <[EMAIL PROTECTED]>
> >> An: Struts Users Mailing List 
> >> Betreff: RE: [S2]Validation with xml file not working
> >
> >> I think he was asking the original poster if *his* stack included those
> >> interceptors in the correct order, since it's his validation that isn't
> >> working properly.
> >>
> >> Dave
> >>
> >> --- On Thu, 8/14/08, Martin Gainty <[EMAIL PROTECTED]> wrote:
> >> > yes .. vanilla config from struts-default.xml
> >> >
> >> >  
> >> >  >> > name="validationWorkflowStack">
> >> >  >> > name="basicStack"/>
> >> >  >> > name="validation"/>
> >> >  >> > name="workflow"/>
> >> > 
> >> >
> >> > HTH
> >> > Martin
> >> >
> >> >
> >> > > Date: Fri, 15 Aug 2008 00:22:01 +0200
> >> > > From: [EMAIL PROTECTED]
> >> > > Subject: Re: [S2]Validation with xml file not working
> >> > > To: user@struts.apache.org
> >> > >
> >> > > > What could it be?
> >> > >
> >> > > i don't know which interceptors are on your
> >> > default stack. Does 'workflow' come after
> >> > 'validation'?
> >> > >
> >> > > /Stephan
> >> > >
> >> > >  Original-Nachricht 
> >> > > > Datum: Thu, 14 Aug 2008 18:20:33 +0200
> >> > > > Von: "Ylva Degerfeldt"
> >> > <[EMAIL PROTECTED]>
> >> > > > An: "Struts Users Mailing List"
> >> > 
> >> > > > Betreff: Re: [S2]Validation with xml file not
> >> > working
> >> > >
> >> > > > Lukasz, I'm not sure how to check the
> >> > deployment but I was th

Re: Session ID

2008-08-15 Thread Stephan Schröder
> That would work for a action, but how to it for interceptor?

Try this one:
ServletActionContext.getRequest().getSession().getId();

/Stephan


 Original-Nachricht 
> Datum: Fri, 15 Aug 2008 10:27:35 +0200
> Von: "Hrvoje Ban" <[EMAIL PROTECTED]>
> An: "Struts Users Mailing List" 
> Betreff: Re: Session ID

> On Fri, Aug 15, 2008 at 9:47 AM, Chris Pratt <[EMAIL PROTECTED]>
> wrote:
> > I usually implement ServletRequestAware so that I can call
> > request.getSession().getId().  I would love to see them add that value
> to
> > the SessionMap but it's not there at the moment.
> >  (*Chris*)
> 
> That would work for a action, but how to it for interceptor?
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

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



Re: RE: [S2]Validation with xml file not working

2008-08-15 Thread Stephan Schröder

actually, now i have the same problem (or a variation of it) :-)

I develop under Vista with eclipse. When i deploy the webapp from eclipse (to 
Tomcat6) validation works fine. But when i export to war-file and deploy it on 
my xubuntu laptop with Tomcat6, validation is omitted. The validation-files are 
present in the war-file. Could this be because of a different xml file 
encoding? (On vista it's UTF8. I have no idea what Tomcat6 expects but UTF8 
sounds reasonable.)

 Original-Nachricht 
> Datum: Thu, 14 Aug 2008 18:38:02 -0700 (PDT)
> Von: Dave Newton <[EMAIL PROTECTED]>
> An: Struts Users Mailing List 
> Betreff: RE: [S2]Validation with xml file not working

> I think he was asking the original poster if *his* stack included those
> interceptors in the correct order, since it's his validation that isn't
> working properly.
> 
> Dave
> 
> --- On Thu, 8/14/08, Martin Gainty <[EMAIL PROTECTED]> wrote:
> > yes .. vanilla config from struts-default.xml
> > 
> >  
> >  > name="validationWorkflowStack">
> >  > name="basicStack"/>
> >  > name="validation"/>
> >  > name="workflow"/>
> > 
> > 
> > HTH
> > Martin 
> > 
> > 
> > > Date: Fri, 15 Aug 2008 00:22:01 +0200
> > > From: [EMAIL PROTECTED]
> > > Subject: Re: [S2]Validation with xml file not working
> > > To: user@struts.apache.org
> > > 
> > > > What could it be?
> > > 
> > > i don't know which interceptors are on your
> > default stack. Does 'workflow' come after
> > 'validation'?
> > > 
> > > /Stephan
> > > 
> > >  Original-Nachricht 
> > > > Datum: Thu, 14 Aug 2008 18:20:33 +0200
> > > > Von: "Ylva Degerfeldt"
> > <[EMAIL PROTECTED]>
> > > > An: "Struts Users Mailing List"
> > 
> > > > Betreff: Re: [S2]Validation with xml file not
> > working
> > > 
> > > > Lukasz, I'm not sure how to check the
> > deployment but I was thinking
> > > > that too. (I'm using NetBeans 5.5.1 and Sun
> > App. server.)
> > > > 
> > > > André, it's funny you should mention that
> > because I just changed the
> > > > name From .-validation.xml to
> > -validations.xml because they
> > > > must have misspelled it in one place in the
> > "Struts 2 in Action" book,
> > > > so I thought that was the correct way since the
> > name without the s
> > > > gives me this exception:
> > > > 
> > > > java.lang.IllegalArgumentException: URI is not
> > hierarchical
> > > > 
> > > > At least I know it has nothing to do with that
> > I'm uploading a file
> > > > from a form, 'cause that part works fine.
> > It's something about the
> > > > validation. What could it be?
> > > > 
> > > > /y
> > > > 
> > > > On Thu, Aug 14, 2008 at 6:04 PM, André Cedik |
> > GDG
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Maybe it's just because of the
> > misspelling.
> > > > > If you'd like to do validation this way,
> > > > > your xml-file should be named
> > > > > "NameAndCvAction-validation.xml"
> > without
> > > > > the "s" at the end.
> > > > >
> > > > >
> > > > > Ylva Degerfeldt wrote:
> > > > >> Hi everyone,
> > > > >>
> > > > >> I'm trying to use the Validation
> > framework by creating a file called
> > > > >> NameAndCvAction-validations.xml, for my
> > action "NameAndCvAction", but
> > > > >> it's not working the way it should.
> > > > >> I've stepped through the code and it
> > seems that the validations that
> > > > >> should have been made through the xml
> > file just don't happen.
> > > > >>
> > > > >> When, for instance, I've tried to
> > deliberately leave some fields empty
> > > > >> (which the validator should have
> > noticed), the execute method is still
> > > > >> invoked. This shouldn't happen when
> > there are validation errors,
> > > > >> right?
> > > > >>
> > > > >> I've put the validation xml file in
> > the same directory (and package)
> > > > >> as the corresponding action, but it
> > seems that Struts 2 can't find it
> > > > >> anyway. What am I doing wrong?
> > > > >>
> > > > >> This is the declaration of my action in
> > struts.xml:
> > > > >> .
> > > > >>  > "NameAndCvAction" class =
> > > > "Web.StrutsActions.NameAndCvAction">
> > > > >>
> > /showSkills.jsp
> > > > >>  > "input">/NameAndCv.jsp
> > > > >> 
> > > > >> 
> > > > >> (This belongs to a package that extends
> > struts-default)
> > > > >>
> > > > >> By the way, I'm also using simple
> > validation which works without
> > > > >> problems. (But I'd like to know how
> > to use the validation framework
> > > > >> "the harder way" too.)
> > > > >>
> > > > >> Can somebody please help me?
> > > > >>
> > > > >> Thanks in advance!
> > > > >>
> > > > >> /Ylva



-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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

Re: [S2]Validation with xml file not working

2008-08-14 Thread Stephan Schröder
> What could it be?

i don't know which interceptors are on your default stack. Does 'workflow' come 
after 'validation'?

/Stephan

 Original-Nachricht 
> Datum: Thu, 14 Aug 2008 18:20:33 +0200
> Von: "Ylva Degerfeldt" <[EMAIL PROTECTED]>
> An: "Struts Users Mailing List" 
> Betreff: Re: [S2]Validation with xml file not working

> Lukasz, I'm not sure how to check the deployment but I was thinking
> that too. (I'm using NetBeans 5.5.1 and Sun App. server.)
> 
> André, it's funny you should mention that because I just changed the
> name From .-validation.xml to -validations.xml because they
> must have misspelled it in one place in the "Struts 2 in Action" book,
> so I thought that was the correct way since the name without the s
> gives me this exception:
> 
> java.lang.IllegalArgumentException: URI is not hierarchical
> 
> At least I know it has nothing to do with that I'm uploading a file
> from a form, 'cause that part works fine. It's something about the
> validation. What could it be?
> 
> /y
> 
> On Thu, Aug 14, 2008 at 6:04 PM, André Cedik | GDG
> <[EMAIL PROTECTED]> wrote:
> > Maybe it's just because of the misspelling.
> > If you'd like to do validation this way,
> > your xml-file should be named
> > "NameAndCvAction-validation.xml" without
> > the "s" at the end.
> >
> >
> > Ylva Degerfeldt wrote:
> >> Hi everyone,
> >>
> >> I'm trying to use the Validation framework by creating a file called
> >> NameAndCvAction-validations.xml, for my action "NameAndCvAction", but
> >> it's not working the way it should.
> >> I've stepped through the code and it seems that the validations that
> >> should have been made through the xml file just don't happen.
> >>
> >> When, for instance, I've tried to deliberately leave some fields empty
> >> (which the validator should have noticed), the execute method is still
> >> invoked. This shouldn't happen when there are validation errors,
> >> right?
> >>
> >> I've put the validation xml file in the same directory (and package)
> >> as the corresponding action, but it seems that Struts 2 can't find it
> >> anyway. What am I doing wrong?
> >>
> >> This is the declaration of my action in struts.xml:
> >> .
> >>  "Web.StrutsActions.NameAndCvAction">
> >> /showSkills.jsp
> >> /NameAndCv.jsp
> >> 
> >> 
> >> (This belongs to a package that extends struts-default)
> >>
> >> By the way, I'm also using simple validation which works without
> >> problems. (But I'd like to know how to use the validation framework
> >> "the harder way" too.)
> >>
> >> Can somebody please help me?
> >>
> >> Thanks in advance!
> >>
> >> /Ylva
> >>
> >> -
> >> 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]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



Could not find property [struts.valueStack] using struts 2.1.2

2008-08-14 Thread Stephan Schröder
hi,

this is my first post to the mailing list so i hope this is the right 
place/email address.

I wrote a 'hello world'-application using struts 2.1.2 using freemarker-result.
The application works fine but the following warnings are displayed:

INFO: Server startup in 757 ms
14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNUNG: Could not find property [struts.valueStack]
14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNUNG: Could not find property [.freemarker.Request]
14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNUNG: Could not find property [.freemarker.RequestParameters]

Did i miss something?

You can download the war-file here: 
http://www.file-upload.net/download-1042786/helloworld.war.html

regards,
Stephan
-- 
Pt! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

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