From 89962ee6a31cd92a62e56fbb0c9d7e91c9726450 Mon Sep 17 00:00:00 2001 From: Musachy Barroso Date: Mon, 28 May 2007 16:50:52 +0000 Subject: [PATCH] WW-1953 Freemarker templates fail to use the tags defined in the Dojo plugin * The Dojo model was still referencing models from core (submit, anchor and div) git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@542273 13f79535-47bb-0310-9956-ffa450edef68 --- .../views/freemarker/tags/AnchorModel.java | 43 ++++++++++++++++++ .../dojo/views/freemarker/tags/DivModel.java | 44 +++++++++++++++++++ .../views/freemarker/tags/DojoModels.java | 21 +++++++-- .../views/freemarker/tags/SubmitModel.java | 43 ++++++++++++++++++ 4 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java create mode 100644 plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java create mode 100644 plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java new file mode 100644 index 000000000..563dfe63b --- /dev/null +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java @@ -0,0 +1,43 @@ +/* + * $Id$ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.dojo.views.freemarker.tags; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.components.Component; +import org.apache.struts2.dojo.components.Anchor; +import org.apache.struts2.views.freemarker.tags.TagModel; + +import com.opensymphony.xwork2.util.ValueStack; + +/** + * @see Anchor + */ +public class AnchorModel extends TagModel { + + public AnchorModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) { + super(stack, req, res); + } + + @Override + protected Component getBean() { + return new Anchor(stack, req, res); + } + +} diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java new file mode 100644 index 000000000..bc3caec16 --- /dev/null +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java @@ -0,0 +1,44 @@ +/* + * $Id$ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.dojo.views.freemarker.tags; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.components.Component; +import org.apache.struts2.dojo.components.Div; +import org.apache.struts2.views.freemarker.tags.TagModel; + +import com.opensymphony.xwork2.util.ValueStack; + + +/** + * @see Div + */ +public class DivModel extends TagModel { + + public DivModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) { + super(stack, req, res); + } + + @Override + protected Component getBean() { + return new Div(stack, req, res); + } + +} diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java index b3646e66b..78746d05c 100644 --- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java @@ -1,12 +1,25 @@ +/* + * $Id$ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.struts2.dojo.views.freemarker.tags; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.struts2.views.freemarker.tags.AnchorModel; -import org.apache.struts2.views.freemarker.tags.DivModel; -import org.apache.struts2.views.freemarker.tags.SubmitModel; - import com.opensymphony.xwork2.util.ValueStack; public class DojoModels { diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java new file mode 100644 index 000000000..a2afa3c48 --- /dev/null +++ b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java @@ -0,0 +1,43 @@ +/* + * $Id$ + * + * Copyright 2006 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.struts2.dojo.views.freemarker.tags; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.components.Component; +import org.apache.struts2.dojo.components.Submit; +import org.apache.struts2.views.freemarker.tags.TagModel; + +import com.opensymphony.xwork2.util.ValueStack; + +/** + * @see Submit + */ +public class SubmitModel extends TagModel { + + public SubmitModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) { + super(stack, req, res); + } + + @Override + protected Component getBean() { + return new Submit(stack, req, res); + } + +}