In a Java-based app that takes advantage of Dynamic Component Linking you can do this:
<%@ page import="com.tridion.linking.ComponentLink, com.tridion.linking.Link" %>
<%
string componentUri = "@@Component.ID@@";
ComponentLink componentLink = new ComponentLink("@@PublicationUri@@");
String formActionUrl = componentLink.getLink(componentUri).getURL();
%>
<form action="<%=formActionUrl%>">
TBB to put PublicationUri onto package (assuming you're using TemplateBase):
using Tridion.ContentManager.Templating;
using Tridion.ContentManager.Templating.Assembly;
using Tridion.Extensions.ContentManager.Templating;
namespace ContentBloom.Tridion.Templating
{
[TcmTemplateTitle("Add Publication Uri")]
public class AddPublicationUri : TemplateBase
{
public override void Transform(Engine engine, Package package)
{
Initialize(engine, package);
string pubUri = this.GetPublication().ToString();
package.PushItem("PublicationUri", package.CreateStringItem(ContentType.Text, pubUri));
}
}
}