struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "fairy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4772) Convention Plugin can't use ${message}
Date Mon, 27 Mar 2017 08:35:41 GMT

    [ https://issues.apache.org/jira/browse/WW-4772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942838#comment-15942838
] 

fairy commented on WW-4772:
---------------------------

Hi ,Thanks for your help very much, I have fixed the problem with your method.
Summary point of attention´╝Ü
     action  name and jsp  name and url mapping relationship
    a. if our action name have two or more words, action name every word had better First
name is capitalized,like HelloWorldAction.
            # it is not required,because the constant will convert action name to lower case
           <constant name="struts.convention.action.name.lowercase" value="true" />
    b. if our action name is HelloWorldAction,so our jsp name must be split between words
with '-' , like this hello-world.jsp
          <constant name="struts.convention.action.name.separator" value="-" />
    c. the Suffix default is action ,so our URL must be is hello-world.action or hello-world

         # the URL mapping should be hello-world.action ,It should be noted that it is not
helloworld.action
          <constant name="struts.convention.action.suffix" value="action" />
    d.Set the root path for the Convention plug-in location view resource
         <constant name="struts.convention.result.path" value="/WEB-INF/content/" />
         #default is content   if you like, you can modify the root path to views
         <constant name="struts.convention.result.path" value="/WEB-INF/views/" />


> Convention Plugin can't use ${message}
> --------------------------------------
>
>                 Key: WW-4772
>                 URL: https://issues.apache.org/jira/browse/WW-4772
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    Affects Versions: 2.5.10
>         Environment: Windows10+JDK7.0_80+tomcat7.0.76
>            Reporter: fairy
>            Assignee: Lukasz Lenart
>              Labels: easyfix
>             Fix For: 2.5.next
>
>         Attachments: struts2-007-Convention-Plugin-HaveActionCode.zip
>
>
> today i fount the plugin maybe have an issue.
> {code}
> public class HelloWorldAction extends ActionSupport {
> 	private String message;
> 	public String getMessage() {
> 		return message;
> 	}
> 	public void setMessage(String message) {
> 		this.message = message;
> 	}
> 	public String execute() {
> 		message = "Hello World, I come from Action Code";
> 		return SUCCESS;
> 	}
> }
> {code}
> HelloWorld.jsp
> {code}
>  This is  ${message}   // the message is null and the action can't be called.
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message