Re: Tiles in 1.3.9

2008-04-04 Thread Antonio Petrelli
2008/4/4, balaji.m.cs [EMAIL PROTECTED]:

 java.lang.IllegalArgumentException: path must begin with a /



What's the path that you are calling?

Antonio


Re: [S2] Struts with Web Services

2008-04-04 Thread Lukasz Lenart
  http://www.ja-sig.org/products/cas/

  -Wes

Do you have some experience with that? It looks quite interesting ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Tiles in 1.3.9

2008-04-04 Thread Lukasz Lenart
Hi,

  struts-config
 action-mappings
 action path=/baselayout
 forward=.tiles-defs/
   /action-mappings

  tiles-defs.xml
   definition name=.tiles-defs path=/jsp/baseLayout.jsp

There is good practice to start Tiles definitions with dot - .tiles-defs
I don't see ant forwards in your struts-config.xml, could you past them here?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Tiles in 1.3.9

2008-04-04 Thread Antonio Petrelli
2008/4/4, Lukasz Lenart [EMAIL PROTECTED]:

 Hi,


   struts-config
  action-mappings
  action path=/baselayout
  forward=.tiles-defs/
/action-mappings


   tiles-defs.xml

definition name=.tiles-defs path=/jsp/baseLayout.jsp



Good catch Lukasz! Now I remember that:
*Struts-Tiles does not support forward actions, only forwards inside normal
actions*

Antonio


Re: Freemarker (old version that struts2 uses) disappearing pages

2008-04-04 Thread Jonny Cavell

I use Maven, and if you look at struts 2.0.11.1's dependencies
(http://www.mvnrepository.com/artifact/org.apache.struts/struts2-core/2.0.11.1)
you'll see that it's Freemarker version 2.3.8 it depends on. I can't
override this in Maven, even if I attempt to exclude it and force the latest
version of Freemarker:


dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-core/artifactId
version2.0.11/version
exclusions
exclusion
groupIdorg.freemarker/groupId
artifactIdfreemarker/artifactId
/exclusion
/exclusions
/dependency
dependency
groupIdorg.freemarker/groupId
artifactIdfreemarker/artifactId
version2.3.12/version
/dependency


Cheers

Jonny


Jeromy Evans - Blue Sky Minds wrote:
 
 Jonny Cavell wrote:
 I have a problem that seems to occur periodically.

 My freemarker templates, served by struts2, stop appearing - I get a
 blank
 page. There are no useful messages in the logs, other than saying that it
 couldn't find the template (which it could find previously).

 First question - does anybody know what this problem might be?

   
 No, other than a classpath/deployment problem.
 I would like to upgrade to the latest version of Freemarker. However,
 Struts2 in its wisdom has locked me down to version 2.3.8, and this was
 released way back in 2006. Are there any plans to resolve this issue? 

   
 The 2.1.1 version of Struts uses FreeMarker 2.3.11   You may be able to 
 replace the 2.3.8 jar with the 2.3.11 jar without problems.
 
 I doubt the problem is with FreeMarker.  It's more likely to be the 
 FreeMarkerManager included with Struts 2 that's responsible for 
 searching for templates in the classpath.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Freemarker-%28old-version-that-struts2-uses%29-disappearing-pages-tp16467449p16487687.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: any struts 2 unit testers out there?

2008-04-04 Thread paulbrickell

Actually thats an interesting post. To my mind it doesn't demonstrate a
solution. It demonstrates the problem.

Here is why I think this.

Struts 2 is just frankly brilliant for people doing test first development.
The classes you create really are POJOs. There are no dependencies on any
framework in my action classes. For example parameters are parsed well away
from my action and the values are set using simple properties, things like
sessions are simply maps. It is a truly new world for those of who have
suffered the horror of mocking http requests, responses, context and the
like.

But this simple scenario brings all that pain flooding back. I add a line in
my action like this...

String yadaYada = getText(some.doodad);

And my lovely world comes unraveled real quick. Now I need mock objects up
the ying-yang.

I started using the tutorial from the link posted (I am an Arsenal fan btw,
so got two for the price of one, thanks), but it still doesn't provide a
simple solution to the problem. To get this to work I have to build not just
the application context but a mass of supporting objects to get a web
application framework up and running before I can test my simple POJO.

I am not going to give up just yet, but I think I am still going to have to
look for another way.

Cheers,
Paul B.





Relph,Brian wrote:
 
 
 I recommend creating an action context.  Here is the basic guide I
 followed to do so:
 
 http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/ 
 
 If you are not using spring or the struts2 spring plugin, you can cut out
 all the code around the applicationContext.
 
 
 -Original Message-
 From: paulbrickell [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 03, 2008 11:44 AM
 To: user@struts.apache.org
 Subject: Re: any struts 2 unit testers out there?
 
 
 I am trying to deal with the same issue. Did you get any resolution?
 
 Following on from the reply asking for a stack trace, here is what I am
 getting...
 
 
 java.lang.NullPointerException
   at
 com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:299)
   at
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:172)
   at
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:87)
   at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)
 SNIP
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
   at
 org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
   at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
   at
 org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
   at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
   at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
   at
 org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
   at
 org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
   at
 org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
   at
 org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
   at
 org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
   at
 org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
   at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
   at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
 
 
 It is caused by ActionContext.getContext() returning null. Quite obviously
 I do not have an action context during my unit testing.
 
 Now I can certainly use the ActionContext.setContext() in my tests setup
 method to push one into thread local storage and that works OK. It isn't
 ideal though because ActionContext is a concrete class and so my choices
 then become a bit limited. 
 
 I could create an instance but when I try this I find I have to create a
 rather large object model to make it actually work. To the point where I
 despair and give up.
 
 Alternatively I could use a mock library (like easy mock). But I am not
 inclined to 

Re: Tiles in 1.3.9

2008-04-04 Thread balaji.m.cs

i point the issue by myself.
the main issue is i have not given the 

controller processorClass=org.apache.struts.action.TilesRequestProcessor
bufferSize=4096 debug=0/
in struts-config.xml.
after i give its working... thanks for giving me the best pratices on
tiles...

if u still find any issues in my code pls say so that i can have a
correction

Lukasz Lenart wrote:
 
 Hi,
 
  struts-config
 action-mappings
 action path=/baselayout
  forward=.tiles-defs/
   /action-mappings
 
  tiles-defs.xml
definition name=.tiles-defs path=/jsp/baseLayout.jsp
 
 There is good practice to start Tiles definitions with dot - .tiles-defs
 I don't see ant forwards in your struts-config.xml, could you past them
 here?
 
 
 Regards
 -- 
 Lukasz
 
 http://www.linkedin.com/in/lukaszlenart
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tiles-in-1.3.9-tp16483416p16490795.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: Tiles in 1.3.9

2008-04-04 Thread Mihai Scripca

dont you think it would be better practice naming tiles like this:
tile.def (*.def are like .jsp but virtual pages)

and only class tiles should be named with dot first like this .class-name?

i point the issue by myself.
the main issue is i have not given the 


controller processorClass=org.apache.struts.action.TilesRequestProcessor
bufferSize=4096 debug=0/
in struts-config.xml.
after i give its working... thanks for giving me the best pratices on
tiles...

if u still find any issues in my code pls say so that i can have a
correction

Lukasz Lenart wrote:
  

Hi,



 struts-config
action-mappings
action path=/baselayout
  

 forward=.tiles-defs/


  /action-mappings
  
 tiles-defs.xml
  

   definition name=.tiles-defs path=/jsp/baseLayout.jsp

There is good practice to start Tiles definitions with dot - .tiles-defs
I don't see ant forwards in your struts-config.xml, could you past them
here?


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

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






  




Re: form within form

2008-04-04 Thread Ehteshamul Haque
I dont think so. Can you please tell why we need that? you can use lookup 
dispatch action if you want to chose action depending upon criterion.

Thank you.


Ehteshamul Haque




  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

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



RE: any struts 2 unit testers out there?

2008-04-04 Thread paulbrickell

Actually thats an interesting post. To my mind it doesn't demonstrate a
solution. It demonstrates the problem.

Here is why I think this.

Struts 2 is just frankly brilliant for people doing test first development.
The classes you create really are POJOs. There are no dependencies on any
framework in my action classes. For example parameters are parsed well away
from my action and the values are set using simple properties, things like
sessions are simply maps. It is a truly new world for those of who have
suffered the horror of mocking http requests, responses, context and the
like.

But this simple scenario brings all that pain flooding back. I add a line in
my action like this...

String yadaYada = getText(some.doodad);

And my lovely world comes unraveled real quick. Now I need mock objects up
the ying-yang.

I started using the tutorial from the link posted (I am an Arsenal fan btw,
so got two for the price of one, thanks), but it still doesn't provide a
simple solution to the problem. To get this to work I have to build not just
the application context but a mass of supporting objects to get a (partial)
web application framework up and running before I can test my simple POJO.

I am not going to give up just yet, but I think I am still going to have to
look for another way.

Cheers,
Paul B.




Relph,Brian wrote:
 
 
 I recommend creating an action context.  Here is the basic guide I
 followed to do so:
 
 http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/ 
 
 If you are not using spring or the struts2 spring plugin, you can cut out
 all the code around the applicationContext.
 
 
 -Original Message-
 From: paulbrickell [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, April 03, 2008 11:44 AM
 To: user@struts.apache.org
 Subject: Re: any struts 2 unit testers out there?
 
 
 I am trying to deal with the same issue. Did you get any resolution?
 
 Following on from the reply asking for a stack trace, here is what I am
 getting...
 
 
 java.lang.NullPointerException
   at
 com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:299)
   at
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:172)
   at
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:87)
   at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)
 SNIP
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
   at
 org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
   at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
   at
 org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
   at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
   at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
   at
 org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
   at
 org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
   at
 org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
   at
 org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
   at
 org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
   at
 org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
   at
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
   at
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
 
 
 It is caused by ActionContext.getContext() returning null. Quite obviously
 I do not have an action context during my unit testing.
 
 Now I can certainly use the ActionContext.setContext() in my tests setup
 method to push one into thread local storage and that works OK. It isn't
 ideal though because ActionContext is a concrete class and so my choices
 then become a bit limited. 
 
 I could create an instance but when I try this I find I have to create a
 rather large object model to make it actually work. To the point where I
 despair and give up.
 
 Alternatively I could use a mock library (like easy mock). But I am not
 inclined 

Re: Tiles in 1.3.9

2008-04-04 Thread Antonio Petrelli
2008/4/4, Mihai Scripca [EMAIL PROTECTED]:

 dont you think it would be better practice naming tiles like this:
 tile.def (*.def are like .jsp but virtual pages)

 and only class tiles should be named with dot first like this .class-name?



Well, there is no guideline/best practice defined for Tiles definition
names, so you can do your own :-D

Antonio


[OT] What do you code today?

2008-04-04 Thread Ted Husted
While outward facing web application get the most publicity, I know
that most of us are heads-down on internally-facing applications
designed for fellow employees to use over the corporate intranet.

I'm trying to put together a list of the typical types of applications
that  enterprise developer write in real life. For example, my last
project involved a system to track drafting, granting, monitoring, and
enforcing water permits administered by a government agency. We would
create an initial record for a permit, and then add child records to
track progress through the workflow, and also update the master record
along the way. For management, a key item here is a tracking report,
which we exported to Word (using a third-party tool) for better
formatting. For engineers, a key item was a flexible search system to
quickly find a master or child record. Other interesting features are
workflows where one task leads to another. When we completed one task
(child record), the next is often implied, and so we had a workflow
that would default the next task to work on when a current task was
closed. Another interesting requirement was that sometimes master
items were merged under another uber-master-item, becoming, in effect,
child items themselves. In most cases, the application simply exposed
business models that we designed into the database, so the application
has little business logic of its own. Most of the workflows were
designed to find, list, edit, or view one database entity or the
other.

So, if anyone else is up for sharing, I'd be interested in hearing
what sort of things other people are doing these days. (If your not
comfortable posting the list, feel free to mail me direct.)

-Ted.

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



Re: struts.xml

2008-04-04 Thread Adam Hardy
I completely jumped the gun. My test was flawed and on fixing it, I found that 
struts was reloading its config on my dispatcher.init() call, and then again 
just before the request but without my config and so ignoring the configured 
Dispatch that I set!


I tried the other approach but I can't see any way to get hold of the Dispatcher 
(since Dispatcher.getInstance() returns null before I launch the request).





Adam Hardy on 04/04/08 00:46, wrote:

Brian, thanks for the low-down. It works well.

Relph,Brian on 03/04/08 15:53, wrote:
 
Copy paste error, you need to initialize the Dispatcher with your 
testConfig map:


MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);

dispatcher = new Dispatcher(servletContext,
testConfig);
dispatcher.init();
Dispatcher.setInstance(dispatcher);


-Original Message-
From: Relph,Brian [mailto:[EMAIL PROTECTED] Sent: Thursday, 
April 03, 2008 9:48 AM

To: Struts Users Mailing List
Subject: RE: struts.xml


You need to have access to the Dispatcher and the ServletContext in 
your tests, but you could do something like this for per-unit test 
configurations:


ConfigurationProvider provider = new 
StrutsXmlConfigurationProvider(

struts-test.xml, true, servletContext);

dispatcher.getConfigurationManager().addConfigurationProvider(provider);

dispatcher.getConfigurationManager().reload();

If you set devMode = true for your tests, you might be able to avoid 
the reload() call.


If you have a just a single struts-test.xml for all of your tests, 
you could do something like this in your setUp():


MapString, String testConfig = new HashMapString, String();
testConfig.put(config, 
struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml);

dispatcher = new Dispatcher(servletContext,
new HashMapString, String());
dispatcher.init();
Dispatcher.setInstance(dispatcher);

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 5:00 AM
To: Struts Users Mailing List
Subject: Re: struts.xml

Adam Hardy on 02/04/08 12:23, wrote:
Can I have a second struts.xml in my test directory, and if so, how 
do I configure it?


I'm testing some stuff using HttpUnit which launches the whole webapp 
in my tests. Having a test-only struts.xml will keep the test 
mappings out of the real webapp, allow me to drop stuff I don't need 
for the tests, and make the tests faster.


 From the lack of replies, I assume the answer is 'No, you cannot have 
an alternative struts.xml'.


I was checking the low-down on the wiki, where I found that the struts 
configuration xml can be in multiple files listed by the property in the

struts.properties:

### A list of configuration files automatically loaded by Struts 
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml 



Using this property, I can set up my maven environment to filter 
struts.properties as a resource and set that property explicitly, so 
in testing I can have 'struts-test.xml'


This works to a limited extent, i.e. one struts.xml for all testing, 
another for in-container deployment.


It's not quite ideal though, as I would prefer to choose the 
struts.xml on a per-test basis.



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



Re: Struts 2.1 TabbedPanel scenario

2008-04-04 Thread Shoaib Gauhar

It has definitely solved a big problem. Now, i can show the correct data of
two tabs, submit them and have correct results. Actually, my case is very
simple, as i told you that the two tabs will not be related, so, each tab
will be submitted independently without needing each others data because
there is no common data. So, everything is fine. EXCEPT.

If i submit one tab the page submits and as a result of this the other tabs'
data is lost. By lost i mean that the changes i made in other tabs are reset
because the page is submitted. I am still unable to find out how to make
each tab ajax based. Here is my jsp code. 


s:url var=test1 value=demo/DefaultAllowanceDetailsAction.action/
s:url var=test2 value=demo/LibraryFormDefaultAction.action/

sx:tabbedpanel id=tabbedPanel useSelectedTabCookie=true
  sx:div id=div1 label=Allowance Details href=%{test1}
refreshOnShow=false preload=true
s:action name=demo/DefaultAllowanceDetailsAction.action
executeResult=true /
  /sx:div

  sx:div id=div2 label=Library Form href=%{test2}
refreshOnShow=false preload=true
s:action name=demo/LibraryFormDefaultAction.action
executeResult=true /
  /sx:div 
/sx:tabbedpanel

I have put false in refreshOnShow attribute so the tab is not refreshed once
it gets selected. What i want is to maintain the history of the changes made
to other tabs which were not submitted.

Thanks,

Shoaib Ahmad Gauhar


Shoaib Gauhar wrote:
 
 Hello,
 
 Here is the scenrio. I have two action classes. ClassA and ClassB. There
 is no relationship among these classes. You might say that if there is no
 relationship then why i have to put them in one single jsp. Well its a
 client's requirement.
 
 In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB.
 
 Each tab has fields concerned to their classes as defined above. Tab1 -
 ClassA and Tab2 - ClassB.
 
 Can we do it? I have tried this but what happens is that when i submit the
 data on Tab1, Tab2's data becomes empty.
 
 So, any ideas will be highly appreciated. Furthermore, i am quite new to
 tabbed panel and would require clear tips and ideas.
 
 Thanks in advance,
 
 Shoaib Ahmad Gauhar
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2.1-TabbedPanel-scenario-tp16446729p16491420.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: any struts 2 unit testers out there?

2008-04-04 Thread Karr, David
And did you investigate using either of the common Java frameworks for
Mock objects, jMock and EasyMock? 

 -Original Message-
 From: paulbrickell [mailto:[EMAIL PROTECTED] 
 Sent: Friday, April 04, 2008 3:04 AM
 To: user@struts.apache.org
 Subject: RE: any struts 2 unit testers out there?
 
 
 Actually thats an interesting post. To my mind it doesn't 
 demonstrate a solution. It demonstrates the problem.
 
 Here is why I think this.
 
 Struts 2 is just frankly brilliant for people doing test 
 first development.
 The classes you create really are POJOs. There are no 
 dependencies on any framework in my action classes. For 
 example parameters are parsed well away from my action and 
 the values are set using simple properties, things like 
 sessions are simply maps. It is a truly new world for those 
 of who have suffered the horror of mocking http requests, 
 responses, context and the like.
 
 But this simple scenario brings all that pain flooding back. 
 I add a line in my action like this...
 
 String yadaYada = getText(some.doodad);
 
 And my lovely world comes unraveled real quick. Now I need 
 mock objects up the ying-yang.
 
 I started using the tutorial from the link posted (I am an 
 Arsenal fan btw, so got two for the price of one, thanks), 
 but it still doesn't provide a simple solution to the 
 problem. To get this to work I have to build not just the 
 application context but a mass of supporting objects to get a 
 (partial) web application framework up and running before I 
 can test my simple POJO.
 
 I am not going to give up just yet, but I think I am still 
 going to have to look for another way.
 
 Cheers,
 Paul B.
 
 
 
 
 Relph,Brian wrote:
  
  
  I recommend creating an action context.  Here is the basic guide I 
  followed to do so:
  
  
 http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-
  junit/
  
  If you are not using spring or the struts2 spring plugin, 
 you can cut 
  out all the code around the applicationContext.
  
  
  -Original Message-
  From: paulbrickell [mailto:[EMAIL PROTECTED]
  Sent: Thursday, April 03, 2008 11:44 AM
  To: user@struts.apache.org
  Subject: Re: any struts 2 unit testers out there?
  
  
  I am trying to deal with the same issue. Did you get any resolution?
  
  Following on from the reply asking for a stack trace, here 
 is what I 
  am getting...
  
  
  java.lang.NullPointerException
  at
  
 com.opensymphony.xwork2.util.LocalizedTextUtil.findText(Locali
 zedTextUtil.java:299)
  at
  
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProvid
 erSupport.java:172)
  at
  
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProvid
 erSupport.java:87)
  at 
 com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)
  SNIP
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
  
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
 orImpl.java:39)
  at
  
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
 odAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:585)
  at 
 org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
  at
  
 org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRo
 adie.java:98)
  at 
 org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
  at
  
 org.junit.internal.runners.MethodRoadie.runBeforesThenTestThen
 Afters(MethodRoadie.java:87)
  at 
 org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
  at 
 org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
  at
  
 org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(
 JUnit4ClassRunner.java:88)
  at
  
 org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4
 ClassRunner.java:51)
  at
  
 org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4Class
Runner.java:44)
  at
  
 org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoa
 die.java:27)
  at
  
 org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadi
 e.java:37)
  at
  
 org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRu
 nner.java:42)
  at
  
 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
 (JUnit4TestReference.java:38)
  at
  
 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
 ecution.java:38)
  at
  
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
 s(RemoteTestRunner.java:460)
  at
  
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
 s(RemoteTestRunner.java:673)
  at
  
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(Rem
 oteTestRunner.java:386)
  at
  
 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTest
  Runner.java:196)
  
  
  It is caused by ActionContext.getContext() returning null. Quite 
  obviously I do not have an action context during my unit testing.
  
  Now I can certainly use 

Re: any struts 2 unit testers out there?

2008-04-04 Thread Ian Roughley
Or look at the xwork / s2 test cases - there are some test classes in 
there that can help you. 


/Ian


Karr, David wrote:

And did you investigate using either of the common Java frameworks for
Mock objects, jMock and EasyMock? 

  

-Original Message-
From: paulbrickell [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 04, 2008 3:04 AM

To: user@struts.apache.org
Subject: RE: any struts 2 unit testers out there?


Actually thats an interesting post. To my mind it doesn't 
demonstrate a solution. It demonstrates the problem.


Here is why I think this.

Struts 2 is just frankly brilliant for people doing test 
first development.
The classes you create really are POJOs. There are no 
dependencies on any framework in my action classes. For 
example parameters are parsed well away from my action and 
the values are set using simple properties, things like 
sessions are simply maps. It is a truly new world for those 
of who have suffered the horror of mocking http requests, 
responses, context and the like.


But this simple scenario brings all that pain flooding back. 
I add a line in my action like this...


String yadaYada = getText(some.doodad);

And my lovely world comes unraveled real quick. Now I need 
mock objects up the ying-yang.


I started using the tutorial from the link posted (I am an 
Arsenal fan btw, so got two for the price of one, thanks), 
but it still doesn't provide a simple solution to the 
problem. To get this to work I have to build not just the 
application context but a mass of supporting objects to get a 
(partial) web application framework up and running before I 
can test my simple POJO.


I am not going to give up just yet, but I think I am still 
going to have to look for another way.


Cheers,
Paul B.




Relph,Brian wrote:

I recommend creating an action context.  Here is the basic guide I 
followed to do so:



  

http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-


junit/

If you are not using spring or the struts2 spring plugin, 
  
you can cut 


out all the code around the applicationContext.


-Original Message-
From: paulbrickell [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2008 11:44 AM
To: user@struts.apache.org
Subject: Re: any struts 2 unit testers out there?


I am trying to deal with the same issue. Did you get any resolution?

Following on from the reply asking for a stack trace, here 
  
is what I 


am getting...


java.lang.NullPointerException
at

  

com.opensymphony.xwork2.util.LocalizedTextUtil.findText(Locali
zedTextUtil.java:299)


at

  

com.opensymphony.xwork2.TextProviderSupport.getText(TextProvid
erSupport.java:172)


at

  

com.opensymphony.xwork2.TextProviderSupport.getText(TextProvid
erSupport.java:87)

	at 
  

com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)


SNIP
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

  

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
orImpl.java:39)


at

  

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
odAccessorImpl.java:25)


at java.lang.reflect.Method.invoke(Method.java:585)
	at 
  

org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)


at

  

org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRo
adie.java:98)

	at 
  

org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)


at

  

org.junit.internal.runners.MethodRoadie.runBeforesThenTestThen
Afters(MethodRoadie.java:87)

	at 
  

org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)

	at 
  

org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)


at

  

org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(
JUnit4ClassRunner.java:88)


at

  

org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4
ClassRunner.java:51)


at

  

org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4Class


Runner.java:44)
  

at

  

org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoa
die.java:27)


at

  

org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadi
e.java:37)


at

  

org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRu
nner.java:42)


at

  

org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:38)


at

  

org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestEx
ecution.java:38)


at

  

org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
s(RemoteTestRunner.java:460)


at

  

org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTest
s(RemoteTestRunner.java:673)


at

  


Re: [OT] What do you code today?

2008-04-04 Thread Martin Gainty
Could you suggest a pattern which would most closely match the requirements
for the typical workflow application?

When I think of workflow I think of a uber-dispatcher who assigns work based
on
a)capabilities of the resource
b)availability of the resource
c)priority of product/service
Any thoughts/ideas to implement a viable Architecture would be greatly
appreciated

Thanks
Martin
- Original Message -
From: Ted Husted [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, April 04, 2008 6:14 AM
Subject: [OT] What do you code today?


 While outward facing web application get the most publicity, I know
 that most of us are heads-down on internally-facing applications
 designed for fellow employees to use over the corporate intranet.

 I'm trying to put together a list of the typical types of applications
 that  enterprise developer write in real life. For example, my last
 project involved a system to track drafting, granting, monitoring, and
 enforcing water permits administered by a government agency. We would
 create an initial record for a permit, and then add child records to
 track progress through the workflow, and also update the master record
 along the way. For management, a key item here is a tracking report,
 which we exported to Word (using a third-party tool) for better
 formatting. For engineers, a key item was a flexible search system to
 quickly find a master or child record. Other interesting features are
 workflows where one task leads to another. When we completed one task
 (child record), the next is often implied, and so we had a workflow
 that would default the next task to work on when a current task was
 closed. Another interesting requirement was that sometimes master
 items were merged under another uber-master-item, becoming, in effect,
 child items themselves. In most cases, the application simply exposed
 business models that we designed into the database, so the application
 has little business logic of its own. Most of the workflows were
 designed to find, list, edit, or view one database entity or the
 other.

 So, if anyone else is up for sharing, I'd be interested in hearing
 what sort of things other people are doing these days. (If your not
 comfortable posting the list, feel free to mail me direct.)

 -Ted.

 -
 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]



Re: rrrrr...why my field returns null????

2008-04-04 Thread xianwinwin

I checked it on both IE7 and FireFox - no error on the js and the value is
NULL

any idea?!?!




Laurie Harper wrote:
 
 If it works without theme set to ajax, it's probably a client-side 
 issue. What browser are you using? Are there any Javascript errors
 reported?
 
 L.
 
 xianwinwin wrote:
 thank you Laurie for your reply.
 
 I made a type - its str not the Note. so the str is null :-(
 
 when I remove the theme=ajax it works fine. BUT I need it there (the
 idea
 that the form will disappear once the action is completed).
 
 how do I get the value of the str? rr :-(
 I've been trying different variation - nothing! 
 
 thanks for any pointer!  
 
 
 
 Laurie Harper wrote:
 Your action doesn't have a bean of name/type Note, it only has a single 
 String property 'str'. Did you mean this property is not being set? From 
 the code you've included, it should be set from the textfield so you 
 must have something configured wrong. What does your action mapping look 
 like? Are you using the default interceptor stack or have you specified 
 a different one?

 L.

 xianwinwin wrote:
 Can anyone advise why my bean is null.

 I have the following jsp page:

 html
 head
 s:head theme=ajax/ 
 /head
 body

 s:form
theme=ajax
id=myForm
cssStyle=font-size :   8pt; font-family: verdana 
action=notes_insert 
method=post 

s:textarea rows=5 cols=60 name=str label=Add Note
 required=true/


s:submit  align=center  targets=myForm theme=ajax/  

 /s:form

 when the user cllicks submit - the action 'insert' kicksin but the bean
 (Note) is null (yes, i have getter and setter)




 //action
 @Validation
 public class NoteAction extends BaseSupport implements Serializable
 {  
private String str;

 
@SkipValidation
public String insert()
{   
System.out.println(the value is + str);
}


public String getStr()
{
return str;
}

public void setStr(String str)
{
this.str = str;
}
 }


 -
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/r...why-my-field-returns-null-tp16449038p16491758.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: Connecting s:autocompleter and s:div

2008-04-04 Thread manishbel

Thanks for the response Musachy,

The problem still persists. i went ahead and tried to follow one of the
examples on struts showcase  A div 
that will listen to events to refresh and start/stop autoupdate.  the
result was the same. 

I also tried by copying the whole example into my application. the page
continues to refresh over and over.  and i see multiple sections being added
and eventually the browser hangs.

I am not sure what's going on as i am not very well versed with struts 2 or
Ajax.

Any ideas?

Thanks
Manish.


Musachy Barroso wrote:
 
 The problem is that the notify topics are published multiple times
 (before request, after request and on error). A parameter is passed to
 the topic listener indicating when the topic is fired. Search the
 archives for examples (dojo.event.topic.subscribe), also look at the
 ajax examples on showcase.
 
 musachy
 
 On Thu, Apr 3, 2008 at 1:00 PM, manishbel [EMAIL PROTECTED] wrote:

  Hello There,

  I am new to struts and have a requirement where i have to connect the
  autocompleter with the div e.g. when autocompleter's value changes  i
 need
  to refresh the contents of the div. i have written the following code to
  achieve that.

  The Div Code
  --
  s:div cssClass=formcontainer href=%{EmailDistributionList_Load}
  theme=ajax listenTopics=distributionListNameChange autoStart=false
  formId=EmailDistributionList 

  The AutoCompleter Code
  -
  s:autocompleter name=emailDistributionList.distributionListName
  keyName=emailDistributionList.id
 list=emailDistributionLists  listKey=id
 listValue=distributionListName
 searchType=substring
  notifyTopics=distributionListNameChange theme=ajax /

  When the jsp loads it tries to refresh the page over and over submitting
 the
  request to EmailDistributionList_Load action.

  Any pointers would be greatly appreciated.

  Thanks
  Manish

  --
  View this message in context:
 http://www.nabble.com/Connecting-s%3Aautocompleter-and-s%3Adiv-tp16467820p16467820.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
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Connecting-s%3Aautocompleter-and-s%3Adiv-tp16467820p16491866.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: Connecting s:autocompleter and s:div

2008-04-04 Thread Musachy Barroso
Could you post a minimal example of your jsp?

musachy

On Fri, Apr 4, 2008 at 11:06 AM, manishbel [EMAIL PROTECTED] wrote:

  Thanks for the response Musachy,

  The problem still persists. i went ahead and tried to follow one of the
  examples on struts showcase  A div
  that will listen to events to refresh and start/stop autoupdate.  the
  result was the same.

  I also tried by copying the whole example into my application. the page
  continues to refresh over and over.  and i see multiple sections being added
  and eventually the browser hangs.

  I am not sure what's going on as i am not very well versed with struts 2 or
  Ajax.

  Any ideas?

  Thanks
  Manish.




  Musachy Barroso wrote:
  
   The problem is that the notify topics are published multiple times
   (before request, after request and on error). A parameter is passed to
   the topic listener indicating when the topic is fired. Search the
   archives for examples (dojo.event.topic.subscribe), also look at the
   ajax examples on showcase.
  
   musachy
  
   On Thu, Apr 3, 2008 at 1:00 PM, manishbel [EMAIL PROTECTED] wrote:
  
Hello There,
  
I am new to struts and have a requirement where i have to connect the
autocompleter with the div e.g. when autocompleter's value changes  i
   need
to refresh the contents of the div. i have written the following code to
achieve that.
  
The Div Code
--
s:div cssClass=formcontainer href=%{EmailDistributionList_Load}
theme=ajax listenTopics=distributionListNameChange autoStart=false
formId=EmailDistributionList 
  
The AutoCompleter Code
-
s:autocompleter name=emailDistributionList.distributionListName
keyName=emailDistributionList.id
   list=emailDistributionLists  listKey=id
   listValue=distributionListName
   searchType=substring
notifyTopics=distributionListNameChange theme=ajax /
  
When the jsp loads it tries to refresh the page over and over submitting
   the
request to EmailDistributionList_Load action.
  
Any pointers would be greatly appreciated.
  
Thanks
Manish
  
--
View this message in context:
   
 http://www.nabble.com/Connecting-s%3Aautocompleter-and-s%3Adiv-tp16467820p16467820.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
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/Connecting-s%3Aautocompleter-and-s%3Adiv-tp16467820p16491866.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

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



Re: [OT] What do you code today?

2008-04-04 Thread Chris Pratt
I'm still working on externally facing applications.  The company has
a few different types of user that it supports (Members who receive
services, Providers who provide the services, Brokers who sell the
service, and Clients that pay for their members to receive services).
Each of these audiences has their own web site to support their needs.
 Up to about 4 months ago, each of these sites was written in it's
own, home-grown framework which effectively prevented developers from
one team helping out any of the other teams.

So, recently I had the opportunity to try out a few different
technology stacks to try and pick one for the company.  I started with
Struts 1 and we wrote a successful externally facing application that
was well received and most of the people that are maintaining it
haven't had any problems.

Next I wrote a Struts 1/Tiles 1 application that had a strict
internationalization requirement (since it had to support multiple
languages from day 1).  That also went very well and has been an easy
maintainence platform.

After that I wrote my first Struts 2 app (with Spring and Acegi
security).  I fell in love with the new controller, but I'm still a
bit disappointed in the view.  Struts 2 definitely has a steeper
learning curve for our junior programmers since it's a bigger
departure from what they're used to, but it's worth the climb.  And
while I think Acegi probably has a place in a packaged application
where you're not sure what form the authentication database will take,
it was waaayyy overkill and waaayyy, waaayyy to complex for what we
needed.  To this day I'm still the only one that can do maintainence
on that part of the site.

So then the powers-that-be sent down a decree that, since they
consider us an IBM shop and HAL has said that JSF is the way of the
future, that we would have to use JSF (even after all the discovery
that had been done in-house).  So we embarked on a two month fiasco to
try and convert our current Struts 1 like, MVC applications, that have
requirements like sending out formatted e-mails and generating PDF's
on the fly, to JSF which was a dismal failure.

Fast forward to 4 months ago when we started the actual rewrite of the
first audience web site using Struts 2, Spring, and Tiles 2.  We
removed Acegi from the mix and wrote a very flexible (if I do say so
myself) authentication/authorization system that is currently backed
by both LDAP and ActiveDirectory (something we could never get working
in Acegi).  We have about 1 month left and we'll be shipping the
first of the new, unified, web sites.  Then it's on to the next
audience.
  (*Chris*)

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



Re: Struts 2 exception problem

2008-04-04 Thread jimski

Hi Oguzhan- 

We've run into the *exact* same problem.  Our interceptor is returning
error but that return value is not respected when the result is rendered. 
It makes me wonder what the value of returning the invocation result is in
the first place...

Just stepping through the code and browsing the invocation context shows
that the resultCode is set to error just after our interceptor is invoked. 
However, when I evaluated the resultCode handed to a PreResultListener I
found it had been set back to success.  

I'm a little unsure at this point how to use the PreResultListener to solve
the problem.

I've tried adding it in catch block for the hibernate exception as an
Anonymous Inner Class:


   invocation.addPreResultListener(new PreResultListener() {
  public void beforeResult(ActionInvocation invocation, String
resultCode) {

 
ActionContext.getContext().getActionInvocation().setResultCode(error);
  }
 });

But the beforeResult method is never called even though I can see the object
getting created.  I created a separate interceptor to initialize the
listener and that does work but I'm now stuck on finding a method to signal
that listener to set the result code to error appropriately.  It seems that
pushing something onto the value stack in my hibernate interceptor is not
useful since the value I put there is being popped off by someone else.  

Have you managed to make any progress on this?








oguzhan tortop wrote:
 
 Of course it has a global result :) it returns error too but i think
 struts 2 working mech. makes this impossible to do after
 invocation.invoke() method only the result of the action works... :) i
 think this is not a common situation
 
 Dave Newton-4 wrote:
 
 --- oguzhan tortop [EMAIL PROTECTED] wrote:
 ... but  how can i implement a PreResultListener. 
 
 I don't think it'll help anyway; sorry.
 
 (Boy, I wish I had my regular machine right now :/
 
 How is an Action.ERROR normally handled with the stack
 you have defined? Is there a global result?
 
 d.
 
 
 
 
  
 
 Need Mail bonding?
 Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users.
 http://answers.yahoo.com/dir/?link=listsid=396546091
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-exception-problem-tp9835135p16494148.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]



Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
Hi,

Struts 2 tags have value attribute where name of property is used to read the 
value from the bean. If the property is lets say xyz, tag looks for getXyz(). 
Is this possible to customize that so that instead of getXyz(), it looks for 
isXyz()? My boolean property has accessors which starts with isXyz() instead of 
getXyz().

Thx

-Akash



  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread Musachy Barroso
Struts 2(OGNL technically speaking) will call getX() or isX() if one
of them exist, when y.x is evaluated.

musachy

On Fri, Apr 4, 2008 at 1:37 PM, akash agrawal [EMAIL PROTECTED] wrote:
 Hi,

  Struts 2 tags have value attribute where name of property is used to read 
 the value from the bean. If the property is lets say xyz, tag looks for 
 getXyz(). Is this possible to customize that so that instead of getXyz(), it 
 looks for isXyz()? My boolean property has accessors which starts with 
 isXyz() instead of getXyz().

  Thx

  -Akash




   
 
  You rock. That's why Blockbuster's offering you one month of Blockbuster 
 Total Access, No Cost.
  http://tc.deals.yahoo.com/tc/blockbuster/text5.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

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
Here is my JSP snippet. isXyz() does not work for me. What am I doing 
incorrectly?

s:set name=myBean value=myBeanObject/s:set

s:checkbox name=xyz label=xyzLabel value=%{#myBean.xyz} required=true 
tooltip=xyzTooltip/

Thx.


--- On Fri, 4/4/08, Musachy Barroso [EMAIL PROTECTED] wrote:

 From: Musachy Barroso [EMAIL PROTECTED]
 Subject: Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()
 To: Struts Users Mailing List user@struts.apache.org
 Date: Friday, April 4, 2008, 10:47 AM
 Struts 2(OGNL technically speaking) will call getX() or
 isX() if one
 of them exist, when y.x is evaluated.
 
 musachy
 
 On Fri, Apr 4, 2008 at 1:37 PM, akash agrawal
 [EMAIL PROTECTED] wrote:
  Hi,
 
   Struts 2 tags have value attribute where name of
 property is used to read the value from the bean. If the
 property is lets say xyz, tag looks for getXyz(). Is this
 possible to customize that so that instead of getXyz(), it
 looks for isXyz()? My boolean property has accessors which
 starts with isXyz() instead of getXyz().
 
   Thx
 
   -Akash
 
 
 
 
   
 
   You rock. That's why Blockbuster's offering
 you one month of Blockbuster Total Access, No Cost.
   http://tc.deals.yahoo.com/tc/blockbuster/text5.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
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
myBean is not null, There are other field which are not boolean and I do get 
them fine.

Thx

--- On Fri, 4/4/08, Musachy Barroso [EMAIL PROTECTED] wrote:

 From: Musachy Barroso [EMAIL PROTECTED]
 Subject: Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()
 To: Struts Users Mailing List user@struts.apache.org
 Date: Friday, April 4, 2008, 11:09 AM
 Are you sure that myBean is not null?
 
 musachy
 
 On Fri, Apr 4, 2008 at 2:05 PM, akash agrawal
 [EMAIL PROTECTED] wrote:
  Here is my JSP snippet. isXyz() does not work for me.
 What am I doing incorrectly?
 
   s:set name=myBean
 value=myBeanObject/s:set
 
   s:checkbox name=xyz
 label=xyzLabel value=%{#myBean.xyz}
 required=true
 tooltip=xyzTooltip/
 
   Thx.
 
 
   --- On Fri, 4/4/08, Musachy Barroso
 [EMAIL PROTECTED] wrote:
 
From: Musachy Barroso [EMAIL PROTECTED]
Subject: Re: Struts2 tags behaviour
 customizable? isXyz() instead of getXyz()
To: Struts Users Mailing List
 user@struts.apache.org
Date: Friday, April 4, 2008, 10:47 AM
 
 
   Struts 2(OGNL technically speaking) will call
 getX() or
isX() if one
of them exist, when y.x is
 evaluated.
   
musachy
   
On Fri, Apr 4, 2008 at 1:37 PM, akash agrawal
[EMAIL PROTECTED] wrote:
 Hi,

  Struts 2 tags have value attribute where
 name of
property is used to read the value from the
 bean. If the
property is lets say xyz, tag looks for
 getXyz(). Is this
possible to customize that so that instead of
 getXyz(), it
looks for isXyz()? My boolean property has
 accessors which
starts with isXyz() instead of getXyz().

  Thx

  -Akash





   
 
  You rock. That's why Blockbuster's
 offering
you one month of Blockbuster Total Access, No
 Cost.
 
 http://tc.deals.yahoo.com/tc/blockbuster/text5.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
   
   
 -
To unsubscribe, e-mail:
 [EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
 
 
   
 
   You rock. That's why Blockbuster's offering
 you one month of Blockbuster Total Access, No Cost.
   http://tc.deals.yahoo.com/tc/blockbuster/text5.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
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 1:17 PM, akash agrawal [EMAIL PROTECTED] wrote:
 myBean is not null, There are other field which are not boolean and I do get 
 them fine.

Is it boolean, or Boolean?  I've seen situations where I was hoping
isX would return a reference to a Boolean (when reference with
JavaBean dot notation), but I had to implement a getX instead.  Just 2
cents.

-Dave

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread akash agrawal
David,

It is a Boolean property but I still think it should work no matter whether it 
is boolean or Boolean. APIs I am using are not mine so I can't change the bean, 
but there are workaround I can put in although they aren't pretty. I was hoping 
something can be done on the framework (Struts2) side.

Thx.
-Akash


--- On Fri, 4/4/08, David Durham, Jr. [EMAIL PROTECTED] wrote:

 From: David Durham, Jr. [EMAIL PROTECTED]
 Subject: Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()
 To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED]
 Date: Friday, April 4, 2008, 11:33 AM
 On Fri, Apr 4, 2008 at 1:17 PM, akash agrawal
 [EMAIL PROTECTED] wrote:
  myBean is not null, There are other field which are
 not boolean and I do get them fine.
 
 Is it boolean, or Boolean?  I've seen situations where
 I was hoping
 isX would return a reference to a Boolean (when reference
 with
 JavaBean dot notation), but I had to implement a getX
 instead.  Just 2
 cents.
 
 -Dave
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]


  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

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



Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread David Durham, Jr.
On Fri, Apr 4, 2008 at 1:39 PM, akash agrawal [EMAIL PROTECTED] wrote:
  It is a Boolean property but I still think it should work no matter whether 
 it is boolean or Boolean. APIs I am using are not mine so I can't change the 
 bean, but there are workaround I can put in although they aren't pretty. I 
 was hoping something can be done on the framework (Struts2) side.

Ask not what the framework can do for you, but what you can do for the
framework ...   it's Friday.  Seriously though, if you need to provide
a getMyBoolean, and you can't modify the original class, you can just
provide a wrapper to translate getMyBoolean to isMyBoolean.  If it's a
public class as I think the JavaBean spec requires it to be, you can
just extend it, otherwise you need a delegator for not just this
property but all the others.  Anyway, it's not really clear that this
is what you need anyway, so this is just more speculation.


--Dave

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



Re: [OT] What do you code today?

2008-04-04 Thread Frank W. Zammetti

Ted Husted wrote:

I'm trying to put together a list of the typical types of applications
that  enterprise developer write in real life. 


My current main project, which has been my main project for about two 
years now, is an application that seeks to unite all the back-office 
applications in our organization into one consolidated offering. Right 
now we have image viewing capability with workflow integration, new 
account creation and maintenance, account inquiry for call center 
personnel and account transfer creation/tracking/processing.  We're a 
few weeks away from rolling correspondence creation under the common 
application.  There are at least four separate projects going on that 
are new pieces that snap into this main application.


We offer a host of management reporting capabilities, real-time 
dashboarding of statistics and metrics for managers, multi-level 
security backed by a highly robust LDAP-based security infrastructure, 
and a host of web services for various clients.  But all of this is 
under a common umbrella application... each piece is a separate bit of 
functionality (as evidence by the fact that some clients want part A and 
nothing else and we're able to provide that with the flip of a switch), 
and yet all the pieces are integrated (not just at the glass either, 
we're talking the ability for one component to use the data from another 
seamlessly) but at the same time they are developed independently and 
are, with few exceptions, highly isolated in terms of packaging and 
development cycles.


This is a highly complex undertaking that is pushing the limits of RIA 
development as most people know it today.  It's using virtually every 
cool buzzword out there today in some form or other :)  I have no qualms 
about putting it up against any other web-based application out there in 
terms of complexity and in terms of how close it actually comes to 
looking, feeling and functioning like a fat-client app.  It's extremely 
flexible, powerful and pretty elegant architecturally (that's not to say 
it's perfect: when you do something this large and complex you're bound 
to learn some things through the process, and we certainly have, but it 
says a lot about how good the underling architecture is that we've been 
able to extend it and frankly correct things along the way without 
killing ourselves, our budget or our timelines).


This is a back-office application primarily, but as I mentioned, parts 
of it are used by various remote clients (the application and the web 
services, which are two separate offerings) as well as more 
front-office-type concerns (and all three groups are getting expanded 
functionality little by little... this is without question the 
fastest-growing application we have as most new development is targeted 
to be a part of it).



So, if anyone else is up for sharing, I'd be interested in hearing
what sort of things other people are doing these days. (If your not
comfortable posting the list, feel free to mail me direct.)


Over the past 10 years, here's a rundown of some of the other 
applications I've developed:


* An application for creating, tracking and reconciling transfers of 
assets between accounts (this capability has been rolled into the 
previously mentioned application).  This is also very definitely an RIA 
and for a long time was the model for more advanced web UI applications 
throughout the company.


* An application for maintaining insurance accounts.  This was a very 
interesting project because it was the first large web-based application 
that used data (and processing) on the mainframe.  It was also notable 
because we didn't have an app server at the time, just a web server with 
some now-defunct IBM technology allowing us to talk to the mainframe. 
This application was actually developed around 1999, but it's in many 
ways *the* model for an RIA: with no app server, the *entire* 
application lived on the client... the calls to the mainframe were 
essentially service calls that always returned nothing but data that the 
client then did something with.  Ironically, this is largely the model 
we're using for the first app I mentioned at the start, except now we're 
doing it with DWR and a far fancier UI.


* An application for processing of complex corporate actions (stock 
splits, things like that).  This was one of the more logic-heavy 
applications because of the nature of the processing involved, and we 
essentially custom-developed a very capable rules engine for it.  This 
was another RIA for sure, but it was a little server-heavy for my tastes 
(didn't use AJAX per se, but pulled a lot of the same sort of partial 
page refresh tricks).


* An application for processing of incoming payments.  This was an 
interesting project because it started out as a Visual Foxpro-based 
Windows app and we pretty much ported the whole thing to the web in 
terms of look and feel... I remember many comments by long-time users 
that they 

Re: Struts 2 exception problem

2008-04-04 Thread Jim Krygowski

Hi Oguzhan-

We've run into the *exact* same problem.  Our interceptor is returning 
error but that return value is not respected when the result is 
rendered.  It makes me wonder what the value of returning the invocation 
result is in the first place...


Just stepping through the code and browsing the invocation context shows 
that the resultCode is set to error just after our interceptor is 
invoked.  However, when I evaluated the resultCode handed to a 
PreResultListener I found it had been set back to success.  

I'm a little unsure at this point how to use the PreResultListener to 
solve the problem.


I've tried adding it in catch block for the hibernate exception as an 
Anonymous Inner Class:



  invocation.addPreResultListener(new PreResultListener() {
 public void beforeResult(ActionInvocation invocation, 
String resultCode) {


 
ActionContext.getContext().getActionInvocation().setResultCode(error);

 }
});

But the beforeResult method is never called even though I can see the 
object getting created.  I created a separate interceptor to initialize 
the listener and that does work but I'm now stuck on finding a method to 
signal that listener to set the result code to error appropriately.  It 
seems that pushing something onto the value stack in my hibernate 
interceptor is not useful since the value I put there is being popped 
off by someone else.  I find the same thing happens when I try adding 
values to the request attribute map from an interceptor.  At this point 
I'm using the session and managing removal of the signal in the 
PreResultListener.  It's not an approach I like but it works.




Of course it has a global result :) it returns error too but i think 
struts 2 working mech. makes this impossible to do after 
invocation.invoke() method only the result of the action works... :) i 
think this is not a common situation


   Dave Newton-4 wrote:
   --- oguzhan tortop [EMAIL PROTECTED] wrote:
 ... but  how can i implement a PreResultListener.

   I don't think it'll help anyway; sorry.

   (Boy, I wish I had my regular machine right now :/




Re: Struts2 tags behaviour customizable? isXyz() instead of getXyz()

2008-04-04 Thread Laurie Harper

David Durham, Jr. wrote:

On Fri, Apr 4, 2008 at 1:39 PM, akash agrawal [EMAIL PROTECTED] wrote:

 It is a Boolean property but I still think it should work no matter whether it 
is boolean or Boolean. APIs I am using are not mine so I can't change the bean, 
but there are workaround I can put in although they aren't pretty. I was hoping 
something can be done on the framework (Struts2) side.


Ask not what the framework can do for you, but what you can do for the
framework ...   it's Friday.  Seriously though, if you need to provide
a getMyBoolean, and you can't modify the original class, you can just
provide a wrapper to translate getMyBoolean to isMyBoolean.  If it's a
public class as I think the JavaBean spec requires it to be, you can
just extend it, otherwise you need a delegator for not just this
property but all the others.  Anyway, it's not really clear that this
is what you need anyway, so this is just more speculation.


The JavaBean specification only talks about boolean properties; it 
doesn't mention Boolean (section 8.3.2). But rather than messing with an 
'adapter' sub-class, I would consider either (a) creating a BeanInfo 
class or (b) simply living with it and just being explicit in OGNL 
expressions like so:


s:checkbox name=xyz label=xyzLabel value=%{#myBean.isXyz()} 
required=true tooltip=xyzTooltip/


i.e. use method-call rather than simple property syntax.

L.


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



Re: s:radio issue

2008-04-04 Thread Laurie Harper

Niral Trivedi wrote:

Hi Dave,

Thanks for the reply. I've actually tried with #keepRemoveRadio as well but
got same result. In fact, I got it working by putting john or doe as
below for s:param property:

s:param name=*Keep* value=%{'john}/


That makes sense, since value=john will try to evaluate 'john' as an 
expression (i.e. will look for it on the value stack) whereas 
value=%{'john'} (or simply value='john') evaluates to a literal 
string. This is described in the Tag Syntax guide linked at the top of 
all the tag documentation pages:


http://struts.apache.org/2.0.11/docs/tag-syntax.html

[Hmm; that said, I just noticed that the 2.0.11 docs for s:param claim 
that the value attribute is *not* evaluated, which is inconsistent with 
what you're seeing; it could be that the documentation is in need of 
updating for that tag.]



Moving ahead, now stuck with a different issue. Actually, I want to create
name of the param dynamically by concatenating two strings. One is already a
struts2 s:set property and other is a static value. For example, I want to
do something like this:

Line 1: s:set name=prop1 value=%{someActionProp}/

s:bean name=java.util.HashMap id=keepRemoveRadioMap
*  s:param name=%{prop1}Keep value=%{prop1}john/
 s:param name=Remove value=%{prop1}doe/
* /s:bean

But I could not get the lines in bold working. Do you have any idea how to
concatenate two strings and assing it to a third variable? I tried
s:append but that doesn't work either. Using that I can only iterate and
print the values but cant assign to third variable.


Try s:param name=%{prop1+'Keep'} value=%{prop1+'john'}/ instead 
(untested).


L.


Thanks

On Thu, Apr 3, 2008 at 8:40 AM, Dave Newton [EMAIL PROTECTED] wrote:

--- Niral Trivedi [EMAIL PROTECTED] wrote:

I am using Struts 2.0.11 on RAD7, Webspher 6.1, JDK 1.5.

Hey, me too. My sympathies.


I am trying to create radio buttons using a dynamic Map as below:

s:bean name=java.util.HashMap id=keepRemoveRadioMap
s:param name=Keep value=john/
s:param name=Remove value=doe/
/s:bean

td width=20% style=background-color:#fffade; vertical-align:center
s:radio name=keepRemove list=keepRemoveRadioMap  onclick=
changeKeep1() theme=simple/
/td

But when I try to load the page, it is giving Freemaker Template

exception

as below(I haven't pasted entire stack trace for readability) :

What happens if you use list=#keepRemoveRadioMap?

While I've never used the s:bean... tag, normally when you create an
object
in the OGNL context like that you need to refer to it with a leading #
meaning that it's a named object, not a property of an object on the value
stack.

Dave


-
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]



Re: any struts 2 unit testers out there?

2008-04-04 Thread Laurie Harper
As Ian says, the mock objects supplied by XWork may make this all a lot 
easier, but in any case all this is predicated on the fact that you're 
using ActionSupport's implementation of TextProvider which doesn't make 
provision for mocking at test time. I think it would make a great deal 
of sense to improve that (open an enhancement request in Jira), but in 
the mean time, there's nothing preventing you from providing a getText() 
implementation that's more conducive to testing.


I feel your pain on this one, and the right solution is to fix the 
framework (patches always welcome ;-), but it shouldn't be that hard to 
get around.


L.

paulbrickell wrote:

Actually thats an interesting post. To my mind it doesn't demonstrate a
solution. It demonstrates the problem.

Here is why I think this.

Struts 2 is just frankly brilliant for people doing test first development.
The classes you create really are POJOs. There are no dependencies on any
framework in my action classes. For example parameters are parsed well away
from my action and the values are set using simple properties, things like
sessions are simply maps. It is a truly new world for those of who have
suffered the horror of mocking http requests, responses, context and the
like.

But this simple scenario brings all that pain flooding back. I add a line in
my action like this...

String yadaYada = getText(some.doodad);

And my lovely world comes unraveled real quick. Now I need mock objects up
the ying-yang.

I started using the tutorial from the link posted (I am an Arsenal fan btw,
so got two for the price of one, thanks), but it still doesn't provide a
simple solution to the problem. To get this to work I have to build not just
the application context but a mass of supporting objects to get a web
application framework up and running before I can test my simple POJO.

I am not going to give up just yet, but I think I am still going to have to
look for another way.

Cheers,
Paul B.





Relph,Brian wrote:


I recommend creating an action context.  Here is the basic guide I
followed to do so:

http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/ 


If you are not using spring or the struts2 spring plugin, you can cut out
all the code around the applicationContext.


-Original Message-
From: paulbrickell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 03, 2008 11:44 AM

To: user@struts.apache.org
Subject: Re: any struts 2 unit testers out there?


I am trying to deal with the same issue. Did you get any resolution?

Following on from the reply asking for a stack trace, here is what I am
getting...


java.lang.NullPointerException
at
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:299)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:172)
at
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:87)
at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:80)
SNIP
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
at
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


It is 

Re: Freemarker (old version that struts2 uses) disappearing pages

2008-04-04 Thread Laurie Harper

Jonny Cavell wrote:

I use Maven, and if you look at struts 2.0.11.1's dependencies
(http://www.mvnrepository.com/artifact/org.apache.struts/struts2-core/2.0.11.1)
you'll see that it's Freemarker version 2.3.8 it depends on. I can't


2.0.11.1 != 2.1.1 :-)


override this in Maven, even if I attempt to exclude it and force the latest
version of Freemarker:

.
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-core/artifactId
version2.0.11/version
exclusions
exclusion
groupIdorg.freemarker/groupId
artifactIdfreemarker/artifactId
/exclusion
/exclusions
/dependency
dependency
groupIdorg.freemarker/groupId
artifactIdfreemarker/artifactId
version2.3.12/version
/dependency


That ought to work, assuming those two stanzas are in their respective 
correct places within the pom. Check 'mvn X' output to make sure your 
excludes are correct with respect to the dependency graph.


L.



Cheers

Jonny


Jeromy Evans - Blue Sky Minds wrote:

Jonny Cavell wrote:

I have a problem that seems to occur periodically.

My freemarker templates, served by struts2, stop appearing - I get a
blank
page. There are no useful messages in the logs, other than saying that it
couldn't find the template (which it could find previously).

First question - does anybody know what this problem might be?

  

No, other than a classpath/deployment problem.

I would like to upgrade to the latest version of Freemarker. However,
Struts2 in its wisdom has locked me down to version 2.3.8, and this was
released way back in 2006. Are there any plans to resolve this issue? 

  
The 2.1.1 version of Struts uses FreeMarker 2.3.11   You may be able to 
replace the 2.3.8 jar with the 2.3.11 jar without problems.


I doubt the problem is with FreeMarker.  It's more likely to be the 
FreeMarkerManager included with Struts 2 that's responsible for 
searching for templates in the classpath.




-
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]



Re: [S2] Struts with Web Services

2008-04-04 Thread Wes Wannemacher
Production integration experience? No...

I evaluated it and did a quick proof-of-concept on a project once. We
ended up sticking with the in-house option, which wasn't bad, but it was
an apache mod, so we periodically looked for alternatives because we
were always tied to mod_jk or mod_proxy because the
authentication/authorization service was tied to httpd. 

The nice thing about CAS was that it can be integrated in more than just
Java web-apps. You can also integrate with acegi rather easily. It's
worth checking out if you have a suite of web-apps that you would like
to create a single-sign-on that is somewhat reusable.

-Wes

On Fri, 2008-04-04 at 08:56 +0200, Lukasz Lenart wrote:
   http://www.ja-sig.org/products/cas/
 
   -Wes
 
 Do you have some experience with that? It looks quite interesting ;-)
 
 
 Regards


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



Re: Freemarker (old version that struts2 uses) disappearing pages

2008-04-04 Thread Dustin S.
The Maven dependency plugin may be useful to you as well.
http://maven.apache.org/plugins/maven-dependency-plugin/index.html ,
specifically the dependency:tree goal.

On Fri, Apr 4, 2008 at 3:27 PM, Laurie Harper [EMAIL PROTECTED] wrote:

 Jonny Cavell wrote:

  I use Maven, and if you look at struts 2.0.11.1's dependencies
  (
  http://www.mvnrepository.com/artifact/org.apache.struts/struts2-core/2.0.11.1
  )
  you'll see that it's Freemarker version 2.3.8 it depends on. I can't
 

 2.0.11.1 != 2.1.1 :-)

  override this in Maven, even if I attempt to exclude it and force the
  latest
  version of Freemarker:
 
  .
 dependency
 groupIdorg.apache.struts/groupId
 artifactIdstruts2-core/artifactId
 version2.0.11/version
 exclusions
 exclusion
 groupIdorg.freemarker/groupId
 
   artifactIdfreemarker/artifactId
 /exclusion
 /exclusions
 /dependency
 dependency
 groupIdorg.freemarker/groupId
 artifactIdfreemarker/artifactId
 version2.3.12/version
 /dependency
 

 That ought to work, assuming those two stanzas are in their respective
 correct places within the pom. Check 'mvn X' output to make sure your
 excludes are correct with respect to the dependency graph.


 L.


  Cheers
 
  Jonny
 
 
  Jeromy Evans - Blue Sky Minds wrote:
 
   Jonny Cavell wrote:
  
I have a problem that seems to occur periodically.
   
My freemarker templates, served by struts2, stop appearing - I get a
blank
page. There are no useful messages in the logs, other than saying
that it
couldn't find the template (which it could find previously).
   
First question - does anybody know what this problem might be?
   
   
   
   No, other than a classpath/deployment problem.
  
I would like to upgrade to the latest version of Freemarker.
However,
Struts2 in its wisdom has locked me down to version 2.3.8, and this
was
released way back in 2006. Are there any plans to resolve this
issue?
   
   
   The 2.1.1 version of Struts uses FreeMarker 2.3.11   You may be able
   to replace the 2.3.8 jar with the 2.3.11 jar without problems.
  
   I doubt the problem is with FreeMarker.  It's more likely to be the
   FreeMarkerManager included with Struts 2 that's responsible for searching
   for templates in the classpath.
  
  
  
   -
   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]