1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.portals.bridges.struts.taglib;
17
18 import javax.servlet.ServletRequest;
19
20 import org.apache.portals.bridges.struts.PortletServlet;
21
22 /***
23 * Supports the Struts html-el:form tag to be used within a Portlet context.
24 *
25 * @author <a href="mailto:ate@douma.nu">Ate Douma</a>
26 * @version $Id: ELFormTag.java 188222 2005-01-20 02:41:15 +0100 (Thu, 20 Jan 2005) ate $
27 */
28 public class ELFormTag extends org.apache.strutsel.taglib.html.ELFormTag
29 {
30 /***
31 * Modifies the default generated form action url to be a valid Portlet ActionURL
32 * when in the context of a {@link PortletServlet#isPortletRequest(ServletRequest) PortletRequest}.
33 * @return the formStartElement
34 */
35 protected String renderFormStartElement()
36 {
37 if ( PortletServlet.isPortletRequest(pageContext.getRequest() ))
38 {
39 return TagsSupport.getFormTagRenderFormStartElement(pageContext,super.renderFormStartElement());
40 }
41 else
42 {
43 return super.renderFormStartElement();
44 }
45 }
46 }