Runtime Exception

2010-09-13 Thread stefer16

Hello,
I wrote an example web app using servlets and tryed to convert it into a
struts 
project.After the conversion to struts I understood I had  wrong paths for
struts and 
junit libraries and later  I solved writing the right classpaths for struts
and junit 
libraries, so now I try to run the the application but when I need to run
the struts 
action I get a runtime exception with e.getMessage()=null and on the
debugger console I 
get:

Non-existing path
C:\altro_progetto\DVDLibrary\build\ear-module\WEB-INF\classes 

provided.
Attached JPDA debugger to localhost:tomcat_shared_memory_id
Duplicated project name in import. Project DVDLibrary-impl defined first in 

C:\altro_progetto\DVDLibrary\nbproject\ant-deploy.xml and again in 

C:\altro_progetto\DVDLibrary\nbproject\build-impl.xml

DVDLibrary is the webapp and the action doesn't work, I cannot add an item
to the 

DVDlist.
I suppose  the change in the path caused some configuration inconsistency in
this  
project and in other projects already developed using struts, but I need to
solve this 
problem (before it the app was running).Do you think I am wrong?
Could you please suggest me what to do? Of course I am a struts new user!!!
Thank you in advance!
-- 
View this message in context: 
http://old.nabble.com/Runtime-Exception-tp29697643p29697643.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



getConfiguration() Outside Of An Action

2010-09-13 Thread Paul Zepernick
I am trying to get the Struts configuration outside of an action.  I am looking 
to populate a table in our DB of all the current Struts actions which we are 
going to end up using for our system security.  I have been able to access the 
configuration inside of an action by doing:

final MapString, MapString,ActionConfig namespaceMap = 
Dispatcher.getInstance().getConfigurationManager().getConfiguration().getRuntimeConfiguration().getActionConfigs();

This returns a NPE when I attempt to call this outside of an action.  I have 
also tried to create my own configuration by doing:

final ConfigurationManager cm = new ConfigurationManager();
final ConfigurationProvider configprovider = new 
StrutsXmlConfigurationProvider(false);
cm.addConfigurationProvider(configprovider); 
final MapString, MapString,ActionConfig namespaceMap 
=cm.getConfiguration().getRuntimeConfiguration().getActionConfigs();


The following error is raised when I try to create my own configuration object

com.opensymphony.xwork2.inject.DependencyException: 
com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No 
mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, 
name='default'] in public static void 
com.opensymphony.xwork2.ObjectFactory.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
at 
com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:157)
at 
com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:126)
at 
com.opensymphony.xwork2.inject.ContainerImpl.injectStatics(ContainerImpl.java:111)
at 
com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:494)
at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:145)
at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at 
com.jweb.security.GetStrutsActions.getActions(GetStrutsActions.java:43)
at com.mr.tasks.AddActionsToDb.run(AddActionsToDb.java:31)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: 
com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No 
mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, 
name='default'] in public static void 
com.opensymphony.xwork2.ObjectFactory.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
at 
com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:239)
at 
com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:229)
at 
com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.init(ContainerImpl.java:282)
at 
com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:130)
at 
com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:128)
at 
com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:154)
... 9 more

Is it possible to get the configuration information outside of an action?

Thanks,

Paul Zepernick



The information contained in this transmission contains confidential  
information that is legally privileged. This information is intended only for 
the use of the individual or entity named above. The authorized recipient of 
this information is prohibited from disclosing this information to any other 
party unless required to do so by law or regulation and is required to destroy 
the information after its stated need has been fulfilled.
If you are not the intended recipient, you are hereby notified that any 
disclosure, copying, distribution, or action taken in reliance on the contents 
of these documents is strictly prohibited. If you have received this 
information in error, please notify the sender immediately by return email and 
arrange for the return or destruction of these documents.


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

Struts 2 AJAX error

2010-09-13 Thread Arpan
Hi All,

I am getting the following error while using ajax theme in struts tag:

org.apache.jasper.JasperException: /index.jsp(4,2) Attribute debug
invalid for tag head according to TLD

I am using following line in  my JSP.

s:head theme=ajax debug=true/

I am using strut2.2.1.jar file.

Please let me know if anybody have any idea about this.

- Thanks


Submit with several methods in Struts 2.2

2010-09-13 Thread hernan gonzalez
This pattern (submit tag with method specified)
http://struts.apache.org/2.2.1/docs/html-form-buttons-howto.html
worked for me in my previous version (from Struts 2.1.6).
Now (in Struts 2.2.1), I can't make it work. It always calls execute.
The only workaround I found was to set DynamicMethodInvocation=true (which
is discouraged in the docs, and was not necesary before).
Is this some documented change? Did I miss something?

Regards

Hernán

= sample code / configuration 

public class TestMethodAction extends ActionSupport {
private String param1 =;

public String myMethod() throws Exception {
addActionMessage(Testing myMethod);
return SUCCESS;
}
// setters / getters 
}


and my Jsp:

s:form
 s:textfield name=param1 label=Write something /
 s:submit value=Test method=myMethod /
 /s:form
 s:property value=param1/  !-- for testing if the Param has been read
(this works ok)--


Debug console info:


DEBUG [http-8080-1] org.apache.struts2.interceptor.FileUploadInterceptor
debug- Bypassing /test/TestMethod
DEBUG [http-8080-1]
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor
debug- Validating /test/TestMethod with method execute.

DEBUG [http-8080-1] org.apache.struts2.dispatcher.ServletDispatcherResult
debug- Forwarding to location /jsp/test/TestMethod.jsp
DEBUG [http-8080-1] org.apache.struts2.components.UIBean debug- Rendering
template /template/xhtml/actionmessage

struts.xml:

...
constant name=struts.enable.DynamicMethodInvocation value=false /
constant name=struts.devMode value=true /
   ...
  action name=TestMethod class=myproject.struts2.TestMethodAction
result/jsp/test/TestMethod.jsp/result
 /action

==


Control UI via GET parameters

2010-09-13 Thread Ken
As a requirement I must be able to change the UI on a per request
basis... a specific case would be including or omitting a left
navigation bar. The parameters will always be passed with GET.  

Currently I am using Tiles and JSP's for composition.  

What I think would work is if I create a UI class and have an
interceptor match all parameters of the pattern UI.* and  use this
class as a partial model, which will be added to the request scope along
with the action's model.  Then when the JSP's render they will consult
the members of UI class as they would the members of the Action... and
do what they're supposed to do, render the side bar, don't render the
side bar...

For questions of you:
Is this a reasonable way to approach this?  Is there already a way to do
this with struts 2 or am I best writing my own interceptor?



Re: Latest version release notes and install documentation

2010-09-13 Thread Dave Evans
Thank you.

On Sun, Sep 12, 2010 at 4:38 AM, phillips1021 bphill...@ku.edu wrote:

 Go here:

 http://struts.apache.org/2.2.1/docs/create-struts-2-web-application-with-artifacts-in-web-inf-lib-and-use-ant-to-build-the-application.html

 to see a list of Jar files needed on the class path to run a Struts 2.2.1
 application.

 Bruce



 Dave Evans-12 wrote:

 On Thu, Sep 9, 2010 at 12:58 PM, Dave Newton davelnew...@gmail.com
 wrote:

 Thanks for the reply. Do you (or anyone else) know what set of jars is
 the minimum requirement to use Struts? I'm only using the framework,
 no plugins, no tags.

 I doubt maven is really necessary for my purposes. I already have my
 own skeletal application starter, I just need to copy the minimal
 collection of jars into the lib directory. If maven can do that, I
 guess that would be helpful. Probably the fact that I don't know maven
 figures into my reluctance.

 Dave

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




 --
 View this message in context: 
 http://old.nabble.com/Latest-version-release-notes-and-install-documentation-tp29670716p29689992.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



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



RE: Array Input Fields - SOLVED

2010-09-13 Thread adam pinder

 

i didn't realise the use of () for lists and [] for maps - i thought you always 
use []

 

i used input field names likeusers(0).name  and now name gets set on the 
relevant object in the list - no need for any extra methods just the getUsers() 
setUsers() methods.

 

thanks all

 

adam


 
 Date: Sun, 12 Sep 2010 18:04:38 -0400
 Subject: Re: Array Input Fields
 From: davelnew...@gmail.com
 To: user@struts.apache.org
 
 Look at the type conversion docs: there's a difference between using
 [] and () in the JSP names.
 
 On Sunday, September 12, 2010, adam pinder apin...@hotmail.co.uk wrote:
 
 
 
  OP :-
 
 
 
  I thought when the input field name contained [] that struts effectively 
  replaced them with () - so in my input field
 
 
 
  user[0].name
 
 
 
  for example, would become getUser(0).setName(...) etc..
 
 
 
  I checked the list object contains elements and it does (i retrieve them 
  before the update page is displayed and stored in the session - the get/set 
  of the list object accesses the session to retrieve the object), i also 
  included a system out in the getUser(int occ) method and it never gets 
  called so its not because the getUser(0) returns null or the list is null.
 
 
 
  i've had this before and i took the params off the request myself in the 
  action and updated the list - just thought i'd try and get to the bottom of 
  it this time.
 
 
 
  i think it must be down to the input names i'm using or the methods i need 
  to have available to the params interceptor to call.
 
 
 
  adam
 
 
 
  Date: Sat, 11 Sep 2010 19:52:48 -0400
  Subject: Re: Array Input Fields
  From: davelnew...@gmail.com
  To: user@struts.apache.org
 
  Depends. The OP wasn't using index notation (parens instead of
  brackets) so there'd need to be a getUsers.
 
  On Saturday, September 11, 2010, Chris Mawata
  chris_mawata_str...@mathcove.net wrote:
On 9/10/2010 1:08 PM, adam pinder wrote:
  
   public User getUser(int occ)
  
  
   Should the getter not return the collection rather than a single User?
   Chris
  
   -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  

Re: Control UI via GET parameters

2010-09-13 Thread Ken
Never mind, chain does exactly what I need.  I'm just going to require
they use 
a special action and supply the target action as a parameter and throw
the UI parameters and target action parameters on the url they'll
construct.

My issue was although realizing that chain would pass on the state of
the current 
action I thought for some reason that it would wipe out the rest of the
parameters
before passing it on to the next action... which isn't the case, and
gladly so as it does 
make much more sense this way.  Another case of... it was way easier
than I thought.

On Mon, 2010-09-13 at 12:40 -0600, Ken wrote:

 As a requirement I must be able to change the UI on a per request
 basis... a specific case would be including or omitting a left
 navigation bar. The parameters will always be passed with GET.  
 
 Currently I am using Tiles and JSP's for composition.  
 
 What I think would work is if I create a UI class and have an
 interceptor match all parameters of the pattern UI.* and  use this
 class as a partial model, which will be added to the request scope along
 with the action's model.  Then when the JSP's render they will consult
 the members of UI class as they would the members of the Action... and
 do what they're supposed to do, render the side bar, don't render the
 side bar...
 
 For questions of you:
 Is this a reasonable way to approach this?  Is there already a way to do
 this with struts 2 or am I best writing my own interceptor?





Re: Struts 2 AJAX error

2010-09-13 Thread Dave Newton
I do; s:head in S2.1+ is different than in S2.0; please read the
documentation regarding the Dojo Ajax plugin. (Which is deprecated, by
the way.)

Dave

On Mon, Sep 13, 2010 at 11:42 AM, Arpan arpan.deb...@gmail.com wrote:
 Hi All,

 I am getting the following error while using ajax theme in struts tag:

 org.apache.jasper.JasperException: /index.jsp(4,2) Attribute debug
 invalid for tag head according to TLD

 I am using following line in  my JSP.

 s:head theme=ajax debug=true/

 I am using strut2.2.1.jar file.

 Please let me know if anybody have any idea about this.

 - Thanks


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



RE: Struts2 and Maven Archetypes

2010-09-13 Thread Roland T. Craddolph
Sorry I've been having Outlook issues for far too long that finally got fixed.  
It works and this is a lot easier than that huge command.  My only question is 
for the packaging question what would you recommend to put there?  I'm still 
trying my best to follow industry standards if that makes sense.

Thanks,
Roland

Roland  T. Craddolph
Amagatto Solutions LLC
Principal Member and Lead Architect
Email: rcraddo...@amagatto.com
Website: http://www.amagatto.com

-Original Message-
From: Lukasz Lenart [mailto:lukasz.len...@googlemail.com] 
Sent: Tuesday, August 17, 2010 1:06 AM
To: Struts Users Mailing List
Subject: Re: Struts2 and Maven Archetypes

Hi,

I added archetype catalog, could you test it?

mvn archetype:generate -DarchetypeCatalog=http://struts.apache.org/


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia 2010 http://javarsovia.pl

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


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.851 / Virus Database: 271.1.1/3076 - Release Date: 08/16/10 
13:35:00


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