Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 2 Feb 2008 14:53:08 -0000 Issue 7839

user-digest-help

2008-02-02


Author LoginPost Reply

user Digest 2 Feb 2008 14:53:08 -0000 Issue 7839

Topics (messages 182128 through 182136):

Re: AjaxTag 1.3 support?
 182128 by: Dave Newton
 182129 by: Hodgins, Grant
 182130 by: Jeromy Evans
 182131 by: Dave Newton

Re: How to create a new Struts2 project with maven2?
 182132 by: Thai Dang Vu
 182134 by: Nuwan Chandrasoma

Re: actions defined in a package are visible in other packages??
 182133 by: paulbrickell
 182135 by: Wes Wannemacher
 182136 by: mgainty.hotmail.com

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_182128.ezm (zipped)
--- "Griffith, Michael *" <Michael.Griffith@(protected):
> I guess I should have said freemarker instead of sitemesh...?

Most (all?) of the HTML-oriented tags are dependent on FreeMarker, not just
the Ajax tags. That's how themes and templates are implemented.

> At any rate, when the docs don't match the release, it's a bad thing.

If you have a solution for versioning the live wiki, we'd love to hear it.

Version-specific information is available by referring to a specific release
number as I've done below. In addition the exported wiki available in the
distribution matches the S2 version of that distro.

> I shouldn't need to do any of this should I?

I have no idea; depends on what you need to do.

> Can you point me at a simple, minimalist example of the <s:autocompleter>
tag?

http://struts.apache.org/2.0.11/docs/ajax-tags.html#AjaxTags-autocompleterTag

Dave


Attachment: user_182129.ezm (zipped)
I was able to get the AjaxTags stuff working (with Tiles2 although I don't think that matters at all).

As Dave said, your action should return null since you want the action to return XML in the response.

Instead, in addition to returning a null result, I simply wrote the xml to the response:

AjaxXmlBuilder xml = new AjaxXmlBuilder();

... build your xml response ...

response.setContentType("text/xml; charset=iso-8859-1");
response.setHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate");
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
response.setHeader("Pragma", "no-cache");

PrintWriter pw = response.getWriter();
pw.write(xml.toString());
pw.close();

Hope this helps.

Grant

________________________________

From: Griffith, Michael * [mailto:Michael.Griffith@(protected)]
Sent: Fri 2/1/2008 3:48 PM
To: Struts Users Mailing List
Subject: RE: AjaxTag 1.3 support?



Dave,

Thanks for the reply. I guess I should have said freemarker instead of
sitemesh...? At any rate, when the docs don't match the release, it's a
bad thing.

I shouldn't need to do any of this should I? Can you point me at a
simple, minimalist example of the <s:autocompleter> tag?

mg

-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Friday, February 01, 2008 5:42 PM
To: Struts Users Mailing List
Subject: Re: AjaxTag 1.3 support?

--- "Griffith, Michael *" <Michael.Griffith@(protected):
> public class QuestionAction extends BaseAction implements
> ModelDriven<Question>, Preparable, ServletRequestAware,
> ServletResponseAware {
>     public String getSearchTerm() throws Exception {
>          System.out.println("**** Question Search Term:" + qt);
>          List<Question> results=
questionService.getQuestions(qt);
>          AjaxXmlBuilder builder= new AjaxXmlBuilder();
>          builder.addItems(results, "questionType", "text");
>        
>           response.setContentType("text/xml");
>           response.setHeader("Cache-Control", "no-cache");
>           ServletOutputStream out = response.getOutputStream();
>           out.print(builder.toString());
>           out.close();
>        
>          return SUCCESS;
>     }
>
> My struts mapping:
>
>     <package name="question" extends="base-pkg"
> namespace="/question">
>          <action name="get-term" method="getSearchTerm"
> class="...QuestionAction">
>               <result name="success"
> type="tiles">question.panel</result>
>          </action>
>     </package>

If you're writing directly to the stream I doubt you'd even want to
return
anything other than a null from the action, no? What is the
"question.panel"
tile?

> The struts 2 Ajax documentation seems manic and dated. It seems the S2
> Ajax implementation is tied closely to sitemesh, which I am not using.

SiteMesh? The Ajax implementation isn't tied to SiteMesh at all.

Dated? Much of the S2 Ajax documentation is for S2.1, which isn't even
released yet. If anything, it's pre-dated.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)





----Notice Regarding Confidentiality----
This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged. Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email. If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited. Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you.

Attachment: user_182130.ezm (zipped)
My 2c:
I think this is a bad solution and shouldn't be encouraged. It's
marginally better than writing a custom servlet.

Struts2 ResultTypes [1] are designed specifically for controlling the
type and content of results from actions to separate the view from the
model, even if the "view" is XML data. Accessing the response and
writing to it directly isn't necessary except in the rarest of cases.

For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
[2] will serialize your action into JSON automatically
The XSL ResultType will serialize your action into XML if you provide a
stylesheet [3]
The REST plugin includes code to serialize your action into XML using
Xstream. [4]

My point is, your action can setup a model (eg. a javabean matching the
model expected by AjaxTag), and the ResultType can serialize it to the
output stream. In this case I'd create a custom result type using
XStream, but you could also use a XML template in a Tile, or have a
ResultType that accesses the instance created by AjaxXMLBuilder.

[1] http://struts.apache.org/2.0.11/docs/result-types.html
[2] http://cwiki.apache.org/S2PLUGINS/json-plugin.html
[3] http://struts.apache.org/2.0.11/docs/xsl-result.html
[4] http://xstream.codehaus.org/
[5] http://struts.apache.org/2.0.11/docs/result-configuration.html

regards
Jeromy Evans

Hodgins, Grant wrote:
> I was able to get the AjaxTags stuff working (with Tiles2 although I don't think that matters at all).
>
> As Dave said, your action should return null since you want the action to return XML in the response.
>
> Instead, in addition to returning a null result, I simply wrote the xml to the response:
>
> AjaxXmlBuilder xml = new AjaxXmlBuilder();
>
> ... build your xml response ...
>
> response.setContentType("text/xml; charset=iso-8859-1");
> response.setHeader("Cache-Control", "no-store, max-age=0, no-cache, must-revalidate");
> response.addHeader("Cache-Control", "post-check=0, pre-check=0");
> response.setHeader("Pragma", "no-cache");
>
> PrintWriter pw = response.getWriter();
> pw.write(xml.toString());
> pw.close();
>
> Hope this helps.
>
> Grant
>
> ________________________________
>
> From: Griffith, Michael * [mailto:Michael.Griffith@(protected)]
> Sent: Fri 2/1/2008 3:48 PM
> To: Struts Users Mailing List
> Subject: RE: AjaxTag 1.3 support?
>
>
>
> Dave,
>
> Thanks for the reply. I guess I should have said freemarker instead of
> sitemesh...? At any rate, when the docs don't match the release, it's a
> bad thing.
>
> I shouldn't need to do any of this should I? Can you point me at a
> simple, minimalist example of the <s:autocompleter> tag?
>
> mg
>
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@(protected)]
> Sent: Friday, February 01, 2008 5:42 PM
> To: Struts Users Mailing List
> Subject: Re: AjaxTag 1.3 support?
>
> --- "Griffith, Michael *" <Michael.Griffith@(protected):
>  
>> public class QuestionAction extends BaseAction implements
>> ModelDriven<Question>, Preparable, ServletRequestAware,
>> ServletResponseAware {
>>     public String getSearchTerm() throws Exception {
>>          System.out.println("**** Question Search Term:" + qt);
>>          List<Question> results=
>>  
> questionService.getQuestions(qt);
>  
>>          AjaxXmlBuilder builder= new AjaxXmlBuilder();
>>          builder.addItems(results, "questionType", "text");
>>        
>>           response.setContentType("text/xml");
>>           response.setHeader("Cache-Control", "no-cache");
>>           ServletOutputStream out = response.getOutputStream();
>>           out.print(builder.toString());
>>           out.close();
>>        
>>          return SUCCESS;
>>     }
>>
>> My struts mapping:
>>
>>     <package name="question" extends="base-pkg"
>> namespace="/question">
>>          <action name="get-term" method="getSearchTerm"
>> class="...QuestionAction">
>>               <result name="success"
>> type="tiles">question.panel</result>
>>          </action>
>>     </package>
>>  
>
> If you're writing directly to the stream I doubt you'd even want to
> return
> anything other than a null from the action, no? What is the
> "question.panel"
> tile?
>
>  
>> The struts 2 Ajax documentation seems manic and dated. It seems the S2
>> Ajax implementation is tied closely to sitemesh, which I am not using.
>>  
>
> SiteMesh? The Ajax implementation isn't tied to SiteMesh at all.
>
> Dated? Much of the S2 Ajax documentation is for S2.1, which isn't even
> released yet. If anything, it's pre-dated.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
>
> ----Notice Regarding Confidentiality----
> This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged. Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email. If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited. Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you.
>
>  
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.18/1255 - Release Date: 1/02/2008 9:59 AM
>  


Attachment: user_182131.ezm (zipped)
--- Jeromy Evans <jeromy.evans@(protected):
> For Ajax/JS libraries that use JSON, the JSON Plugin (JSON ResultType)
> [2] will serialize your action into JSON automatically
> The XSL ResultType will serialize your action into XML if you provide a
> stylesheet [3]
> The REST plugin includes code to serialize your action into XML using
> Xstream. [4]

I'll add that the FreeMarker result [1] is pretty flexible when one needs
oddball formats along with a content type (settable in the result
configuration, as opposed to, say, setting it with a JSP scriptlet).

Dave

[1] http://struts.apache.org/2.x/docs/freemarker-result.html



Attachment: user_182132.ezm (zipped)
I tried what you suggested, but still got error:

mvn -e archetype:create -DgroupId=home.struts2 -DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11 -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]   task-segment: [archetype:create] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: home.struts2
[INFO] We are using command line specified remote repositories: http://people.apache.org/builds/struts/m2-staging-repository
Downloading: http://people.apache.org/builds/struts/m2-staging-repository/org/apache/struts/struts2-archetype-starter/2.0.11/struts2-archetype-starter-2.0.11.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error creating from archetype

Embedded error: Archetype does not exist.
Unable to download the artifact from any repository
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error creating from archetype
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:564)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:493)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:463)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:311)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:224)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:143)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:333)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:126)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:282)
    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:597)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating from archetype
    at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:229)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:447)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:539)
    ... 16 more
Caused by: org.apache.maven.archetype.ArchetypeNotFoundException: Archetype does not exist.
    at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:130)
    at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:224)
    ... 18 more
Caused by: org.apache.maven.shared.downloader.DownloadNotFoundException: Requested download does not exist.
    at org.apache.maven.shared.downloader.DefaultDownloader.download(DefaultDownloader.java:62)
    at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:121)
    ... 19 more
Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository

Try downloading the file manually from the project website.

Then, install it using the command:
  mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
  mvn deploy:deploy-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

Hi,

mvn archetype:create -DgroupId=com.s2.anu -DartifactId=s2proj
-DarchetypeGroupId=org.apache.struts-DarchetypeArtifactId=struts2-archetype-starter
-DarchetypeVersion=
2.0.11 -DremoteRepositories=
http://people.apache.org/builds/struts/m2-staging-repository

why dont you try this. i think this might work.

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)



   ____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Attachment: user_182134.ezm (zipped)
Hi,

The command i have given to you work for me, i dont know what is wrong
here.. any maven guru can help you on this.

Thanks,

Nuwan
(http://code.google.com/p/struts2-ssl-plugin/)

Thai Dang Vu wrote:
> I tried what you suggested, but still got error:
>
> mvn -e archetype:create -DgroupId=home.struts2 -DartifactId=struts2-example -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.11 -DremoteRepositories=http://people.apache.org/builds/struts/m2-staging-repository
> + Error stacktraces are turned on.
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'archetype'.
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Maven Default Project
> [INFO]   task-segment: [archetype:create] (aggregator-style)
> [INFO] ------------------------------------------------------------------------
> [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
> [INFO] Setting property: velocimacro.messages.on => 'false'.
> [INFO] Setting property: resource.loader => 'classpath'.
> [INFO] Setting property: resource.manager.logwhenfound => 'false'.
> [INFO] **************************************************************
> [INFO] Starting Jakarta Velocity v1.4
> [INFO] RuntimeInstance initializing.
> [INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
> [INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
> [INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
> [INFO] ClasspathResourceLoader : initialization starting.
> [INFO] ClasspathResourceLoader : initialization complete.
> [INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
> [INFO] Default ResourceManager initialization complete.
> [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
> [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
> [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
> [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
> [INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
> [INFO] Created: 20 parsers.
> [INFO] Velocimacro : initialization starting.
> [INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
> [ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
> [INFO] Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm'
> [INFO] Velocimacro : VM library template macro registration complete.
> [INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
> [INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
> [INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.
> [INFO] Velocimacro : initialization complete.
> [INFO] Velocity successfully started.
> [INFO] [archetype:create]
> [INFO] Defaulting package to group ID: home.struts2
> [INFO] We are using command line specified remote repositories: http://people.apache.org/builds/struts/m2-staging-repository
> Downloading: http://people.apache.org/builds/struts/m2-staging-repository/org/apache/struts/struts2-archetype-starter/2.0.11/struts2-archetype-starter-2.0.11.jar
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO] ------------------------------------------------------------------------
> [INFO] Error creating from archetype
>
> Embedded error: Archetype does not exist.
> Unable to download the artifact from any repository
> [INFO] ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error creating from archetype
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:564)
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal (DefaultLifecycleExecutor.java:493)
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal (DefaultLifecycleExecutor.java:463)
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures (DefaultLifecycleExecutor.java:311)
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments (DefaultLifecycleExecutor.java:224)
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute (DefaultLifecycleExecutor.java:143)
>      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:333)
>      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:126)
>      at org.apache.maven.cli.MavenCli.main (MavenCli.java:282)
>      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:597)
>      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error creating from archetype
>      at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:229)
>      at org.apache.maven.plugin.DefaultPluginManager.executeMojo (DefaultPluginManager.java:447)
>      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals (DefaultLifecycleExecutor.java:539)
>      ... 16 more
> Caused by: org.apache.maven.archetype.ArchetypeNotFoundException: Archetype does not exist.
>      at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:130)
>      at org.apache.maven.plugin.archetype.MavenArchetypeMojo.execute(MavenArchetypeMojo.java:224)
>      ... 18 more
> Caused by: org.apache.maven.shared.downloader.DownloadNotFoundException: Requested download does not exist.
>      at org.apache.maven.shared.downloader.DefaultDownloader.download(DefaultDownloader.java:62)
>      at org.apache.maven.archetype.DefaultArchetype.createArchetype(DefaultArchetype.java:121)
>      ... 19 more
> Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command:
>   mvn install:install-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file
>
> Alternatively, if you host your own repository you can deploy the file there:
>   mvn deploy:deploy-file -DgroupId=org.apache.struts -DartifactId=struts2-archetype-starter -Dversion=2.0.11 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>
> Hi,
>
> mvn archetype:create -DgroupId=com.s2.anu -DartifactId=s2proj
> -DarchetypeGroupId=org.apache.struts-DarchetypeArtifactId=struts2-archetype-starter
> -DarchetypeVersion=
> 2.0.11 -DremoteRepositories=
> http://people.apache.org/builds/struts/m2-staging-repository
>
> why dont you try this. i think this might work.
>
> Thanks,
>
> Nuwan
> (http://code.google.com/p/struts2-ssl-plugin/)
>
>
>
>     ____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>  


Attachment: user_182133.ezm (zipped)

Dave,

OK did as you suggested, cranked up the logging level and I do now get some
logging. I created a little sandbox app to test out some things with and
simplifying has really helped. Heres what I have now

<div>
<s:action name="test" namespace="secondary" executeResult="true"/>
</div>
<div>
<s:action name="secondary/test.action" executeResult="true"/>
</div>
<div>
<s:url id="testUrlId" namespace="secondary" action="test"/>
<s:a href="%{testUrlId}">execute test action</s:a>
</div>


Now the first div works exactly as expected.

The second one also works how would expect it to. It Always generates a
stack trace with the error message "There is no Action mapped for action
name secondary/test.ation" regardless of how I try to specify the 'path' to
the action. Now I know that the namespace does not represent a path and that
I need to use the namespace attribute. I think thats fine and that doesn't
give me any kind of problem. I can always specify the namespace attribute
and all is well.

But the third div is my problem. There seems to be no way a can form a URL
for s:a tag that lets me build a link to the namespaced action. The link
directs the browser to...

http://localhost:8080/sandbox/secondary/test.action

That seems ok to me. but when I click this link I get this...

[example] DEBUG [http-8080-1] DefaultActionProxy.<init>(65) | Creating an
DefaultActionProxy for namespace and action name test
[example] ERROR [http-8080-1] Dispatcher.serviceAction(512) | Could not find
action or result
There is no Action mapped for action name test. - [unknown location]
 at
com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:186)
 at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:41)
 at
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:494)
 at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at
org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
 at
org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
 at
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
 at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
 at
org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
 at
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:263)
 at
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Unknown Source)


(Hope its OK to dump stacktraces here, apologies if its bad form).

it seems from the debug line "[example] DEBUG [http-8080-1]
DefaultActionProxy.<init>(65) | Creating an DefaultActionProxy for namespace
and action name test" That there is no namespace defined. I will try to step
throught the DefaultActionProxy next to find out why that might be.

If thats correct (the link represents a path after all), am I going to have
to have all my links in the root namespace? I can do this of course, but it
seems a ilttle restrictive.

Just have to say thanks for all the feedback. I am always impressed with the
help given on these lists.

Paul B.



newton.dave wrote:
>
> --- paulbrickell <paul.brickell@(protected):
>> I don't think I was clear about what I am seeing. If I have an action tag
>> in my page like this...
>>
>> <div>
>> <s:action name="/some-namespace/myAction" executeResult="true"/>
>> </div>
>>
>> And a struts.xml file that defines a package with the namespace
>> 'some-namespace' that contains an action called myAction I see no call to
>> the target action (I am debugging and have a breakpoint in my action). I
>> simply get a blank space in my output. However if I past a full url in my
>> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
>> well.
>
> Yeah, that's a little weird. If you turn up the logging is there anything
> on
> the console? I mean, clearly it'll work w/ the proper use of the
> "namespace"
> attribute etc. but something on the console might be handy if it isn't
> already there.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_182135.ezm (zipped)
I'm jumping into this thread late, so I apologize if I'm way off-base.
But, is there a reason why you aren't using a front-slash in your
namespace names? Although the docs don't explicitly say it is required,
a leading / seems to show up in each example in the docs.

http://struts.apache.org/2.x/docs/namespace-configuration.html

I would try -
<div>
<s:url id="testUrlId" namespace="/secondary" action="test"/>
<s:a href="%{testUrlId}">execute test action</s:a>
</div>

On Sat, 2008-02-02 at 04:25 -0800, paulbrickell wrote:
> Dave,
>
> OK did as you suggested, cranked up the logging level and I do now get some
> logging. I created a little sandbox app to test out some things with and
> simplifying has really helped. Heres what I have now
>
> <div>
>  <s:action name="test" namespace="secondary" executeResult="true"/>
> </div>
> <div>
>  <s:action name="secondary/test.action" executeResult="true"/>
> </div>
> <div>
>  <s:url id="testUrlId" namespace="secondary" action="test"/>
>  <s:a href="%{testUrlId}">execute test action</s:a>
> </div>
>
>
> Now the first div works exactly as expected.
>
> The second one also works how would expect it to. It Always generates a
> stack trace with the error message "There is no Action mapped for action
> name secondary/test.ation" regardless of how I try to specify the 'path' to
> the action. Now I know that the namespace does not represent a path and that
> I need to use the namespace attribute. I think thats fine and that doesn't
> give me any kind of problem. I can always specify the namespace attribute
> and all is well.
>
> But the third div is my problem. There seems to be no way a can form a URL
> for s:a tag that lets me build a link to the namespaced action. The link
> directs the browser to...
>
> http://localhost:8080/sandbox/secondary/test.action
>
> That seems ok to me. but when I click this link I get this...
>
> [example] DEBUG [http-8080-1] DefaultActionProxy.<init>(65) | Creating an
> DefaultActionProxy for namespace and action name test
> [example] ERROR [http-8080-1] Dispatcher.serviceAction(512) | Could not find
> action or result
> There is no Action mapped for action name test. - [unknown location]
>  at
> com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:186)
>  at
> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:41)
>  at
> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:494)
>  at
> org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
>  at
> org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
>  at
> org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:263)
>  at
> org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
>  at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
>  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>  at java.lang.Thread.run(Unknown Source)
>
>
> (Hope its OK to dump stacktraces here, apologies if its bad form).
>
> it seems from the debug line "[example] DEBUG [http-8080-1]
> DefaultActionProxy.<init>(65) | Creating an DefaultActionProxy for namespace
> and action name test" That there is no namespace defined. I will try to step
> throught the DefaultActionProxy next to find out why that might be.
>
> If thats correct (the link represents a path after all), am I going to have
> to have all my links in the root namespace? I can do this of course, but it
> seems a ilttle restrictive.
>
> Just have to say thanks for all the feedback. I am always impressed with the
> help given on these lists.
>
> Paul B.
>
>
>
> newton.dave wrote:
> >
> > --- paulbrickell <paul.brickell@(protected):
> >> I don't think I was clear about what I am seeing. If I have an action tag
> >> in my page like this...
> >>
> >> <div>
> >> <s:action name="/some-namespace/myAction" executeResult="true"/>
> >> </div>
> >>
> >> And a struts.xml file that defines a package with the namespace
> >> 'some-namespace' that contains an action called myAction I see no call to
> >> the target action (I am debugging and have a breakpoint in my action). I
> >> simply get a blank space in my output. However if I past a full url in my
> >> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all is
> >> well.
> >
> > Yeah, that's a little weird. If you turn up the logging is there anything
> > on
> > the console? I mean, clearly it'll work w/ the proper use of the
> > "namespace"
> > attribute etc. but something on the console might be handy if it isn't
> > already there.
> >
> > Dave
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
> >
>


Attachment: user_182136.ezm (zipped)
not off base at all..
one example is to reference WEB-INF/classes/struts-tags-ui.xml

<package name="ui-tags" extends="struts-default" namespace="/tags/ui">
    <action name="example"
class="org.apache.struts2.showcase.UITagExample">
       <result>example.jsp</result>
       <result name="input">example.jsp</result>
    </action>

which resolves the default result of example.jsp to /tags/ui/example.jsp
specifically..
$TOMCAT_HOME/webapps/struts2-showcase-2.0.11/tags/ui/example.jsp

HTH
Martin--
----- Original Message -----
Wrom: PKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAO
To: "Struts Users Mailing List" <user@(protected)>
Sent: Saturday, February 02, 2008 8:54 AM
Subject: Re: actions defined in a package are visible in other packages??


> I'm jumping into this thread late, so I apologize if I'm way off-base.
> But, is there a reason why you aren't using a front-slash in your
> namespace names? Although the docs don't explicitly say it is required,
> a leading / seems to show up in each example in the docs.
>
> http://struts.apache.org/2.x/docs/namespace-configuration.html
>
> I would try -
> <div>
>  <s:url id="testUrlId" namespace="/secondary" action="test"/>
>  <s:a href="%{testUrlId}">execute test action</s:a>
> </div>
>
> On Sat, 2008-02-02 at 04:25 -0800, paulbrickell wrote:
> > Dave,
> >
> > OK did as you suggested, cranked up the logging level and I do now get
some
> > logging. I created a little sandbox app to test out some things with and
> > simplifying has really helped. Heres what I have now
> >
> > <div>
> >  <s:action name="test" namespace="secondary" executeResult="true"/>
> > </div>
> > <div>
> >  <s:action name="secondary/test.action" executeResult="true"/>
> > </div>
> > <div>
> >  <s:url id="testUrlId" namespace="secondary" action="test"/>
> >  <s:a href="%{testUrlId}">execute test action</s:a>
> > </div>
> >
> >
> > Now the first div works exactly as expected.
> >
> > The second one also works how would expect it to. It Always generates a
> > stack trace with the error message "There is no Action mapped for action
> > name secondary/test.ation" regardless of how I try to specify the 'path'
to
> > the action. Now I know that the namespace does not represent a path and
that
> > I need to use the namespace attribute. I think thats fine and that
doesn't
> > give me any kind of problem. I can always specify the namespace
attribute
> > and all is well.
> >
> > But the third div is my problem. There seems to be no way a can form a
URL
> > for s:a tag that lets me build a link to the namespaced action. The link
> > directs the browser to...
> >
> > http://localhost:8080/sandbox/secondary/test.action
> >
> > That seems ok to me. but when I click this link I get this...
> >
> > [example] DEBUG [http-8080-1] DefaultActionProxy.<init>(65) | Creating
an
> > DefaultActionProxy for namespace and action name test
> > [example] ERROR [http-8080-1] Dispatcher.serviceAction(512) | Could not
find
> > action or result
> > There is no Action mapped for action name test. - [unknown location]
> > at
> >
com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:1
86)
> > at
> >
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsAct
ionProxyFactory.java:41)
> > at
> >
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:494)
> > at
> >
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.jav
a:419)
> > at
> >
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:235)
> > at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
> > at
> >
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
> > at
> >
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:175)
> > at
> >
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128
)
> > at
> >
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102
)
> > at
> >
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
> > at
> >
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:263)
> > at
> >
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
> > at
> >
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:584)
> > at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> > at java.lang.Thread.run(Unknown Source)
> >
> >
> > (Hope its OK to dump stacktraces here, apologies if its bad form).
> >
> > it seems from the debug line "[example] DEBUG [http-8080-1]
> > DefaultActionProxy.<init>(65) | Creating an DefaultActionProxy for
namespace
> > and action name test" That there is no namespace defined. I will try to
step
> > throught the DefaultActionProxy next to find out why that might be.
> >
> > If thats correct (the link represents a path after all), am I going to
have
> > to have all my links in the root namespace? I can do this of course, but
it
> > seems a ilttle restrictive.
> >
> > Just have to say thanks for all the feedback. I am always impressed with
the
> > help given on these lists.
> >
> > Paul B.
> >
> >
> >
> > newton.dave wrote:
> > >
> > > --- paulbrickell <paul.brickell@(protected):
> > >> I don't think I was clear about what I am seeing. If I have an action
tag
> > >> in my page like this...
> > >>
> > >> <div>
> > >> <s:action name="/some-namespace/myAction" executeResult="true"/>
> > >> </div>
> > >>
> > >> And a struts.xml file that defines a package with the namespace
> > >> 'some-namespace' that contains an action called myAction I see no
call to
> > >> the target action (I am debugging and have a breakpoint in my
action). I
> > >> simply get a blank space in my output. However if I past a full url
in my
> > >> browser e.g. http://x.y.org/myApp/some-namespace/myAction.action all
is
> > >> well.
> > >
> > > Yeah, that's a little weird. If you turn up the logging is there
anything
> > > on
> > > the console? I mean, clearly it'll work w/ the proper use of the
> > > "namespace"
> > > attribute etc. but something on the console might be handy if it isn't
> > > already there.
> > >
> > > Dave
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> > >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

©2008 gg3721.com - Jax Systems, LLC, U.S.A.