You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2017/03/27 06:59:41 UTC
[jira] [Comment Edited] (WW-4772) Convention Plugin can't use
${message}
[ https://issues.apache.org/jira/browse/WW-4772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942746#comment-15942746 ]
Lukasz Lenart edited comment on WW-4772 at 3/27/17 6:58 AM:
------------------------------------------------------------
The case is that the Convention plugin is not able locate your action, it directly maps to the JSP - {{/HelloWorld}} request is mapped to {{WEB-INF/content/HelloWorld.jsp}}.
You must tell the Convention plugin where your actions are by setting {{struts.convention.action.packages}} constant, i.e.
{code:xml}
<constant name="struts.convention.action.packages" value="actions"/>
{code}
or use {{actions}} namespace (a package name where the {{HelloWorldAction}} exists) => {{/actions/HelloWorld}} but then you must move the {{HelloWorld.jsp}} to {{WEB-INF/content/actions}} folder.
was (Author: lukaszlenart):
The case is that the Convention plugin is not able to locate your action, it directly maps to the JSP - {{/HelloWorld}} request is mapped to {{WEB-INF/content/HelloWorld.jsp}}.
You must tell the Convention plugin where your actions are by setting {{struts.convention.action.packages}} constant, i.e.
{code:xml}
<constant name="struts.convention.action.packages" value="actions"/>
{code}
or use {{actions}} namespace (a package name where the {{HelloWorldAction}} exists) => {{/actions/HelloWorld}} but then you must move the {{HelloWorld.jsp}} to {{WEB-INF/content/actions}} folder.
> 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
> 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)