struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve <>
Subject RE: Struts 2 Annotation Tutorial (additional info)
Date Thu, 29 Sep 2011 04:01:15 GMT
Thank you both for your responses.  

Since I had " <constant name="struts.convention.action.suffix"
value="Controller"/>" listed in my struts.xml file, I tried renaming my
HelloAction class to "HelloController" or "HelloActionController" and tried
various urls to match but no luck.  I even tried removing the
"struts.convention.action.suffix" element but it didn't seem to make any

I've reverted back and below is what I've currently got.

The URL I use is:

My HelloAction class is as follows (sorry for forgetting to send it in the
first place):
package org.apache.struts.struts2annotations.action;

import org.jboss.xnio.log.Logger;

import com.opensymphony.xwork2.ActionSupport;

public class HelloAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private static final Logger logger =
	private String message;

	public String execute() throws Exception {"In execute method of class Hello");
		message = "Hello from Struts 2 with no XML configurtaion";
		return SUCCESS;
	public void setMessage(String message) {
		this.message = message;

	public String getMessage() {
		return message;


-----Original Message-----
From: M. Rakowski [] 
Sent: Wednesday, September 28, 2011 10:49 AM
Subject: Re: Struts 2 Annotation Tutorial (additional info)

I wrote:

 > make sure your Hallo-Action is in class HalloController in package  > (foo and bar are random names)

which is not quite correct:
the prefix of the actions-package can be random.
The sub-packages names defines the url namespace.
For example, you can access the foo.actions.HalloController with
/context-path/hallo and the action with

Regards, Matthias

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message